Ivars 6 роки тому
джерело
коміт
a8cbad357c
6 змінених файлів з 258 додано та 321 видалено
  1. 4
    2
      Downloader.py
  2. 242
    308
      project.wpr
  3. 2
    2
      run.py
  4. 4
    4
      sources/filmix.py
  5. 2
    2
      sources/iplayer.py
  6. 4
    3
      util.py

+ 4
- 2
Downloader.py Переглянути файл

@@ -97,7 +97,7 @@ class DownloadWithProgressFragmented:
97 97
             self.deferred.errback(Exception("Not valid manifest file - %s"%self.url))
98 98
         streams = re.findall(r"#EXT-X-STREAM-INF:.*?BANDWIDTH=(\d+).*?\n(.+?)$", r.content, re.IGNORECASE | re.MULTILINE)
99 99
         if streams:
100
-            sorted(streams, key=lambda item: int(item[0]), reverse=True)
100
+            streams = sorted(streams, key=lambda item: int(item[0]), reverse=True)
101 101
             url = streams[0][1]
102 102
             if not url.startswith("http"):
103 103
                 url = self.base_url + url
@@ -105,6 +105,7 @@ class DownloadWithProgressFragmented:
105 105
                 r = requests.get(url, headers=self.headers)
106 106
             except Exception as e:
107 107
                 self.deferred.errback(Exception("Cannot open manifsest file - %s"%url))
108
+        self.base_url = "/".join(url.split("/")[:-1])+"/"
108 109
         self.ts_list = re.findall(r"#EXTINF:([\d\.]+),.*?\n(.+?)$", r.content, re.IGNORECASE | re.MULTILINE)
109 110
         if not len(self.ts_list):
110 111
             self.deferred.errback(Exception("Cannot read fragment list in  manifsest file - %s"%url))
@@ -265,7 +266,8 @@ if __name__ == "__main__":
265 266
         url= sys.argv[1]
266 267
         output = sys.argv[2]
267 268
     else:
268
-        url = url2 = "http://walterebert.com/playground/video/hls/ts/480x270.m3u8"
269
+        url = url2 = "http://walterebert.com/_/playground/videos/sintel-trailer.m3u8"
270
+        output = "tmp\\test"
269 271
         #url = "https://r3---sn-bavc5ajvh-gpme.googlevideo.com/videoplayback?key=yt6&mime=video%2Fmp4&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&expire=1490986184&lmt=1490940183963773&dur=1302.639&itag=18&ratebypass=yes&mm=31&requiressl=yes&ipbits=0&upn=azFGj8gY02w&ip=85.254.87.15&pl=23&ei=aFDeWLzqDcn-dLC_gdAM&signature=083F353AC09CD98A70AD7D9438DD3C91C781166B.715456B9C35F040BDC4728CA76A0D1779B684A90&source=youtube&mv=m&mt=1490964451&ms=au&mn=sn-bavc5ajvh-gpme&gir=yes&clen=73596250&id=o-AGH9y-hWn1MtW1VzCyI_8XYYEWODsTDBZbfagQH3BrfQ&initcwndbps=4493750"
270 272
         #url = "http://techslides.com/demos/sample-videos/small.mp4"
271 273
         #url = "http://wx17.poiuytrew.pw/s/c507282042b1bf25e0b72c34a68426f3/hd_30/Jackie.2016.D.iTunes.BDRip.1080p_720.mp4"

+ 242
- 308
project.wpr Переглянути файл

@@ -133,6 +133,10 @@ debug.breakpoints = {loc('Downloader.py'): {182L: (0,
133 133
                      loc('sources/euronews.py'): {161L: (0,
134 134
         None,
135 135
         1,
136
+        0)},
137
+                     loc('sources/filmix.py'): {77L: (0,
138
+        None,
139
+        1,
136 140
         0)},
137 141
                      loc('sources/filmon.py'): {49L: (0,
138 142
         None,
@@ -314,7 +318,42 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
314 318
                               ('browser',
315 319
                                'tall',
316 320
                                0,
317
-                               {'all_tree_states': {loc('../../../$Setup/Python/Libs/pyglet-1.0-docs/examples/programming_guide/hello_world.py'): {'c'\
321
+                               {'all_tree_states': {loc('../../../../../Python27/lib/lib-tk/Tkinter.py'): {'e'\
322
+        'xpanded-nodes': [],
323
+        'selected-nodes': [],
324
+        'top-node': [('function def',
325
+                      loc('../../../../../Python27/lib/lib-tk/Tkinter.py'),
326
+                      'At')]},
327
+        loc('../../../../../Python27/lib/lib-tk/tkCommonDialog.py'): {'expan'\
328
+        'ded-nodes': [],
329
+        'selected-nodes': [],
330
+        'top-node': [('class def',
331
+                      loc('../../../../../Python27/lib/lib-tk/tkCommonDialog.py'),
332
+                      'Dialog')]},
333
+        loc('../../../../../Python27/lib/lib-tk/tkMessageBox.py'): {'expande'\
334
+        'd-nodes': [],
335
+        'selected-nodes': [],
336
+        'top-node': [('generic attribute',
337
+                      loc('../../../../../Python27/lib/lib-tk/tkMessageBox.py'),
338
+                      'ABORT')]},
339
+        loc('../../../../../Python27/lib/lib-tk/tkSimpleDialog.py'): {'expan'\
340
+        'ded-nodes': [],
341
+        'selected-nodes': [],
342
+        'top-node': [('function def',
343
+                      loc('../../../../../Python27/lib/lib-tk/tkSimpleDialog.py'),
344
+                      'askfloat')]},
345
+        loc('../../../../../Python27/lib/lib-tk/ttk.py'): {'expanded-nodes': [],
346
+        'selected-nodes': [],
347
+        'top-node': [('class def',
348
+                      loc('../../../../../Python27/lib/lib-tk/ttk.py'),
349
+                      'Button')]},
350
+        loc('../../../../../Python27/lib/site-packages/PIL/Image.py'): {'exp'\
351
+        'anded-nodes': [],
352
+        'selected-nodes': [],
353
+        'top-node': [('generic attribute',
354
+                      loc('../../../../../Python27/lib/site-packages/PIL/Image.py'),
355
+                      'ADAPTIVE')]},
356
+        loc('../../../$Setup/Python/Libs/pyglet-1.0-docs/examples/programming_guide/hello_world.py'): {'c'\
318 357
         'olumn-widths': [1.0],
319 358
         'expanded-nodes': [],
320 359
         'selected-nodes': [],
@@ -450,6 +489,12 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
450 489
         'top-node': [('generic attribute',
451 490
                       loc('../../../Python27/Lib/site-packages/win32com/client/dynamic.py'),
452 491
                       'ALL_INVOKE_TYPES')]},
492
+        loc('../../SplashData/remdup.py'): {'column-widths': [1.0],
493
+        'expanded-nodes': [],
494
+        'selected-nodes': [],
495
+        'top-node': [('generic attribute',
496
+                      loc('../../SplashData/remdup.py'),
497
+                      'f')]},
453 498
         loc('../$test/test2.py'): {'column-widths': [1.0],
454 499
                                    'expanded-nodes': [],
455 500
                                    'selected-nodes': [],
@@ -778,58 +823,17 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
778 823
                                       'top-node': [('generic attribute',
779 824
         loc('../vietas/vietas2.py'),
780 825
         'd_lat')]},
781
-        loc('../../SplashData/remdup.py'): {'column-widths': [1.0],
782
-        'expanded-nodes': [],
783
-        'selected-nodes': [],
784
-        'top-node': [('generic attribute',
785
-                      loc('../../SplashData/remdup.py'),
786
-                      'f')]},
787
-        loc('../../../../../Python27/lib/lib-tk/Tkinter.py'): {'expanded-nod'\
788
-        'es': [],
789
-        'selected-nodes': [],
790
-        'top-node': [('function def',
791
-                      loc('../../../../../Python27/lib/lib-tk/Tkinter.py'),
792
-                      'At')]},
793
-        loc('../../../../../Python27/lib/lib-tk/tkCommonDialog.py'): {'expan'\
794
-        'ded-nodes': [],
795
-        'selected-nodes': [],
796
-        'top-node': [('class def',
797
-                      loc('../../../../../Python27/lib/lib-tk/tkCommonDialog.py'),
798
-                      'Dialog')]},
799
-        loc('../../../../../Python27/lib/lib-tk/tkMessageBox.py'): {'expande'\
800
-        'd-nodes': [],
801
-        'selected-nodes': [],
802
-        'top-node': [('generic attribute',
803
-                      loc('../../../../../Python27/lib/lib-tk/tkMessageBox.py'),
804
-                      'ABORT')]},
805
-        loc('../../../../../Python27/lib/lib-tk/tkSimpleDialog.py'): {'expan'\
806
-        'ded-nodes': [],
807
-        'selected-nodes': [],
808
-        'top-node': [('function def',
809
-                      loc('../../../../../Python27/lib/lib-tk/tkSimpleDialog.py'),
810
-                      'askfloat')]},
811
-        loc('../../../../../Python27/lib/lib-tk/ttk.py'): {'expanded-nodes': [],
812
-        'selected-nodes': [],
813
-        'top-node': [('class def',
814
-                      loc('../../../../../Python27/lib/lib-tk/ttk.py'),
815
-                      'Button')]},
816
-        loc('../../../../../Python27/lib/site-packages/PIL/Image.py'): {'exp'\
817
-        'anded-nodes': [],
818
-        'selected-nodes': [],
819
-        'top-node': [('generic attribute',
820
-                      loc('../../../../../Python27/lib/site-packages/PIL/Image.py'),
821
-                      'ADAPTIVE')]},
822
-        loc('unknown:<untitled> #5'): {'column-widths': [1.0],
826
+        loc('unknown:<untitled> #3'): {'column-widths': [1.0],
823 827
                                        'expanded-nodes': [],
824 828
                                        'selected-nodes': [],
825 829
                                        'top-node': None},
826
-        loc('unknown:<untitled> #6'): {'expanded-nodes': [],
830
+        loc('unknown:<untitled> #5'): {'expanded-nodes': [],
827 831
                                        'selected-nodes': [],
828 832
                                        'top-node': None},
829 833
         loc('unknown:<untitled> #4'): {'expanded-nodes': [],
830 834
                                        'selected-nodes': [],
831 835
                                        'top-node': None},
832
-        loc('unknown:<untitled> #3'): {'column-widths': [1.0],
836
+        loc('unknown:<untitled> #6'): {'column-widths': [1.0],
833 837
                                        'expanded-nodes': [],
834 838
                                        'selected-nodes': [],
835 839
                                        'top-node': None}},
@@ -857,7 +861,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
857 861
                                None)],
858 862
                  'primary_view_state': {'area': 'wide',
859 863
         'constraint': None,
860
-        'current_pages': [4,
864
+        'current_pages': [2,
861 865
                           0],
862 866
         'notebook_display': 'normal',
863 867
         'notebook_percent': 0.4595676541232986,
@@ -893,7 +897,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
893 897
                                        'fRegexFlags': 46,
894 898
                                        'fReplaceText': u'filmix.co',
895 899
                                        'fReverse': False,
896
-                                       'fSearchText': u'filmix.me',
900
+                                       'fSearchText': u'filmix\\.m',
897 901
                                        'fStartPos': 0,
898 902
                                        'fStyle': 'text',
899 903
                                        'fWholeWords': False,
@@ -906,7 +910,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
906 910
                                       'fReplaceOnDisk': False,
907 911
                                       'fShowFirstMatch': False,
908 912
                                       'fShowLineno': True,
909
-                                      'fShowReplaceWidgets': True}}),
913
+                                      'fShowReplaceWidgets': False}}),
910 914
                      ('batch-search',
911 915
                       'wide',
912 916
                       0,
@@ -1021,180 +1025,19 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1021 1025
                        'selection_end': 174L,
1022 1026
                        'selection_start': 174L,
1023 1027
                        'zoom': 0L})],
1024
-        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('sources/ltc.py'),
1028
+        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('sources/filmix.py'),
1025 1029
         {'attrib-starts': [('Source',
1026
-                            26),
1027
-                           ('Source.get_content',
1028
-                            78)],
1029
-         'first-line': 174L,
1030
-         'folded-linenos': [108L,
1031
-                            131L,
1032
-                            160L,
1033
-                            220L,
1034
-                            231L,
1035
-                            257L,
1036
-                            276L,
1037
-                            295L,
1038
-                            319L,
1039
-                            349L,
1040
-                            350L,
1041
-                            367L,
1042
-                            398L,
1043
-                            411L,
1044
-                            525L],
1045
-         'sel-line': 184L,
1046
-         'sel-line-start': 8707L,
1047
-         'selection_end': 8757L,
1048
-         'selection_start': 8754L,
1030
+                            31),
1031
+                           ('Source.get_movie_info',
1032
+                            355)],
1033
+         'first-line': 354L,
1034
+         'folded-linenos': [],
1035
+         'sel-line': 362L,
1036
+         'sel-line-start': 16151L,
1037
+         'selection_end': 16181L,
1038
+         'selection_start': 16181L,
1049 1039
          'zoom': 0L},
1050
-        1524827996.646],
1051
-        [loc('sources/ltc.py'),
1052
-         {'attrib-starts': [('Source',
1053
-                             26),
1054
-                            ('Source.__init__',
1055
-                             28)],
1056
-          'first-line': 31L,
1057
-          'folded-linenos': [108L,
1058
-                             131L,
1059
-                             160L,
1060
-                             220L,
1061
-                             231L,
1062
-                             257L,
1063
-                             276L,
1064
-                             295L,
1065
-                             319L,
1066
-                             349L,
1067
-                             350L,
1068
-                             367L,
1069
-                             398L,
1070
-                             411L,
1071
-                             525L],
1072
-          'sel-line': 36L,
1073
-          'sel-line-start': 1390L,
1074
-          'selection_end': 1451L,
1075
-          'selection_start': 1448L,
1076
-          'zoom': 0L},
1077
-         1524828002.53],
1078
-        [loc('sources/ltc.py'),
1079
-         {'attrib-starts': [('Source',
1080
-                             26),
1081
-                            ('Source.get_content',
1082
-                             78)],
1083
-          'first-line': 92L,
1084
-          'folded-linenos': [108L,
1085
-                             131L,
1086
-                             160L,
1087
-                             220L,
1088
-                             231L,
1089
-                             257L,
1090
-                             276L,
1091
-                             295L,
1092
-                             319L,
1093
-                             349L,
1094
-                             350L,
1095
-                             367L,
1096
-                             398L,
1097
-                             411L,
1098
-                             525L],
1099
-          'sel-line': 102L,
1100
-          'sel-line-start': 4467L,
1101
-          'selection_end': 4494L,
1102
-          'selection_start': 4491L,
1103
-          'zoom': 0L},
1104
-         1524828004.058],
1105
-        [loc('sources/ltc.py'),
1106
-         {'attrib-starts': [('Source',
1107
-                             26),
1108
-                            ('Source.__init__',
1109
-                             28)],
1110
-          'first-line': 31L,
1111
-          'folded-linenos': [108L,
1112
-                             131L,
1113
-                             160L,
1114
-                             220L,
1115
-                             231L,
1116
-                             257L,
1117
-                             276L,
1118
-                             295L,
1119
-                             319L,
1120
-                             349L,
1121
-                             350L,
1122
-                             367L,
1123
-                             398L,
1124
-                             411L,
1125
-                             525L],
1126
-          'sel-line': 36L,
1127
-          'sel-line-start': 1390L,
1128
-          'selection_end': 1451L,
1129
-          'selection_start': 1448L,
1130
-          'zoom': 0L},
1131
-         1524828020.442],
1132
-        [loc('sources/ltc.py'),
1133
-         {'attrib-starts': [('Source',
1134
-                             26),
1135
-                            ('Source.get_streams',
1136
-                             549)],
1137
-          'first-line': 555L,
1138
-          'folded-linenos': [108L,
1139
-                             131L,
1140
-                             160L,
1141
-                             220L,
1142
-                             231L,
1143
-                             257L,
1144
-                             276L,
1145
-                             295L,
1146
-                             319L,
1147
-                             349L,
1148
-                             350L,
1149
-                             367L,
1150
-                             398L,
1151
-                             411L,
1152
-                             525L],
1153
-          'sel-line': 564L,
1154
-          'sel-line-start': 33428L,
1155
-          'selection_end': 33428L,
1156
-          'selection_start': 33428L,
1157
-          'zoom': 0L},
1158
-         1526594085.844],
1159
-        [loc('sources/filmix.py'),
1160
-         {'attrib-starts': [('Source',
1161
-                             31),
1162
-                            ('Source.get_streams',
1163
-                             263)],
1164
-          'first-line': 2L,
1165
-          'folded-linenos': [],
1166
-          'sel-line': 288L,
1167
-          'sel-line-start': 12733L,
1168
-          'selection_end': 12813L,
1169
-          'selection_start': 12813L,
1170
-          'zoom': 0L},
1171
-         1526594099.017],
1172
-        [loc('sources/filmix.py'),
1173
-         {'attrib-starts': [('Source',
1174
-                             31),
1175
-                            ('Source.get_movie_info',
1176
-                             355)],
1177
-          'first-line': 354L,
1178
-          'folded-linenos': [],
1179
-          'sel-line': 362L,
1180
-          'sel-line-start': 16151L,
1181
-          'selection_end': 16178L,
1182
-          'selection_start': 16172L,
1183
-          'zoom': 0L},
1184
-         1526594100.287],
1185
-        [loc('sources/filmix.py'),
1186
-         {'attrib-starts': [('Source',
1187
-                             31),
1188
-                            ('Source.get_movie_info',
1189
-                             355)],
1190
-          'first-line': 354L,
1191
-          'folded-linenos': [],
1192
-          'sel-line': 362L,
1193
-          'sel-line-start': 16151L,
1194
-          'selection_end': 16181L,
1195
-          'selection_start': 16181L,
1196
-          'zoom': 0L},
1197
-         1526594111.402],
1040
+        1526594111.402],
1198 1041
         [loc('sources/filmix.py'),
1199 1042
          {'attrib-starts': [('Source',
1200 1043
                              31),
@@ -1350,7 +1193,98 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1350 1193
           'selection_end': 8759L,
1351 1194
           'selection_start': 8759L,
1352 1195
           'zoom': 0L},
1353
-         1526594136.652]],
1196
+         1526594136.652],
1197
+        [loc('sources/filmix.py'),
1198
+         {'attrib-starts': [('Source',
1199
+                             31),
1200
+                            ('Source.process_list',
1201
+                             191)],
1202
+          'first-line': 158L,
1203
+          'folded-linenos': [],
1204
+          'sel-line': 196L,
1205
+          'sel-line-start': 8666L,
1206
+          'selection_end': 8759L,
1207
+          'selection_start': 8750L,
1208
+          'zoom': 0L},
1209
+         1527704531.002],
1210
+        [loc('sources/filmix.py'),
1211
+         {'attrib-starts': [('Source',
1212
+                             31),
1213
+                            ('Source.get_content',
1214
+                             56)],
1215
+          'first-line': 97L,
1216
+          'folded-linenos': [],
1217
+          'sel-line': 108L,
1218
+          'sel-line-start': 4093L,
1219
+          'selection_end': 4157L,
1220
+          'selection_start': 4147L,
1221
+          'zoom': 0L},
1222
+         1527705466.631],
1223
+        [loc('sources/filmix.py'),
1224
+         {'attrib-starts': [('Source',
1225
+                             31),
1226
+                            ('Source.get_content',
1227
+                             56)],
1228
+          'first-line': 100L,
1229
+          'folded-linenos': [],
1230
+          'sel-line': 108L,
1231
+          'sel-line-start': 4093L,
1232
+          'selection_end': 4157L,
1233
+          'selection_start': 4147L,
1234
+          'zoom': 0L},
1235
+         1527705471.619],
1236
+        [loc('sources/filmix.py'),
1237
+         {'attrib-starts': [('Source',
1238
+                             31),
1239
+                            ('Source.get_content',
1240
+                             56)],
1241
+          'first-line': 100L,
1242
+          'folded-linenos': [],
1243
+          'sel-line': 108L,
1244
+          'sel-line-start': 4093L,
1245
+          'selection_end': 4156L,
1246
+          'selection_start': 4147L,
1247
+          'zoom': 0L},
1248
+         1527705472.413],
1249
+        [loc('sources/filmix.py'),
1250
+         {'attrib-starts': [('Source',
1251
+                             31),
1252
+                            ('Source.get_content',
1253
+                             56)],
1254
+          'first-line': 166L,
1255
+          'folded-linenos': [],
1256
+          'sel-line': 177L,
1257
+          'sel-line-start': 7581L,
1258
+          'selection_end': 7635L,
1259
+          'selection_start': 7627L,
1260
+          'zoom': 0L},
1261
+         1527705473.294],
1262
+        [loc('sources/filmix.py'),
1263
+         {'attrib-starts': [('Source',
1264
+                             31),
1265
+                            ('Source.get_content',
1266
+                             56)],
1267
+          'first-line': 166L,
1268
+          'folded-linenos': [],
1269
+          'sel-line': 177L,
1270
+          'sel-line-start': 7581L,
1271
+          'selection_end': 7637L,
1272
+          'selection_start': 7637L,
1273
+          'zoom': 0L},
1274
+         1527705479.241],
1275
+        [loc('sources/filmix.py'),
1276
+         {'attrib-starts': [('Source',
1277
+                             31),
1278
+                            ('Source.process_list',
1279
+                             191)],
1280
+          'first-line': 184L,
1281
+          'folded-linenos': [],
1282
+          'sel-line': 195L,
1283
+          'sel-line-start': 8554L,
1284
+          'selection_end': 8610L,
1285
+          'selection_start': 8610L,
1286
+          'zoom': 0L},
1287
+         1527705483.405]],
1354 1288
         20),
1355 1289
         'current-loc': loc('sources/filmix.py'),
1356 1290
         'editor-state-list': [(loc('run.py'),
@@ -1367,13 +1301,13 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1367 1301
                                 'zoom': 0L}),
1368 1302
                               (loc('util.py'),
1369 1303
                                {'attrib-starts': [('unescape',
1370
-        538)],
1371
-                                'first-line': 537L,
1304
+        539)],
1305
+                                'first-line': 538L,
1372 1306
                                 'folded-linenos': [],
1373
-                                'sel-line': 540L,
1374
-                                'sel-line-start': 16550L,
1375
-                                'selection_end': 16598L,
1376
-                                'selection_start': 16598L,
1307
+                                'sel-line': 541L,
1308
+                                'sel-line-start': 17147L,
1309
+                                'selection_end': 17195L,
1310
+                                'selection_start': 17195L,
1377 1311
                                 'zoom': 0L}),
1378 1312
                               (loc('ContentSources.py'),
1379 1313
                                {'attrib-starts': [('ContentSources',
@@ -1486,16 +1420,16 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1486 1420
                               (loc('sources/filmix.py'),
1487 1421
                                {'attrib-starts': [('Source',
1488 1422
         31),
1489
-        ('Source.process_list',
1490
-         191)],
1491
-                                'first-line': 188L,
1423
+        ('Source.get_content',
1424
+         56)],
1425
+                                'first-line': 83L,
1492 1426
                                 'folded-linenos': [],
1493
-                                'sel-line': 196L,
1494
-                                'sel-line-start': 8666L,
1495
-                                'selection_end': 8759L,
1496
-                                'selection_start': 8750L,
1427
+                                'sel-line': 94L,
1428
+                                'sel-line-start': 3471L,
1429
+                                'selection_end': 3471L,
1430
+                                'selection_start': 3471L,
1497 1431
                                 'zoom': 0L})],
1498
-        'has-focus': False,
1432
+        'has-focus': True,
1499 1433
         'locked': False},
1500 1434
         [loc('run.py'),
1501 1435
          loc('util.py'),
@@ -1517,9 +1451,9 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1517 1451
         u'sources/config.py',
1518 1452
         u'sources/euronews.py',
1519 1453
         u'sources/lmt.py',
1454
+        u'sources/ltc.py',
1520 1455
         u'sources/replay.py',
1521 1456
         u'util.py',
1522
-        u'sources/ltc.py',
1523 1457
         u'sources/filmix.py']},
1524 1458
         'saved_notebook_display': None,
1525 1459
         'split_percents': {0: 0.5061155630535639},
@@ -1536,8 +1470,8 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1536 1470
                          2434,
1537 1471
                          1440)}]}
1538 1472
 guimgr.recent-documents = [loc('sources/filmix.py'),
1539
-                           loc('sources/ltc.py'),
1540 1473
                            loc('util.py'),
1474
+                           loc('sources/ltc.py'),
1541 1475
                            loc('sources/replay.py'),
1542 1476
                            loc('changelog.md'),
1543 1477
                            loc('run.py'),
@@ -1547,7 +1481,74 @@ guimgr.recent-documents = [loc('sources/filmix.py'),
1547 1481
                            loc('resolver.py'),
1548 1482
                            loc('Downloader.py'),
1549 1483
                            loc('sources/lmt.py')]
1550
-guimgr.visual-state = {loc('../../../Python25/Lib/BeautifulSoup.py'): {'attr'\
1484
+guimgr.visual-state = {loc('../../../../../Python27/lib/ftplib.py'): {'attri'\
1485
+        'b-starts': [],
1486
+        'first-line': 0L,
1487
+        'folded-linenos': [],
1488
+        'sel-line': 0L,
1489
+        'sel-line-start': 0L,
1490
+        'selection_end': 0L,
1491
+        'selection_start': 0L,
1492
+        'zoom': 0L},
1493
+                       loc('../../../../../Python27/lib/lib-tk/Tkinter.py'): {'a'\
1494
+        'ttrib-starts': [('CallWrapper',
1495
+                          1528),
1496
+                         ('CallWrapper.__call__',
1497
+                          1536)],
1498
+        'first-line': 1537L,
1499
+        'folded-linenos': [],
1500
+        'sel-line': 1542L,
1501
+        'sel-line-start': 60799L,
1502
+        'selection_end': 60799L,
1503
+        'selection_start': 60799L,
1504
+        'zoom': 0L},
1505
+                       loc('../../../../../Python27/lib/lib-tk/tkCommonDialog.py'): {'a'\
1506
+        'ttrib-starts': [('Dialog',
1507
+                          12)],
1508
+        'first-line': 12L,
1509
+        'folded-linenos': [],
1510
+        'sel-line': 12L,
1511
+        'sel-line-start': 298L,
1512
+        'selection_end': 298L,
1513
+        'selection_start': 298L,
1514
+        'zoom': 0L},
1515
+                       loc('../../../../../Python27/lib/lib-tk/tkSimpleDialog.py'): {'a'\
1516
+        'ttrib-starts': [('Dialog',
1517
+                          29),
1518
+                         ('Dialog.__init__',
1519
+                          36)],
1520
+        'first-line': 61L,
1521
+        'folded-linenos': [],
1522
+        'sel-line': 76L,
1523
+        'sel-line-start': 1627L,
1524
+        'selection_end': 1686L,
1525
+        'selection_start': 1686L,
1526
+        'zoom': 0L},
1527
+                       loc('../../../../../Python27/lib/site-packages/requests/adapters.py'): {'a'\
1528
+        'ttrib-starts': [('HTTPAdapter',
1529
+                          80),
1530
+                         ('HTTPAdapter.send',
1531
+                          387)],
1532
+        'first-line': 493L,
1533
+        'folded-linenos': [],
1534
+        'sel-line': 505L,
1535
+        'sel-line-start': 20166L,
1536
+        'selection_end': 20166L,
1537
+        'selection_start': 20166L,
1538
+        'zoom': 0L},
1539
+                       loc('../../../../../Python27/lib/site-packages/requests/models.py'): {'a'\
1540
+        'ttrib-starts': [('Response',
1541
+                          577),
1542
+                         ('Response.content',
1543
+                          810)],
1544
+        'first-line': 819L,
1545
+        'folded-linenos': [],
1546
+        'sel-line': 827L,
1547
+        'sel-line-start': 29594L,
1548
+        'selection_end': 29594L,
1549
+        'selection_start': 29594L,
1550
+        'zoom': 0L},
1551
+                       loc('../../../Python25/Lib/BeautifulSoup.py'): {'attr'\
1551 1552
         'ib-starts': [('NavigableString',
1552 1553
                        354),
1553 1554
                       ('NavigableString.__getattr__',
@@ -1996,73 +1997,6 @@ guimgr.visual-state = {loc('../../../Python25/Lib/BeautifulSoup.py'): {'attr'\
1996 1997
         'sel-line-start': 0,
1997 1998
         'selection_end': 1,
1998 1999
         'selection_start': 1},
1999
-                       loc('../../../../../Python27/lib/ftplib.py'): {'attri'\
2000
-        'b-starts': [],
2001
-        'first-line': 0L,
2002
-        'folded-linenos': [],
2003
-        'sel-line': 0L,
2004
-        'sel-line-start': 0L,
2005
-        'selection_end': 0L,
2006
-        'selection_start': 0L,
2007
-        'zoom': 0L},
2008
-                       loc('../../../../../Python27/lib/lib-tk/Tkinter.py'): {'a'\
2009
-        'ttrib-starts': [('CallWrapper',
2010
-                          1528),
2011
-                         ('CallWrapper.__call__',
2012
-                          1536)],
2013
-        'first-line': 1537L,
2014
-        'folded-linenos': [],
2015
-        'sel-line': 1542L,
2016
-        'sel-line-start': 60799L,
2017
-        'selection_end': 60799L,
2018
-        'selection_start': 60799L,
2019
-        'zoom': 0L},
2020
-                       loc('../../../../../Python27/lib/lib-tk/tkCommonDialog.py'): {'a'\
2021
-        'ttrib-starts': [('Dialog',
2022
-                          12)],
2023
-        'first-line': 12L,
2024
-        'folded-linenos': [],
2025
-        'sel-line': 12L,
2026
-        'sel-line-start': 298L,
2027
-        'selection_end': 298L,
2028
-        'selection_start': 298L,
2029
-        'zoom': 0L},
2030
-                       loc('../../../../../Python27/lib/lib-tk/tkSimpleDialog.py'): {'a'\
2031
-        'ttrib-starts': [('Dialog',
2032
-                          29),
2033
-                         ('Dialog.__init__',
2034
-                          36)],
2035
-        'first-line': 61L,
2036
-        'folded-linenos': [],
2037
-        'sel-line': 76L,
2038
-        'sel-line-start': 1627L,
2039
-        'selection_end': 1686L,
2040
-        'selection_start': 1686L,
2041
-        'zoom': 0L},
2042
-                       loc('../../../../../Python27/lib/site-packages/requests/adapters.py'): {'a'\
2043
-        'ttrib-starts': [('HTTPAdapter',
2044
-                          80),
2045
-                         ('HTTPAdapter.send',
2046
-                          387)],
2047
-        'first-line': 493L,
2048
-        'folded-linenos': [],
2049
-        'sel-line': 505L,
2050
-        'sel-line-start': 20166L,
2051
-        'selection_end': 20166L,
2052
-        'selection_start': 20166L,
2053
-        'zoom': 0L},
2054
-                       loc('../../../../../Python27/lib/site-packages/requests/models.py'): {'a'\
2055
-        'ttrib-starts': [('Response',
2056
-                          577),
2057
-                         ('Response.content',
2058
-                          810)],
2059
-        'first-line': 819L,
2060
-        'folded-linenos': [],
2061
-        'sel-line': 827L,
2062
-        'sel-line-start': 29594L,
2063
-        'selection_end': 29594L,
2064
-        'selection_start': 29594L,
2065
-        'zoom': 0L},
2066 2000
                        loc('x-wingide-zip://C:/Python25/Lib/site-packages/argparse-1.1-py2.5.egg//argparse.py'): {'a'\
2067 2001
         'ttrib-starts': [('_ActionsContainer',
2068 2002
                           1187),
@@ -2093,7 +2027,8 @@ search.replace-history = [u'filmix.co',
2093 2027
                           u'https://replay.lsm.lv',
2094 2028
                           u'www.shortcut.lv',
2095 2029
                           u'shortcut.lv']
2096
-search.search-history = [u'filmix.me',
2030
+search.search-history = [u'filmix\\.m',
2031
+                         u'filmix.me',
2097 2032
                          u'1.4',
2098 2033
                          u'1.3',
2099 2034
                          u'img =',
@@ -2111,8 +2046,7 @@ search.search-history = [u'filmix.me',
2111 2046
                          u'img',
2112 2047
                          u'desc',
2113 2048
                          u'unqute',
2114
-                         u'raise',
2115
-                         u'can not find ']
2049
+                         u'raise']
2116 2050
 testing.stored-results = (1,
2117 2051
                           [],
2118 2052
                           {})

+ 2
- 2
run.py Переглянути файл

@@ -1,6 +1,6 @@
1 1
 #!/usr/bin/env python
2 2
 # coding=utf8
3
-import sys, os, traceback
3
+import sys, os, traceback, tempfile
4 4
 from Tkinter import *
5 5
 #try:
6 6
 #    from ttk import *
@@ -363,7 +363,7 @@ class VideoInfo(tkd.Dialog):
363 363
             self.img = streams[0]["img"]
364 364
             self.desc = streams[0]["desc"]
365 365
         self.picons_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "picons")
366
-        self.tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "tmp")
366
+        self.tmp_path = tempfile.gettempdir()  #os.path.join(os.path.dirname(os.path.abspath(__file__)), "tmp")
367 367
         self.result = None
368 368
         tkd.Dialog.__init__(self, parent, self.title)
369 369
 

+ 4
- 4
sources/filmix.py Переглянути файл

@@ -106,7 +106,7 @@ Cookie: FILMIXNET=%s;
106 106
             m = re.search('<span class="menu-title">%s</span>(.+?)<li>\s+?<span'%sname, r, re.DOTALL|re.UNICODE)
107 107
             if not m: return content
108 108
             r2 = m.group(1)
109
-            result = re.findall(r'<a .*?href="https://filmix\.me/([^"]+)".*?>([^<]+)</', r2, re.DOTALL)
109
+            result = re.findall(r'<a .*?href="https://filmix\.co/([^"]+)".*?>([^<]+)</', r2, re.DOTALL)
110 110
             for item in result:
111 111
                 if "catalog" in item[0]: continue
112 112
                 title = item[1]
@@ -175,7 +175,7 @@ Cookie: FILMIXNET=%s;
175 175
             r = r.decode("cp1251").encode("utf8")
176 176
             content = self.process_list(r, content)
177 177
             if '<div class="navigation">' in r:
178
-                m = re.search(r'href="https://filmix\.me/([^"]+)" class="next icon-arowRight btn-tooltip"', r, re.DOTALL)
178
+                m = re.search(r'href="https://filmix\.co/([^"]+)" class="next icon-arowRight btn-tooltip"', r, re.DOTALL)
179 179
                 if m:
180 180
                     data2 = m.group(1)
181 181
                 else:
@@ -193,7 +193,7 @@ Cookie: FILMIXNET=%s;
193 193
         for r2 in re.findall('<article class="shortstory line".+?</article>', r, re.DOTALL):
194 194
             #m2 = re.search(r'<a class="watch icon-play" itemprop="url" href="([^"]+)"', r2, re.DOTALL)
195 195
             #<a class="watch icon-play" itemprop="url" href="https://filmix.co/dramy/110957-stolik-19-2017.html"
196
-            #m = re.search(r'<a href="https://filmix\.me/play/(\d+)" class="watch icon-play">', r2, re.DOTALL)
196
+            #m = re.search(r'<a href="https://filmix\.co/play/(\d+)" class="watch icon-play">', r2, re.DOTALL)
197 197
             m = re.search(r'<a class="watch icon-play" itemprop="url" href="https://filmix.co/\w+/(\d+)-', r2, re.DOTALL)
198 198
             if not m: continue
199 199
             vid = m.group(1)
@@ -203,7 +203,7 @@ Cookie: FILMIXNET=%s;
203 203
             m = re.search('itemprop="alternativeHeadline" content="([^"]+)"', r2, re.DOTALL)
204 204
             if m:
205 205
                 title = title + "/"+m.group(1)
206
-            m = re.search(r'img src="(https://filmix\.me/uploads/posters/thumbs/[^"]+)"', r2)
206
+            m = re.search(r'img src="(https://filmix\.co/uploads/posters/thumbs/[^"]+)"', r2)
207 207
             img = m.group(1) if m else self.img
208 208
 
209 209
             m = re.search(r'<a itemprop="copyrightYear".+?>(\d+)<', r2, re.DOTALL)

+ 2
- 2
sources/iplayer.py Переглянути файл

@@ -378,11 +378,11 @@ Connection: Keep-Alive
378 378
             if "subtitle" in ep:
379 379
                 title = title +". "+ ep["subtitle"]
380 380
             title = title
381
-            desc = ep["synopses"]["medium"] if "medium" in ep["synopses"] else p["synopses"]["small"] if "small" in ep["synopses"] else title
381
+            desc = ep["synopses"]["medium"] if "medium" in ep["synopses"] else ep["synopses"]["small"] if "small" in ep["synopses"] else title
382 382
             desc = desc
383 383
             ver = ep["versions"][0]
384 384
             vid = ver["id"]
385
-            remaining = ver["availability"]["end"].split("T")[0] #["remaining"]["text"]
385
+            remaining = ver["availability"]["end"].split("T")[0] if "end" in ver["availability"] else ver["availability"]["remaining"]["text"]
386 386
             duration = ver["duration"]["text"]
387 387
             first_broadcast = ver["first_broadcast"]
388 388
             desc =u"%s\n%s\%s\n%s\n%s"%(title,duration,remaining,first_broadcast,desc)

+ 4
- 3
util.py Переглянути файл

@@ -87,11 +87,12 @@ def nfo2desc(nfo):
87 87
             title = title + ": "
88 88
         if t in nfo and nfo[t]:
89 89
             if isinstance(nfo[t],list):
90
-                return "\n" + title + ",".join(nfo[t])
90
+                d = "\n" + title + ",".join(nfo[t])
91 91
             else:
92
-                return "\n" + title + nfo[t]
92
+                d = "\n" + title + nfo[t]
93 93
         else:
94
-            return ""
94
+            d = ""
95
+        return d.encode("utf8") if isinstance(d, unicode) else d
95 96
 
96 97
     desc += ddd("tagline")
97 98
     if "plot" in nfo and "tagline" in nfo and nfo["tagline"] <> nfo["plot"]: