Преглед на файлове

[bug] filmix get_streams

Ivars преди 7 години
родител
ревизия
a3e7639840
променени са 5 файла, в които са добавени 19 реда и са изтрити 13 реда
  1. 1
    1
      ContentSources.py
  2. 1
    1
      PlayStream.py
  3. Двоични данни
      release/enigma2-plugin-extensions-playstream_0.6k.ipk
  4. 15
    9
      sources/filmix.py
  5. 2
    2
      util.py

+ 1
- 1
ContentSources.py Целия файл

@@ -176,7 +176,7 @@ if __name__ == "__main__":
176 176
     while True:
177 177
         print
178 178
         for i,item in enumerate(content):
179
-            s = "%i: %s - %s %s %s "%(i,item[0],item[1],item[2],item[3])
179
+            s = "%i: %s - %s %s"%(i,item[0],item[1],item[2])
180 180
             print s #.encode(sys.stdout.encoding,"replace")
181 181
 
182 182
         while True:

+ 1
- 1
PlayStream.py Целия файл

@@ -6,7 +6,7 @@
6 6
 # Used fragments of code from enigma2-plugin-tv3play by Taapat (https://github.com/Taapat/enigma2-plugin-tv3play)
7 7
 #
8 8
 
9
-__version__ = "0.6j"
9
+__version__ = "0.6k"
10 10
 __id__ = "playstream"
11 11
 __title__ = "PlayStream"
12 12
 __author__ = "ivars777@gmail.com"

Двоични данни
release/enigma2-plugin-extensions-playstream_0.6k.ipk Целия файл


+ 15
- 9
sources/filmix.py Целия файл

@@ -110,6 +110,7 @@ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
110 110
                 if translations[pl].startswith("http"):
111 111
                     continue
112 112
                 pl_link = translations[pl]
113
+                lang = pl.encode("utf8")
113 114
                 break
114 115
             else:
115 116
                 raise Exception("No episodes list found!")
@@ -222,21 +223,26 @@ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
222 223
         desc = desc0 =  util.unescape(m.group(1).strip()) if m else ""
223 224
         m = re.search('itemprop="contentUrl" content="(.+?)"', r, re.IGNORECASE | re.DOTALL)
224 225
         if not m:
225
-        #    #raise Exception("Can not find video link")
226
-            return []
226
+            raise Exception("Can not find video link")
227
+            #return []
227 228
         video_link = m.group(1)
228 229
         series = True if video_link == '{video-link}' else False
229 230
         vid = plist[1]
230 231
         js = self.get_movie_info(vid)
231
-        if js["message"]["translations"]["flash"]:
232
-            video_link = js["message"]["translations"]["flash"].values()[0].encode("utf8")
233
-            video_link = self.decode_uppod_text(video_link)
234
-            lang = js["message"]["translations"]["flash"].keys()[0].encode("utf8") # TODO process several players/streams
232
+        translations = js["message"]["translations"]["flash"]
233
+        for pl in translations:
234
+            if translations[pl].startswith("http"):
235
+                continue
236
+            pl_link = translations[pl]
237
+            lang = pl.encode("utf8")
238
+            break
235 239
         else:
236
-            return []
240
+            raise Exception("No episodes list found!")
241
+        if not pl_link.startswith("http"):
242
+            pl_link = self.decode_uppod_text(pl_link)
237 243
 
238 244
         if not series : # Filma
239
-            url0 = video_link
245
+            url0 = pl_link
240 246
             streams2 = self.get_streams2(url0)
241 247
             for st in streams2:
242 248
                 stream = util.item()
@@ -249,7 +255,7 @@ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
249 255
             return streams
250 256
 
251 257
         else: # Seriāls
252
-            pl_link = video_link
258
+            #pl_link = video_link
253 259
             js = self._http_request(pl_link)
254 260
             js = self.decode_uppod_text(js)
255 261
             js = json.loads(js)

+ 2
- 2
util.py Целия файл

@@ -104,7 +104,7 @@ def nfo2desc(nfo):
104 104
     desc += ddd("actor","Actors")
105 105
     desc += ddd("language","Languages")
106 106
     desc += ddd("quality","Quality")
107
-    return desc.encode("utf8")
107
+    return desc.encode("utf8") if isinstance(desc,unicode) else desc
108 108
 
109 109
 def nfo2title(nfo):
110 110
     if not "title" in nfo:
@@ -114,7 +114,7 @@ def nfo2title(nfo):
114 114
         title +=" ~ "+nfo["originaltitle"]
115 115
     if "year" in nfo and nfo["year"]:
116 116
         title += " (%s)"%nfo["year"]
117
-    return title.encode("utf8")
117
+    return title.encode("utf8") if isinstance(title,unicode) else title
118 118
 
119 119
 def play_video(streams):
120 120
     if len(streams)>1: