Browse Source

lasa cfg failu no http un ftp linka

Ivars 6 years ago
parent
commit
f4c673962f
2 changed files with 336 additions and 280 deletions
  1. 295
    267
      project.wpr
  2. 41
    13
      sources/config.py

+ 295
- 267
project.wpr View File

@@ -36,7 +36,7 @@ proj.launch-config = {loc('ContentSources.py'): ('project',
36 36
         (u'https://walterebert.com/playground/video/hls/sintel-trailer.m3u8',
37 37
          '')),
38 38
                       loc('run.py'): ('project',
39
-                                      (u'config::home  ',
39
+                                      (u'config::home sources\\cfg0\\streams_al.cfg',
40 40
                                        '')),
41 41
                       loc('sources/lmt.py'): ('project',
42 42
         (u'home',
@@ -114,11 +114,11 @@ debug.breakpoints = {loc('Downloader.py'): {182L: (0,
114 114
         None,
115 115
         1,
116 116
         0)},
117
-                     loc('sources/euronews.py'): {161L: (0,
117
+                     loc('sources/config.py'): {50L: (0,
118 118
         None,
119 119
         1,
120 120
         0)},
121
-                     loc('sources/filmix.py'): {121L: (0,
121
+                     loc('sources/euronews.py'): {161L: (0,
122 122
         None,
123 123
         1,
124 124
         0)},
@@ -222,12 +222,17 @@ debug.recent-run-args = {loc('ContentSources.py'): [u'config::home streams_bernu
222 222
         u'--slud'],
223 223
                          loc('kivy_test.py'): [u'https://walterebert.com/playground/video/hls/sintel-trailer.m3u8',
224 224
         u'https://dl4.sanii.co/files/2/60e13omc1cpph2/video.mp4'],
225
-                         loc('run.py'): [u'config::home  ',
225
+                         loc('run.py'): [u'config::home sources\\cfg0\\streams_al.cfg',
226
+        u'config::home ',
227
+        u'config::home  ftp://user:Kaskade7@home.blue.lv/hdd/streams_al.cfg',
228
+        u'config::home  ftps://user:Kaskade7@home.blue.lv/hdd/streams_al.cfg',
229
+        u'config::home  ftp://user:Kaskade7@home.blue.lv/hdd/streams_al.cfg2',
230
+        u'config::home  ftp://home.blue.lv/hdd/streams_al.cfg',
231
+        u'config::home  ',
226 232
         u'config::home  streams_bernu.cfg',
227 233
         u'ltc::home',
228 234
         u'ltc::videonoma',
229 235
         u'ltc::video ',
230
-        u'config::home ',
231 236
         u'config::home streams_bernu.cfg',
232 237
         u'config::home'],
233 238
                          loc('sources/lmt.py'): [u'home',
@@ -262,7 +267,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
262 267
                                {'tree-state': {'file-sort-method': 'by name',
263 268
         'list-files-first': 0,
264 269
         'tree-states': {'deep': {'expanded-nodes': [(2,)],
265
-                                 'selected-nodes': [(17,)],
270
+                                 'selected-nodes': [(18,)],
266 271
                                  'top-node': (0,)}},
267 272
         'tree-style': 'deep'}}),
268 273
                               ('snippets',
@@ -819,7 +824,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
819 824
                                None)],
820 825
                  'primary_view_state': {'area': 'wide',
821 826
         'constraint': None,
822
-        'current_pages': [2,
827
+        'current_pages': [8,
823 828
                           0],
824 829
         'notebook_display': 'normal',
825 830
         'notebook_percent': 0.4761133603238866,
@@ -853,9 +858,9 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
853 858
                                        'fMatchCase': False,
854 859
                                        'fOmitBinary': True,
855 860
                                        'fRegexFlags': 46,
856
-                                       'fReplaceText': u'www.shortcut.lv',
861
+                                       'fReplaceText': u'streams_file',
857 862
                                        'fReverse': False,
858
-                                       'fSearchText': u'img',
863
+                                       'fSearchText': u'stream_file',
859 864
                                        'fStartPos': 0,
860 865
                                        'fStyle': 'text',
861 866
                                        'fWholeWords': False,
@@ -868,7 +873,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
868 873
                                       'fReplaceOnDisk': False,
869 874
                                       'fShowFirstMatch': False,
870 875
                                       'fShowLineno': True,
871
-                                      'fShowReplaceWidgets': False}}),
876
+                                      'fShowReplaceWidgets': True}}),
872 877
                      ('batch-search',
873 878
                       'wide',
874 879
                       0,
@@ -929,9 +934,26 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
929 934
         -1,
930 935
         -1),
931 936
                        'attrib-starts': [],
932
-                       'first-line': 76L,
937
+                       'first-line': 116L,
933 938
                        'folded-linenos': [],
934
-                       'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/sources/filmix.py': ['p'\
939
+                       'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/run.py': ['s'\
940
+        'elf.cfg_file\n',
941
+        'self.cfg_file',
942
+        're.search("ftp*://.+", self.cfg_file)\n',
943
+        're.search("(htt*|ftp*://.*", "http://sfsdfsd")\n',
944
+        're.search("(htt*|ftp*)://.*", "http://sfsdfsd")\n',
945
+        're.search("(http*|ftp*)://.*", "http://sfsdfsd")\n',
946
+        're.search("(http*|ftp*)://.*", "https://sfsdfsd")\n',
947
+        're.search("(https*|ftps*)://.*", "https://sfsdfsd")\n',
948
+        're.search("(https*|ftps*)://.*", "http://sfsdfsd")\n',
949
+        're.search("(https*|ftps*)://.*", "ftp://sfsdfsd")\n',
950
+        're.search("(https*|ftps*)://.*", "ftps://sfsdfsd")\n',
951
+        're.search("(https*|ftps*)://.*", "aaa/sfsdfsd")\n',
952
+        'os.path.join(self.cfg_path, "streams.cfg")\n',
953
+        'self.lists\n',
954
+        'if self.lists: print True\n',
955
+        're.search("(https*|ftps*)://.*", self.stream_file)\n'],
956
+                                   u'file:C:/Data/Programming/enigma2/PlayStream2/content/sources/filmix.py': ['p'\
935 957
         'ath\n',
936 958
         'print translations\n',
937 959
         'print translations[0]\n',
@@ -950,10 +972,10 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
950 972
         's\n',
951 973
         'e\n']},
952 974
                        'launch-id': None,
953
-                       'sel-line': 87L,
954
-                       'sel-line-start': 8336L,
955
-                       'selection_end': 8336L,
956
-                       'selection_start': 8336L,
975
+                       'sel-line': 128L,
976
+                       'sel-line-start': 9757L,
977
+                       'selection_end': 9757L,
978
+                       'selection_start': 9757L,
957 979
                        'zoom': 0L}),
958 980
                      ('debug-watch',
959 981
                       'wide',
@@ -999,283 +1021,299 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
999 1021
                        'selection_end': 174L,
1000 1022
                        'selection_start': 174L,
1001 1023
                        'zoom': 0L})],
1002
-        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('sources/ltc.py'),
1024
+        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('sources/config.py'),
1003 1025
         {'attrib-starts': [('Source',
1004
-                            26),
1026
+                            12),
1005 1027
                            ('Source.get_content',
1006
-                            73)],
1007
-         'first-line': 116L,
1028
+                            28)],
1029
+         'first-line': 21L,
1008 1030
          'folded-linenos': [],
1009
-         'sel-line': 124L,
1010
-         'sel-line-start': 5213L,
1011
-         'selection_end': 5232L,
1012
-         'selection_start': 5232L,
1031
+         'sel-line': 30L,
1032
+         'sel-line-start': 1138L,
1033
+         'selection_end': 1163L,
1034
+         'selection_start': 1151L,
1013 1035
          'zoom': 0L},
1014
-        1520677422.318],
1036
+        1520692463.547],
1015 1037
         [loc('sources/config.py'),
1016 1038
          {'attrib-starts': [('Source',
1017 1039
                              12),
1018
-                            ('Source.get_content',
1019
-                             24)],
1020
-          'first-line': 18L,
1040
+                            ('Source.read_streams',
1041
+                             40)],
1042
+          'first-line': 31L,
1021 1043
           'folded-linenos': [],
1022
-          'sel-line': 26L,
1023
-          'sel-line-start': 938L,
1024
-          'selection_end': 963L,
1025
-          'selection_start': 951L,
1044
+          'sel-line': 40L,
1045
+          'sel-line-start': 1381L,
1046
+          'selection_end': 1401L,
1047
+          'selection_start': 1389L,
1026 1048
           'zoom': 0L},
1027
-         1520677584.944],
1049
+         1520692464.407],
1028 1050
         [loc('sources/config.py'),
1029 1051
          {'attrib-starts': [('Source',
1030 1052
                              12),
1031
-                            ('Source.read_streams',
1032
-                             36)],
1033
-          'first-line': 28L,
1053
+                            ('Source.__init__',
1054
+                             14)],
1055
+          'first-line': 21L,
1034 1056
           'folded-linenos': [],
1035
-          'sel-line': 36L,
1036
-          'sel-line-start': 1181L,
1037
-          'selection_end': 1201L,
1038
-          'selection_start': 1189L,
1057
+          'sel-line': 26L,
1058
+          'sel-line-start': 1030L,
1059
+          'selection_end': 1055L,
1060
+          'selection_start': 1043L,
1039 1061
           'zoom': 0L},
1040
-         1520677589.925],
1062
+         1520692465.724],
1041 1063
         [loc('sources/config.py'),
1042 1064
          {'attrib-starts': [('Source',
1043 1065
                              12),
1044
-                            ('Source.read_streams',
1045
-                             36)],
1046
-          'first-line': 44L,
1066
+                            ('Source.get_content',
1067
+                             28)],
1068
+          'first-line': 21L,
1047 1069
           'folded-linenos': [],
1048
-          'sel-line': 50L,
1049
-          'sel-line-start': 1707L,
1050
-          'selection_end': 1772L,
1051
-          'selection_start': 1723L,
1070
+          'sel-line': 30L,
1071
+          'sel-line-start': 1138L,
1072
+          'selection_end': 1163L,
1073
+          'selection_start': 1151L,
1052 1074
           'zoom': 0L},
1053
-         1520677822.726],
1075
+         1520692470.498],
1054 1076
         [loc('run.py'),
1055
-         {'attrib-starts': [('Main',
1056
-                             22),
1057
-                            ('Main.play_video',
1058
-                             242)],
1059
-          'first-line': 255L,
1077
+         {'attrib-starts': [('VideoInfo',
1078
+                             343),
1079
+                            ('VideoInfo.apply',
1080
+                             526)],
1081
+          'first-line': 523L,
1060 1082
           'folded-linenos': [],
1061
-          'sel-line': 267L,
1062
-          'sel-line-start': 10485L,
1063
-          'selection_end': 10511L,
1064
-          'selection_start': 10511L,
1083
+          'sel-line': 529L,
1084
+          'sel-line-start': 22022L,
1085
+          'selection_end': 22022L,
1086
+          'selection_start': 22022L,
1065 1087
           'zoom': 0L},
1066
-         1520677824.052],
1067
-        [loc('sources/cinemalive.py'),
1088
+         1520692477.372],
1089
+        [loc('sources/config.py'),
1068 1090
          {'attrib-starts': [('Source',
1069
-                             29),
1070
-                            ('Source.get_streams',
1071
-                             166)],
1072
-          'first-line': 176L,
1073
-          'folded-linenos': [],
1074
-          'sel-line': 184L,
1075
-          'sel-line-start': 9047L,
1076
-          'selection_end': 9087L,
1077
-          'selection_start': 9074L,
1091
+                             12),
1092
+                            ('Source.read_streams',
1093
+                             41)],
1094
+          'first-line': 44L,
1095
+          'folded-linenos': [44L,
1096
+                             58L],
1097
+          'sel-line': 53L,
1098
+          'sel-line-start': 2017L,
1099
+          'selection_end': 2030L,
1100
+          'selection_start': 2030L,
1078 1101
           'zoom': 0L},
1079
-         1520679273.911],
1102
+         1520692758.744],
1080 1103
         [loc('run.py'),
1081
-         {'attrib-starts': [('Main',
1082
-                             22),
1083
-                            ('Main.play_video',
1084
-                             242)],
1085
-          'first-line': 255L,
1104
+         {'attrib-starts': [('VideoInfo',
1105
+                             343),
1106
+                            ('VideoInfo.apply',
1107
+                             526)],
1108
+          'first-line': 523L,
1086 1109
           'folded-linenos': [],
1087
-          'sel-line': 267L,
1088
-          'sel-line-start': 10485L,
1089
-          'selection_end': 10511L,
1090
-          'selection_start': 10511L,
1110
+          'sel-line': 529L,
1111
+          'sel-line-start': 22022L,
1112
+          'selection_end': 22022L,
1113
+          'selection_start': 22022L,
1091 1114
           'zoom': 0L},
1092
-         1520679278.088],
1093
-        [loc('kivy_test.py'),
1094
-         {'attrib-starts': [],
1095
-          'first-line': 0L,
1096
-          'folded-linenos': [24L],
1097
-          'sel-line': 0L,
1098
-          'sel-line-start': 0L,
1099
-          'selection_end': 3L,
1100
-          'selection_start': 3L,
1115
+         1520692764.885],
1116
+        [loc('sources/config.py'),
1117
+         {'attrib-starts': [('Source',
1118
+                             12),
1119
+                            ('Source.__init__',
1120
+                             14)],
1121
+          'first-line': 17L,
1122
+          'folded-linenos': [58L],
1123
+          'sel-line': 26L,
1124
+          'sel-line-start': 1044L,
1125
+          'selection_end': 1060L,
1126
+          'selection_start': 1060L,
1101 1127
           'zoom': 0L},
1102
-         1520679279.16],
1128
+         1520692806.414],
1103 1129
         [loc('run.py'),
1104
-         {'attrib-starts': [('Main',
1105
-                             22),
1106
-                            ('Main.play_video',
1107
-                             242)],
1108
-          'first-line': 255L,
1130
+         {'attrib-starts': [('VideoInfo',
1131
+                             343),
1132
+                            ('VideoInfo.apply',
1133
+                             526)],
1134
+          'first-line': 523L,
1109 1135
           'folded-linenos': [],
1110
-          'sel-line': 267L,
1111
-          'sel-line-start': 10485L,
1112
-          'selection_end': 10511L,
1113
-          'selection_start': 10511L,
1136
+          'sel-line': 529L,
1137
+          'sel-line-start': 22022L,
1138
+          'selection_end': 22022L,
1139
+          'selection_start': 22022L,
1114 1140
           'zoom': 0L},
1115
-         1520679328.293],
1116
-        [loc('sources/filmix.py'),
1117
-         {'attrib-starts': [('Source',
1118
-                             31),
1119
-                            ('Source.get_content',
1120
-                             56)],
1121
-          'first-line': 79L,
1122
-          'folded-linenos': [],
1123
-          'sel-line': 89L,
1124
-          'sel-line-start': 3266L,
1125
-          'selection_end': 3324L,
1126
-          'selection_start': 3324L,
1127
-          'zoom': 0L},
1128
-         1520679335.223],
1129
-        [loc('sources/filmix.py'),
1141
+         1520692811.456],
1142
+        [loc('sources/config.py'),
1130 1143
          {'attrib-starts': [('Source',
1131
-                             31)],
1132
-          'first-line': 283L,
1144
+                             12),
1145
+                            ('Source.read_streams',
1146
+                             41)],
1147
+          'first-line': 52L,
1133 1148
           'folded-linenos': [],
1134
-          'sel-line': 292L,
1135
-          'sel-line-start': 12893L,
1136
-          'selection_end': 12893L,
1137
-          'selection_start': 12893L,
1149
+          'sel-line': 60L,
1150
+          'sel-line-start': 2292L,
1151
+          'selection_end': 2292L,
1152
+          'selection_start': 2292L,
1138 1153
           'zoom': 0L},
1139
-         1520682303.573],
1154
+         1520692931.11],
1140 1155
         [loc('run.py'),
1141
-         {'attrib-starts': [('Main',
1142
-                             22),
1143
-                            ('Main.list_action',
1144
-                             106)],
1145
-          'first-line': 105L,
1156
+         {'attrib-starts': [('VideoInfo',
1157
+                             343),
1158
+                            ('VideoInfo.apply',
1159
+                             526)],
1160
+          'first-line': 523L,
1146 1161
           'folded-linenos': [],
1147
-          'sel-line': 110L,
1148
-          'sel-line-start': 4505L,
1149
-          'selection_end': 4505L,
1150
-          'selection_start': 4505L,
1162
+          'sel-line': 529L,
1163
+          'sel-line-start': 22022L,
1164
+          'selection_end': 22022L,
1165
+          'selection_start': 22022L,
1151 1166
           'zoom': 0L},
1152
-         1520682335.838],
1153
-        [loc('sources/filmix.py'),
1167
+         1520692945.834],
1168
+        [loc('sources/config.py'),
1154 1169
          {'attrib-starts': [('Source',
1155
-                             31),
1156
-                            ('Source.get_streams',
1157
-                             264)],
1158
-          'first-line': 306L,
1170
+                             12),
1171
+                            ('Source.__init__',
1172
+                             14)],
1173
+          'first-line': 16L,
1159 1174
           'folded-linenos': [],
1160
-          'sel-line': 316L,
1161
-          'sel-line-start': 13856L,
1162
-          'selection_end': 13882L,
1163
-          'selection_start': 13882L,
1175
+          'sel-line': 21L,
1176
+          'sel-line-start': 763L,
1177
+          'selection_end': 763L,
1178
+          'selection_start': 763L,
1164 1179
           'zoom': 0L},
1165
-         1520683280.721],
1166
-        [loc('sources/filmix.py'),
1180
+         1520693017.716],
1181
+        [loc('sources/config.py'),
1182
+         {'attrib-starts': [],
1183
+          'first-line': 0L,
1184
+          'folded-linenos': [],
1185
+          'sel-line': 0L,
1186
+          'sel-line-start': 0L,
1187
+          'selection_end': 21L,
1188
+          'selection_start': 21L,
1189
+          'zoom': 0L},
1190
+         1520693172.463],
1191
+        [loc('sources/config.py'),
1167 1192
          {'attrib-starts': [('Source',
1168
-                             31),
1169
-                            ('Source.get_streams',
1170
-                             262)],
1171
-          'first-line': 318L,
1193
+                             12),
1194
+                            ('Source.__init__',
1195
+                             14)],
1196
+          'first-line': 18L,
1172 1197
           'folded-linenos': [],
1173
-          'sel-line': 327L,
1174
-          'sel-line-start': 14325L,
1175
-          'selection_end': 14325L,
1176
-          'selection_start': 14325L,
1198
+          'sel-line': 27L,
1199
+          'sel-line-start': 1070L,
1200
+          'selection_end': 1095L,
1201
+          'selection_start': 1083L,
1177 1202
           'zoom': 0L},
1178
-         1520685621.8],
1179
-        [loc('run.py'),
1180
-         {'attrib-starts': [('Main',
1181
-                             22),
1182
-                            ('Main.play_video',
1183
-                             242)],
1184
-          'first-line': 247L,
1203
+         1520693173.999],
1204
+        [loc('sources/config.py'),
1205
+         {'attrib-starts': [('Source',
1206
+                             12),
1207
+                            ('Source.get_content',
1208
+                             29)],
1209
+          'first-line': 24L,
1185 1210
           'folded-linenos': [],
1186
-          'sel-line': 256L,
1187
-          'sel-line-start': 10058L,
1188
-          'selection_end': 10058L,
1189
-          'selection_start': 10058L,
1211
+          'sel-line': 31L,
1212
+          'sel-line-start': 1178L,
1213
+          'selection_end': 1203L,
1214
+          'selection_start': 1191L,
1190 1215
           'zoom': 0L},
1191
-         1520685647.025],
1192
-        [loc('sources/filmix.py'),
1193
-         {'attrib-starts': [],
1194
-          'first-line': 431L,
1216
+         1520693174.976],
1217
+        [loc('sources/config.py'),
1218
+         {'attrib-starts': [('Source',
1219
+                             12),
1220
+                            ('Source.read_streams',
1221
+                             41)],
1222
+          'first-line': 32L,
1195 1223
           'folded-linenos': [],
1196
-          'sel-line': 440L,
1197
-          'sel-line-start': 19309L,
1198
-          'selection_end': 19309L,
1199
-          'selection_start': 19309L,
1224
+          'sel-line': 41L,
1225
+          'sel-line-start': 1421L,
1226
+          'selection_end': 1441L,
1227
+          'selection_start': 1429L,
1200 1228
           'zoom': 0L},
1201
-         1520685650.21],
1202
-        [loc('run.py'),
1203
-         {'attrib-starts': [('Main',
1204
-                             22),
1205
-                            ('Main.play_video',
1206
-                             242)],
1207
-          'first-line': 247L,
1229
+         1520693175.767],
1230
+        [loc('sources/config.py'),
1231
+         {'attrib-starts': [('Source',
1232
+                             12),
1233
+                            ('Source.__init__',
1234
+                             14)],
1235
+          'first-line': 14L,
1208 1236
           'folded-linenos': [],
1209
-          'sel-line': 256L,
1210
-          'sel-line-start': 10058L,
1211
-          'selection_end': 10058L,
1212
-          'selection_start': 10058L,
1237
+          'sel-line': 22L,
1238
+          'sel-line-start': 876L,
1239
+          'selection_end': 904L,
1240
+          'selection_start': 893L,
1213 1241
           'zoom': 0L},
1214
-         1520685674.597],
1215
-        [loc('sources/filmix.py'),
1242
+         1520693189.768],
1243
+        [loc('sources/config.py'),
1216 1244
          {'attrib-starts': [('Source',
1217
-                             31),
1218
-                            ('Source.get_streams',
1219
-                             262)],
1220
-          'first-line': 285L,
1245
+                             12),
1246
+                            ('Source.read_streams',
1247
+                             41)],
1248
+          'first-line': 33L,
1221 1249
           'folded-linenos': [],
1222
-          'sel-line': 290L,
1223
-          'sel-line-start': 12861L,
1224
-          'selection_end': 12861L,
1225
-          'selection_start': 12861L,
1250
+          'sel-line': 42L,
1251
+          'sel-line-start': 1452L,
1252
+          'selection_end': 1476L,
1253
+          'selection_start': 1476L,
1226 1254
           'zoom': 0L},
1227
-         1520686791.424],
1255
+         1520693202.442],
1228 1256
         [loc('run.py'),
1229
-         {'attrib-starts': [('Main',
1230
-                             22),
1231
-                            ('Main.initUI',
1232
-                             47)],
1233
-          'first-line': 90L,
1257
+         {'attrib-starts': [('VideoInfo',
1258
+                             343),
1259
+                            ('VideoInfo.apply',
1260
+                             526)],
1261
+          'first-line': 517L,
1234 1262
           'folded-linenos': [],
1235
-          'sel-line': 96L,
1236
-          'sel-line-start': 3996L,
1237
-          'selection_end': 3996L,
1238
-          'selection_start': 3996L,
1263
+          'sel-line': 529L,
1264
+          'sel-line-start': 22022L,
1265
+          'selection_end': 22022L,
1266
+          'selection_start': 22022L,
1239 1267
           'zoom': 0L},
1240
-         1520686861.295],
1241
-        [loc('sources/filmix.py'),
1268
+         1520693245.985],
1269
+        [loc('sources/config.py'),
1242 1270
          {'attrib-starts': [('Source',
1243
-                             31),
1244
-                            ('Source.get_streams',
1245
-                             262)],
1246
-          'first-line': 285L,
1271
+                             12),
1272
+                            ('Source.read_streams',
1273
+                             41)],
1274
+          'first-line': 39L,
1247 1275
           'folded-linenos': [],
1248
-          'sel-line': 290L,
1249
-          'sel-line-start': 12861L,
1250
-          'selection_end': 12861L,
1251
-          'selection_start': 12861L,
1276
+          'sel-line': 42L,
1277
+          'sel-line-start': 1452L,
1278
+          'selection_end': 1476L,
1279
+          'selection_start': 1476L,
1252 1280
           'zoom': 0L},
1253
-         1520686867.682]],
1281
+         1520693266.767]],
1254 1282
         20),
1255
-        'current-loc': loc('sources/filmix.py'),
1283
+        'current-loc': loc('run.py'),
1256 1284
         'editor-state-list': [(loc('run.py'),
1257
-                               {'attrib-starts': [('Main',
1258
-        22),
1259
-        ('Main.initUI',
1260
-         47)],
1261
-                                'first-line': 90L,
1285
+                               {'attrib-starts': [('VideoInfo',
1286
+        343),
1287
+        ('VideoInfo.apply',
1288
+         526)],
1289
+                                'first-line': 517L,
1290
+                                'folded-linenos': [],
1291
+                                'sel-line': 528L,
1292
+                                'sel-line-start': 22020L,
1293
+                                'selection_end': 22020L,
1294
+                                'selection_start': 22020L,
1295
+                                'zoom': 0L}),
1296
+                              (loc('util.py'),
1297
+                               {'attrib-starts': [('unescape',
1298
+        538)],
1299
+                                'first-line': 537L,
1262 1300
                                 'folded-linenos': [],
1263
-                                'sel-line': 96L,
1264
-                                'sel-line-start': 3996L,
1265
-                                'selection_end': 3996L,
1266
-                                'selection_start': 3996L,
1301
+                                'sel-line': 540L,
1302
+                                'sel-line-start': 16550L,
1303
+                                'selection_end': 16598L,
1304
+                                'selection_start': 16598L,
1267 1305
                                 'zoom': 0L}),
1268 1306
                               (loc('ContentSources.py'),
1269 1307
                                {'attrib-starts': [('ContentSources',
1270 1308
         16),
1271
-        ('ContentSources.get_content',
1272
-         64)],
1273
-                                'first-line': 77L,
1309
+        ('ContentSources.__init__',
1310
+         20)],
1311
+                                'first-line': 33L,
1274 1312
                                 'folded-linenos': [],
1275
-                                'sel-line': 80L,
1276
-                                'sel-line-start': 3634L,
1277
-                                'selection_end': 3662L,
1278
-                                'selection_start': 3662L,
1313
+                                'sel-line': 37L,
1314
+                                'sel-line-start': 1506L,
1315
+                                'selection_end': 1538L,
1316
+                                'selection_start': 1538L,
1279 1317
                                 'zoom': 0L}),
1280 1318
                               (loc('sources/ltc.py'),
1281 1319
                                {'attrib-starts': [('Source',
@@ -1289,16 +1327,6 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1289 1327
                                 'selection_end': 5232L,
1290 1328
                                 'selection_start': 5232L,
1291 1329
                                 'zoom': 0L}),
1292
-                              (loc('util.py'),
1293
-                               {'attrib-starts': [('unescape',
1294
-        538)],
1295
-                                'first-line': 537L,
1296
-                                'folded-linenos': [],
1297
-                                'sel-line': 540L,
1298
-                                'sel-line-start': 16550L,
1299
-                                'selection_end': 16598L,
1300
-                                'selection_start': 16598L,
1301
-                                'zoom': 0L}),
1302 1330
                               (loc('sources/replay.py'),
1303 1331
                                {'attrib-starts': [('Source',
1304 1332
         30),
@@ -1335,14 +1363,14 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1335 1363
                               (loc('sources/filmix.py'),
1336 1364
                                {'attrib-starts': [('Source',
1337 1365
         31),
1338
-        ('Source.get_content',
1339
-         56)],
1340
-                                'first-line': 144L,
1366
+        ('Source.get_streams',
1367
+         263)],
1368
+                                'first-line': 256L,
1341 1369
                                 'folded-linenos': [],
1342
-                                'sel-line': 146L,
1343
-                                'sel-line-start': 5981L,
1344
-                                'selection_end': 6012L,
1345
-                                'selection_start': 6012L,
1370
+                                'sel-line': 264L,
1371
+                                'sel-line-start': 11576L,
1372
+                                'selection_end': 11619L,
1373
+                                'selection_start': 11619L,
1346 1374
                                 'zoom': 0L}),
1347 1375
                               (loc('Downloader.py'),
1348 1376
                                {'attrib-starts': [('get_header',
@@ -1386,20 +1414,20 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1386 1414
                                {'attrib-starts': [('Source',
1387 1415
         12),
1388 1416
         ('Source.read_streams',
1389
-         36)],
1390
-                                'first-line': 44L,
1417
+         41)],
1418
+                                'first-line': 39L,
1391 1419
                                 'folded-linenos': [],
1392
-                                'sel-line': 50L,
1393
-                                'sel-line-start': 1707L,
1394
-                                'selection_end': 1772L,
1395
-                                'selection_start': 1723L,
1420
+                                'sel-line': 42L,
1421
+                                'sel-line-start': 1452L,
1422
+                                'selection_end': 1476L,
1423
+                                'selection_start': 1476L,
1396 1424
                                 'zoom': 0L})],
1397 1425
         'has-focus': True,
1398 1426
         'locked': False},
1399 1427
         [loc('run.py'),
1428
+         loc('util.py'),
1400 1429
          loc('ContentSources.py'),
1401 1430
          loc('sources/ltc.py'),
1402
-         loc('util.py'),
1403 1431
          loc('sources/replay.py'),
1404 1432
          loc('sources/lmt.py'),
1405 1433
          loc('sources/filmas.py'),
@@ -1409,19 +1437,19 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1409 1437
          loc('resolver.py'),
1410 1438
          loc('resolvers/cloudsany.py'),
1411 1439
          loc('sources/config.py')]),
1412
-                               'open_files': [u'ContentSources.py',
1413
-        u'Downloader.py',
1440
+                               'open_files': [u'Downloader.py',
1414 1441
         u'resolver.py',
1415 1442
         u'resolvers/cloudsany.py',
1416 1443
         u'sources/euronews.py',
1417 1444
         u'sources/filmas.py',
1418 1445
         u'sources/lmt.py',
1419 1446
         u'sources/replay.py',
1420
-        u'util.py',
1421 1447
         u'sources/ltc.py',
1448
+        u'sources/filmix.py',
1449
+        u'util.py',
1450
+        u'ContentSources.py',
1422 1451
         u'sources/config.py',
1423
-        u'run.py',
1424
-        u'sources/filmix.py']},
1452
+        u'run.py']},
1425 1453
         'saved_notebook_display': None,
1426 1454
         'split_percents': {0: 0.42670046472327844},
1427 1455
         'splits': 2,
@@ -1436,13 +1464,13 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1436 1464
                          -1080,
1437 1465
                          1858,
1438 1466
                          1080)}]}
1439
-guimgr.recent-documents = [loc('sources/filmix.py'),
1440
-                           loc('run.py'),
1467
+guimgr.recent-documents = [loc('run.py'),
1441 1468
                            loc('sources/config.py'),
1442
-                           loc('sources/ltc.py'),
1469
+                           loc('ContentSources.py'),
1443 1470
                            loc('util.py'),
1471
+                           loc('sources/filmix.py'),
1472
+                           loc('sources/ltc.py'),
1444 1473
                            loc('sources/replay.py'),
1445
-                           loc('ContentSources.py'),
1446 1474
                            loc('resolvers/cloudsany.py'),
1447 1475
                            loc('sources/euronews.py'),
1448 1476
                            loc('resolver.py'),
@@ -1969,7 +1997,12 @@ proj.env-vars = {None: ('default',
1969 1997
                         [u''])}
1970 1998
 search.replace-history = [u'www.shortcut.lv',
1971 1999
                           u'shortcut.lv']
1972
-search.search-history = [u'img',
2000
+search.search-history = [u'read_streams',
2001
+                         u'read_stream',
2002
+                         u'confif_file',
2003
+                         u'confif_f',
2004
+                         u'streams_file',
2005
+                         u'img',
1973 2006
                          u'desc',
1974 2007
                          u'unqute',
1975 2008
                          u'raise',
@@ -1983,12 +2016,7 @@ search.search-history = [u'img',
1983 2016
                          u'http:',
1984 2017
                          u'www.lattelecom.tv',
1985 2018
                          u'http://www',
1986
-                         u'lattelecom.tv',
1987
-                         u'crypt',
1988
-                         u'host',
1989
-                         u'url_stream',
1990
-                         u'url_sub',
1991
-                         u'.pack']
2019
+                         u'lattelecom.tv']
1992 2020
 testing.stored-results = (1,
1993 2021
                           [],
1994 2022
                           {})

+ 41
- 13
sources/config.py View File

@@ -17,7 +17,12 @@ class Source(SourceBase):
17 17
         self.country=country
18 18
         cur_directory = os.path.dirname(os.path.abspath(__file__))
19 19
         if not cfg_path: cfg_path = cur_directory
20
-        self.streams_file = os.path.join(cfg_path,cfg_file)
20
+        self.cfg_path = cfg_path
21
+        self.cfg_file = cfg_file
22
+        if not ("/" in cfg_file or "\\" in cfg_file):  # ja tikai faila nosaukums, tad meklē to source folderi
23
+            self.streams_file = os.path.join(cfg_path,cfg_file)
24
+        else:
25
+            self.streams_file = cfg_file
21 26
         self.lists = collections.OrderedDict()
22 27
         self.titles = {}
23 28
         self.read_streams()
@@ -35,7 +40,21 @@ class Source(SourceBase):
35 40
         return False
36 41
 
37 42
     def read_streams(self):
38
-        for line in open(self.streams_file,"r"):
43
+        if re.search("(https*|ftps*)://.*", self.streams_file):
44
+            import urllib2
45
+            try:
46
+                sf = urllib2.urlopen(self.streams_file, "r")
47
+            except Exception as e:
48
+                #raise Exception("Can not open streams file %s" % self.cfg_file)
49
+                print "Warning: can not open streams file %s, callback to default" % self.streams_file
50
+                self.streams_file = os.path.join(self.cfg_path, "streams.cfg")
51
+                sf = open(self.streams_file, "r")
52
+        else:
53
+            try:
54
+                sf = open(self.streams_file, "r")
55
+            except Exception as e:
56
+                raise Exception("Can not open streams file %s" % self.streams_file)
57
+        for line in sf:
39 58
             r = re.search("^\[(\w+)\]", line)
40 59
             if r:
41 60
                 name = r.group(1)
@@ -50,18 +69,27 @@ class Source(SourceBase):
50 69
                     if len(items) == 4:
51 70
                         items[3] = items[3].replace("\\n","\n")
52 71
                     self.lists[name].append(items)
53
-
72
+        sf.close()
54 73
     def write_streams(self):
55
-        f = open(self.streams_file,"w")
56
-        for l in self.lists.keys():
57
-            f.write("[%s]\n"%l)
58
-            t = self.get_title(l)
59
-            if t<>l:
60
-                f.write("%s\n"%t)
61
-            for item in self.lists[l]:
62
-                f.write("%s|%s|%s|%s\n"%(item[0].replace("\n",""),item[1],item[2],item[3].replace("\n","\\n")))
63
-            f.write("\n")
64
-        f.close()
74
+
75
+        if re.search("(https*|ftps*)://.*", self.streams_file):
76
+            # TODO
77
+            pass
78
+
79
+        else:  # Paraksts fails
80
+            try:
81
+                f = open(self.streams_file, "w")
82
+            except Exception as e:
83
+                raise Exception("Can not open streams file %s" % self.streams_file)
84
+            for l in self.lists.keys():
85
+                f.write("[%s]\n"%l)
86
+                t = self.get_title(l)
87
+                if t<>l:
88
+                    f.write("%s\n"%t)
89
+                for item in self.lists[l]:
90
+                    f.write("%s|%s|%s|%s\n"%(item[0].replace("\n",""),item[1],item[2],item[3].replace("\n","\\n")))
91
+                f.write("\n")
92
+            f.close()
65 93
 
66 94
     def get_lists(self):
67 95
         return self.lists.keys()