Browse Source

enigma2 source

Ivars 6 years ago
parent
commit
ac00358b0a
3 changed files with 449 additions and 266 deletions
  1. BIN
      picons/enigma2.png
  2. 298
    266
      project.wpr
  3. 151
    0
      sources/enigma2.py

BIN
picons/enigma2.png View File


+ 298
- 266
project.wpr View File

@@ -127,6 +127,10 @@ debug.breakpoints = {loc('Downloader.py'): {94: (0,
127 127
                None,
128 128
                1,
129 129
                0)},
130
+                     loc('sources/enigma2.py'): {58L: (0,
131
+        None,
132
+        1,
133
+        0)},
130 134
                      loc('sources/euronews.py'): {161L: (0,
131 135
         None,
132 136
         1,
@@ -154,7 +158,11 @@ debug.breakpoints = {loc('Downloader.py'): {94: (0,
154 158
         957L: (0,
155 159
                None,
156 160
                1,
157
-               0)},
161
+               0),
162
+        1212L: (0,
163
+                None,
164
+                1,
165
+                0)},
158 166
                      loc('sources/replay.py'): {13L: (0,
159 167
         None,
160 168
         1,
@@ -191,11 +199,11 @@ debug.breakpoints = {loc('Downloader.py'): {94: (0,
191 199
             None,
192 200
             1,
193 201
             0)},
194
-                     loc('unknown:<untitled> #2'): {10: (0,
202
+                     loc('unknown:<untitled> #1'): {10: (0,
195 203
         None,
196 204
         1,
197 205
         0)},
198
-                     loc('unknown:<untitled> #1'): {2: (0,
206
+                     loc('unknown:<untitled> #2'): {2: (0,
199 207
         None,
200 208
         1,
201 209
         0)}}
@@ -208,6 +216,7 @@ debug.err-values = {None: {},
208 216
                     loc('kivy_test2.py'): {},
209 217
                     loc('run.py'): {},
210 218
                     loc('sources/cinemalive.py'): {},
219
+                    loc('sources/enigma2.py'): {},
211 220
                     loc('sources/euronews.py'): {},
212 221
                     loc('sources/filmix.py'): {},
213 222
                     loc('sources/ltc.py'): {},
@@ -296,10 +305,10 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
296 305
         'type': 'dock',
297 306
         'view': {'area': 'tall',
298 307
                  'constraint': None,
299
-                 'current_pages': [2,
300
-                                   2],
308
+                 'current_pages': [0,
309
+                                   0],
301 310
                  'full-screen': False,
302
-                 'notebook_display': 'tabs only',
311
+                 'notebook_display': 'normal',
303 312
                  'notebook_percent': 0.17992831541218635,
304 313
                  'override_title': None,
305 314
                  'pagelist': [('project',
@@ -307,9 +316,10 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
307 316
                                0,
308 317
                                {'tree-state': {'file-sort-method': 'by name',
309 318
         'list-files-first': 0,
310
-        'tree-states': {'deep': {'expanded-nodes': [(6,)],
311
-                                 'selected-nodes': [(6,
312
-        15)],
319
+        'tree-states': {'deep': {'expanded-nodes': [(2,),
320
+        (6,)],
321
+                                 'selected-nodes': [(2,
322
+        3)],
313 323
                                  'top-node': (0,)}},
314 324
         'tree-style': 'deep'}}),
315 325
                               ('snippets',
@@ -459,6 +469,12 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
459 469
         'top-node': [('generic attribute',
460 470
                       loc('../../../Python27/Lib/site-packages/win32com/client/dynamic.py'),
461 471
                       'ALL_INVOKE_TYPES')]},
472
+        loc('../../SplashData/remdup.py'): {'column-widths': [1.0],
473
+        'expanded-nodes': [],
474
+        'selected-nodes': [],
475
+        'top-node': [('generic attribute',
476
+                      loc('../../SplashData/remdup.py'),
477
+                      'f')]},
462 478
         loc('../$test/test2.py'): {'column-widths': [1.0],
463 479
                                    'expanded-nodes': [],
464 480
                                    'selected-nodes': [],
@@ -650,9 +666,9 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
650 666
         loc('record.py'),
651 667
         'r1')]},
652 668
         loc('run.py'): {'expanded-nodes': [],
653
-                        'selected-nodes': [[('class def',
669
+                        'selected-nodes': [[('generic attribute',
654 670
         loc('run.py'),
655
-        'ChoiceBox')]],
671
+        'sources')]],
656 672
                         'top-node': [('generic attribute',
657 673
                                       loc('run.py'),
658 674
                                       'cfg_file')]},
@@ -661,6 +677,13 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
661 677
                                        'top-node': [('generic attribute',
662 678
         loc('sources/SourceBase.py'),
663 679
         'headers2dict')]},
680
+        loc('sources/enigma2.py'): {'expanded-nodes': [],
681
+                                    'selected-nodes': [[('generic attribute',
682
+        loc('sources/enigma2.py'),
683
+        'data')]],
684
+                                    'top-node': [('generic attribute',
685
+        loc('sources/enigma2.py'),
686
+        'data')]},
664 687
         loc('sources/euronews.py'): {'expanded-nodes': [],
665 688
                                      'selected-nodes': [],
666 689
                                      'top-node': [('generic attribute',
@@ -699,7 +722,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
699 722
         'vid2')]],
700 723
                                 'top-node': [('generic attribute',
701 724
         loc('sources/ltc.py'),
702
-        'API_URL')]},
725
+        'cmd')]},
703 726
         loc('sources/replay.py'): {'expanded-nodes': [],
704 727
                                    'selected-nodes': [[('class def',
705 728
         loc('sources/replay.py'),
@@ -792,12 +815,6 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
792 815
                                       'top-node': [('generic attribute',
793 816
         loc('../vietas/vietas2.py'),
794 817
         'd_lat')]},
795
-        loc('../../SplashData/remdup.py'): {'column-widths': [1.0],
796
-        'expanded-nodes': [],
797
-        'selected-nodes': [],
798
-        'top-node': [('generic attribute',
799
-                      loc('../../SplashData/remdup.py'),
800
-                      'f')]},
801 818
         loc('../../../../../Python27/lib/lib-tk/Tkinter.py'): {'expanded-nod'\
802 819
         'es': [],
803 820
         'selected-nodes': [],
@@ -833,18 +850,24 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
833 850
         'top-node': [('generic attribute',
834 851
                       loc('../../../../../Python27/lib/site-packages/PIL/Image.py'),
835 852
                       'ADAPTIVE')]},
836
-        loc('unknown:<untitled> #3'): {'column-widths': [1.0],
837
-                                       'expanded-nodes': [],
853
+        loc('../../../../../../../Python27/lib/lib-tk/Tkinter.py'): {'expand'\
854
+        'ed-nodes': [],
855
+        'selected-nodes': [],
856
+        'top-node': [('function def',
857
+                      loc('../../../../../../../Python27/lib/lib-tk/Tkinter.py'),
858
+                      'At')]},
859
+        loc('unknown:<untitled> #5'): {'expanded-nodes': [],
838 860
                                        'selected-nodes': [],
839 861
                                        'top-node': None},
840
-        loc('unknown:<untitled> #4'): {'expanded-nodes': [],
862
+        loc('unknown:<untitled> #6'): {'expanded-nodes': [],
841 863
                                        'selected-nodes': [],
842 864
                                        'top-node': None},
843
-        loc('unknown:<untitled> #5'): {'column-widths': [1.0],
865
+        loc('unknown:<untitled> #3'): {'column-widths': [1.0],
844 866
                                        'expanded-nodes': [],
845 867
                                        'selected-nodes': [],
846 868
                                        'top-node': None},
847
-        loc('unknown:<untitled> #6'): {'expanded-nodes': [],
869
+        loc('unknown:<untitled> #4'): {'column-widths': [1.0],
870
+                                       'expanded-nodes': [],
848 871
                                        'selected-nodes': [],
849 872
                                        'top-node': None}},
850 873
                                 'browse_mode': u'Current Module',
@@ -874,7 +897,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
874 897
         'current_pages': [2,
875 898
                           0],
876 899
         'notebook_display': 'normal',
877
-        'notebook_percent': 0.33947157726180943,
900
+        'notebook_percent': 0.25157728706624605,
878 901
         'override_title': None,
879 902
         'pagelist': [('debug-breakpoints',
880 903
                       'wide',
@@ -933,7 +956,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
933 956
                                        'fInterpretBackslashes': False,
934 957
                                        'fMatchCase': False,
935 958
                                        'fOmitBinary': True,
936
-                                       'fRegexFlags': 46,
959
+                                       'fRegexFlags': 42,
937 960
                                        'fReplaceText': u'',
938 961
                                        'fReverse': False,
939 962
                                        'fSearchText': u'command',
@@ -981,24 +1004,14 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
981 1004
         -1,
982 1005
         -1),
983 1006
                        'attrib-starts': [],
984
-                       'first-line': 20L,
1007
+                       'first-line': 0L,
985 1008
                        'folded-linenos': [],
986
-                       'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/sources/tvplay.py': ['z'\
987
-        'ip(*self.kategorijas)[0]\n',
988
-        'k\n',
989
-        'k[0]\n',
990
-        'qs\n',
991
-        'len(r["content"])\n',
992
-        'item["metadata"]["airDate"]\n',
993
-        'item["metadata"]["airDate"].split["T"][0]\n',
994
-        'item["metadata"]["airDate"].split("T")[0]\n',
995
-        'dd =  item["metadata"]["airDate"].split("T")[0].split("-")\n',
996
-        'dd\n']},
1009
+                       'history': {},
997 1010
                        'launch-id': None,
998
-                       'sel-line': 26L,
999
-                       'sel-line-start': 670L,
1000
-                       'selection_end': 670L,
1001
-                       'selection_start': 670L,
1011
+                       'sel-line': 0L,
1012
+                       'sel-line-start': 0L,
1013
+                       'selection_end': 0L,
1014
+                       'selection_start': 0L,
1002 1015
                        'zoom': 0L}),
1003 1016
                      ('debug-watch',
1004 1017
                       'wide',
@@ -1012,9 +1025,11 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1012 1025
                                        ('eval',
1013 1026
         u'item'),
1014 1027
                                        ('eval',
1015
-        u'url')],
1016
-                       'tree-state': {'expanded-nodes': [],
1017
-                                      'selected-nodes': [(0,)],
1028
+        u'url'),
1029
+                                       ('eval',
1030
+        u'qs')],
1031
+                       'tree-state': {'expanded-nodes': [(5,)],
1032
+                                      'selected-nodes': [(1,)],
1018 1033
                                       'top-node': (0,)}}),
1019 1034
                      ('messages',
1020 1035
                       'wide',
@@ -1039,290 +1054,271 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1039 1054
                        'attrib-starts': [],
1040 1055
                        'first-line': 0L,
1041 1056
                        'folded-linenos': [],
1042
-                       'history': {None: ['a = [("a", 1), ("b", 2)]\n',
1043
-        'a\n',
1044
-        'zip(a)\n',
1045
-        'zip(*a)\n',
1046
-        'zip(*a)[0]\n']},
1057
+                       'history': {},
1047 1058
                        'launch-id': None,
1048
-                       'sel-line': 11L,
1049
-                       'sel-line-start': 312L,
1050
-                       'selection_end': 312L,
1051
-                       'selection_start': 312L,
1059
+                       'sel-line': 2L,
1060
+                       'sel-line-start': 174L,
1061
+                       'selection_end': 174L,
1062
+                       'selection_start': 174L,
1052 1063
                        'zoom': 0L})],
1053
-        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('sources/tvplay.py'),
1054
-        {'attrib-starts': [('Source',
1055
-                            32),
1056
-                           ('Source.get_content',
1057
-                            52)],
1058
-         'first-line': 106L,
1064
+        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('run.py'),
1065
+        {'attrib-starts': [],
1066
+         'first-line': 717L,
1059 1067
          'folded-linenos': [],
1060
-         'sel-line': 113L,
1061
-         'sel-line-start': 5583L,
1062
-         'selection_end': 5583L,
1063
-         'selection_start': 5583L,
1068
+         'sel-line': 733L,
1069
+         'sel-line-start': 29517L,
1070
+         'selection_end': 29528L,
1071
+         'selection_start': 29521L,
1064 1072
          'zoom': 0L},
1065
-        1534770326.346],
1066
-        [loc('sources/tvplay.py'),
1073
+        1536008661.996],
1074
+        [loc('sources/enigma2.py'),
1067 1075
          {'attrib-starts': [('Source',
1068
-                             32),
1076
+                             31),
1069 1077
                             ('Source.get_content',
1070
-                             52)],
1071
-          'first-line': 90L,
1072
-          'folded-linenos': [120L],
1073
-          'sel-line': 100L,
1074
-          'sel-line-start': 4759L,
1075
-          'selection_end': 4808L,
1076
-          'selection_start': 4808L,
1078
+                             56)],
1079
+          'first-line': 45L,
1080
+          'folded-linenos': [],
1081
+          'sel-line': 58L,
1082
+          'sel-line-start': 2053L,
1083
+          'selection_end': 2112L,
1084
+          'selection_start': 2112L,
1077 1085
           'zoom': 0L},
1078
-         1534771988.638],
1079
-        [loc('sources/tvplay.py'),
1086
+         1536008669.221],
1087
+        [loc('sources/enigma2.py'),
1080 1088
          {'attrib-starts': [('Source',
1081
-                             32),
1089
+                             31),
1082 1090
                             ('Source.get_content',
1083
-                             52)],
1084
-          'first-line': 109L,
1085
-          'folded-linenos': [120L],
1086
-          'sel-line': 131L,
1087
-          'sel-line-start': 6361L,
1088
-          'selection_end': 6383L,
1089
-          'selection_start': 6383L,
1091
+                             56)],
1092
+          'first-line': 49L,
1093
+          'folded-linenos': [],
1094
+          'sel-line': 58L,
1095
+          'sel-line-start': 2053L,
1096
+          'selection_end': 2053L,
1097
+          'selection_start': 2053L,
1090 1098
           'zoom': 0L},
1091
-         1534772103.433],
1092
-        [loc('sources/tvplay.py'),
1099
+         1536008716.399],
1100
+        [loc('sources/enigma2.py'),
1093 1101
          {'attrib-starts': [('Source',
1094
-                             32),
1102
+                             31),
1095 1103
                             ('Source.get_content',
1096
-                             52)],
1097
-          'first-line': 57L,
1104
+                             56)],
1105
+          'first-line': 45L,
1098 1106
           'folded-linenos': [],
1099
-          'sel-line': 63L,
1100
-          'sel-line-start': 2330L,
1101
-          'selection_end': 2352L,
1102
-          'selection_start': 2352L,
1107
+          'sel-line': 58L,
1108
+          'sel-line-start': 2053L,
1109
+          'selection_end': 2112L,
1110
+          'selection_start': 2112L,
1103 1111
           'zoom': 0L},
1104
-         1534774794.02],
1105
-        [loc('sources/tvplay.py'),
1112
+         1536008720.74],
1113
+        [loc('sources/enigma2.py'),
1106 1114
          {'attrib-starts': [('Source',
1107
-                             32),
1115
+                             31),
1108 1116
                             ('Source.get_content',
1109
-                             62)],
1110
-          'first-line': 107L,
1117
+                             56)],
1118
+          'first-line': 67L,
1111 1119
           'folded-linenos': [],
1112
-          'sel-line': 112L,
1113
-          'sel-line-start': 5016L,
1114
-          'selection_end': 5016L,
1115
-          'selection_start': 5016L,
1120
+          'sel-line': 78L,
1121
+          'sel-line-start': 3027L,
1122
+          'selection_end': 3057L,
1123
+          'selection_start': 3057L,
1116 1124
           'zoom': 0L},
1117
-         1534866469.787],
1118
-        [loc('sources/tvplay.py'),
1125
+         1536008761.146],
1126
+        [loc('sources/enigma2.py'),
1119 1127
          {'attrib-starts': [('Source',
1120
-                             32),
1128
+                             31),
1121 1129
                             ('Source.get_content',
1122
-                             62)],
1123
-          'first-line': 153L,
1130
+                             56)],
1131
+          'first-line': 45L,
1124 1132
           'folded-linenos': [],
1125
-          'sel-line': 161L,
1126
-          'sel-line-start': 7444L,
1127
-          'selection_end': 7500L,
1128
-          'selection_start': 7471L,
1133
+          'sel-line': 58L,
1134
+          'sel-line-start': 2053L,
1135
+          'selection_end': 2112L,
1136
+          'selection_start': 2112L,
1129 1137
           'zoom': 0L},
1130
-         1534866470.415],
1131
-        [loc('sources/tvplay.py'),
1138
+         1536008767.148],
1139
+        [loc('sources/enigma2.py'),
1132 1140
          {'attrib-starts': [('Source',
1133
-                             32),
1141
+                             31),
1134 1142
                             ('Source.get_content',
1135
-                             62)],
1136
-          'first-line': 153L,
1143
+                             56)],
1144
+          'first-line': 64L,
1137 1145
           'folded-linenos': [],
1138
-          'sel-line': 161L,
1139
-          'sel-line-start': 7444L,
1140
-          'selection_end': 7499L,
1141
-          'selection_start': 7471L,
1146
+          'sel-line': 76L,
1147
+          'sel-line-start': 2893L,
1148
+          'selection_end': 2928L,
1149
+          'selection_start': 2928L,
1142 1150
           'zoom': 0L},
1143
-         1534866471.652],
1144
-        [loc('sources/tvplay.py'),
1151
+         1536008871.686],
1152
+        [loc('sources/enigma2.py'),
1145 1153
          {'attrib-starts': [('Source',
1146
-                             32),
1154
+                             31),
1147 1155
                             ('Source.get_content',
1148
-                             62)],
1149
-          'first-line': 126L,
1156
+                             56)],
1157
+          'first-line': 54L,
1150 1158
           'folded-linenos': [],
1151
-          'sel-line': 161L,
1152
-          'sel-line-start': 7444L,
1153
-          'selection_end': 7521L,
1154
-          'selection_start': 7521L,
1159
+          'sel-line': 58L,
1160
+          'sel-line-start': 2053L,
1161
+          'selection_end': 2112L,
1162
+          'selection_start': 2112L,
1155 1163
           'zoom': 0L},
1156
-         1534866508.975],
1157
-        [loc('sources/tvplay.py'),
1164
+         1536008887.193],
1165
+        [loc('sources/enigma2.py'),
1158 1166
          {'attrib-starts': [('Source',
1159
-                             32),
1167
+                             31),
1160 1168
                             ('Source.get_content',
1161
-                             62)],
1162
-          'first-line': 175L,
1169
+                             56)],
1170
+          'first-line': 64L,
1163 1171
           'folded-linenos': [],
1164
-          'sel-line': 185L,
1165
-          'sel-line-start': 8867L,
1166
-          'selection_end': 8899L,
1167
-          'selection_start': 8894L,
1172
+          'sel-line': 76L,
1173
+          'sel-line-start': 2893L,
1174
+          'selection_end': 2928L,
1175
+          'selection_start': 2928L,
1168 1176
           'zoom': 0L},
1169
-         1534866510.627],
1170
-        [loc('sources/tvplay.py'),
1177
+         1536008887.741],
1178
+        [loc('sources/enigma2.py'),
1171 1179
          {'attrib-starts': [('Source',
1172
-                             32),
1180
+                             31),
1173 1181
                             ('Source.get_content',
1174
-                             62)],
1175
-          'first-line': 111L,
1182
+                             56)],
1183
+          'first-line': 54L,
1176 1184
           'folded-linenos': [],
1177
-          'sel-line': 97L,
1178
-          'sel-line-start': 4300L,
1179
-          'selection_end': 4352L,
1180
-          'selection_start': 4352L,
1185
+          'sel-line': 58L,
1186
+          'sel-line-start': 2053L,
1187
+          'selection_end': 2112L,
1188
+          'selection_start': 2112L,
1181 1189
           'zoom': 0L},
1182
-         1534867304.635],
1190
+         1536008892.341],
1183 1191
         [loc('run.py'),
1184
-         {'attrib-starts': [('Main',
1185
-                             22),
1186
-                            ('Main.show_pic',
1187
-                             206)],
1188
-          'first-line': 232L,
1192
+         {'attrib-starts': [],
1193
+          'first-line': 717L,
1189 1194
           'folded-linenos': [],
1190
-          'sel-line': 237L,
1191
-          'sel-line-start': 9356L,
1192
-          'selection_end': 9356L,
1193
-          'selection_start': 9356L,
1195
+          'sel-line': 733L,
1196
+          'sel-line-start': 29517L,
1197
+          'selection_end': 29528L,
1198
+          'selection_start': 29521L,
1194 1199
           'zoom': 0L},
1195
-         1534867343.078],
1196
-        [loc('sources/tvplay.py'),
1200
+         1536008894.754],
1201
+        [loc('sources/enigma2.py'),
1197 1202
          {'attrib-starts': [('Source',
1198
-                             32),
1203
+                             31),
1199 1204
                             ('Source.get_content',
1200
-                             62)],
1201
-          'first-line': 120L,
1205
+                             56)],
1206
+          'first-line': 54L,
1202 1207
           'folded-linenos': [],
1203
-          'sel-line': 97L,
1204
-          'sel-line-start': 4300L,
1205
-          'selection_end': 4352L,
1206
-          'selection_start': 4352L,
1208
+          'sel-line': 58L,
1209
+          'sel-line-start': 2053L,
1210
+          'selection_end': 2112L,
1211
+          'selection_start': 2112L,
1207 1212
           'zoom': 0L},
1208
-         1534867353.742],
1209
-        [loc('sources/tvplay.py'),
1213
+         1536008899.417],
1214
+        [loc('sources/enigma2.py'),
1210 1215
          {'attrib-starts': [('Source',
1211
-                             32),
1212
-                            ('Source.is_video',
1213
-                             222)],
1214
-          'first-line': 214L,
1216
+                             31),
1217
+                            ('Source.get_content',
1218
+                             56)],
1219
+          'first-line': 72L,
1215 1220
           'folded-linenos': [],
1216
-          'sel-line': 222L,
1217
-          'sel-line-start': 10645L,
1218
-          'selection_end': 10661L,
1219
-          'selection_start': 10653L,
1221
+          'sel-line': 75L,
1222
+          'sel-line-start': 2863L,
1223
+          'selection_end': 2895L,
1224
+          'selection_start': 2895L,
1220 1225
           'zoom': 0L},
1221
-         1534867365.534],
1222
-        [loc('sources/tvplay.py'),
1226
+         1536009513.46],
1227
+        [loc('sources/enigma2.py'),
1223 1228
          {'attrib-starts': [('Source',
1224
-                             32),
1225
-                            ('Source.get_streams',
1226
-                             237)],
1227
-          'first-line': 243L,
1229
+                             31),
1230
+                            ('Source.get_title_desc',
1231
+                             92)],
1232
+          'first-line': 83L,
1228 1233
           'folded-linenos': [],
1229
-          'sel-line': 246L,
1230
-          'sel-line-start': 11558L,
1231
-          'selection_end': 11573L,
1232
-          'selection_start': 11573L,
1234
+          'sel-line': 92L,
1235
+          'sel-line-start': 3532L,
1236
+          'selection_end': 3554L,
1237
+          'selection_start': 3540L,
1233 1238
           'zoom': 0L},
1234
-         1534867772.439],
1235
-        [loc('sources/tvplay.py'),
1239
+         1536009520.012],
1240
+        [loc('sources/enigma2.py'),
1236 1241
          {'attrib-starts': [('Source',
1237
-                             32),
1238
-                            ('Source.get_content',
1239
-                             62)],
1240
-          'first-line': 145L,
1242
+                             31),
1243
+                            ('Source.get_title_desc',
1244
+                             92)],
1245
+          'first-line': 85L,
1241 1246
           'folded-linenos': [],
1242
-          'sel-line': 129L,
1243
-          'sel-line-start': 5854L,
1244
-          'selection_end': 5914L,
1245
-          'selection_start': 5870L,
1247
+          'sel-line': 97L,
1248
+          'sel-line-start': 3808L,
1249
+          'selection_end': 3841L,
1250
+          'selection_start': 3841L,
1246 1251
           'zoom': 0L},
1247
-         1534867781.697],
1248
-        [loc('sources/tvplay.py'),
1252
+         1536009811.814],
1253
+        [loc('sources/enigma2.py'),
1249 1254
          {'attrib-starts': [('Source',
1250
-                             32),
1251
-                            ('Source.get_streams',
1252
-                             237)],
1253
-          'first-line': 240L,
1255
+                             31),
1256
+                            ('Source.get_title_desc',
1257
+                             92)],
1258
+          'first-line': 83L,
1254 1259
           'folded-linenos': [],
1255
-          'sel-line': 249L,
1256
-          'sel-line-start': 11673L,
1257
-          'selection_end': 11673L,
1258
-          'selection_start': 11673L,
1260
+          'sel-line': 92L,
1261
+          'sel-line-start': 3532L,
1262
+          'selection_end': 3554L,
1263
+          'selection_start': 3540L,
1259 1264
           'zoom': 0L},
1260
-         1534868014.439],
1261
-        [loc('run.py'),
1262
-         {'attrib-starts': [('Main',
1263
-                             22),
1264
-                            ('Main.show_pic',
1265
-                             206)],
1266
-          'first-line': 232L,
1265
+         1536009817.615],
1266
+        [loc('sources/enigma2.py'),
1267
+         {'attrib-starts': [],
1268
+          'first-line': 2L,
1267 1269
           'folded-linenos': [],
1268
-          'sel-line': 237L,
1269
-          'sel-line-start': 9356L,
1270
-          'selection_end': 9356L,
1271
-          'selection_start': 9356L,
1270
+          'sel-line': 7L,
1271
+          'sel-line-start': 291L,
1272
+          'selection_end': 291L,
1273
+          'selection_start': 291L,
1272 1274
           'zoom': 0L},
1273
-         1534871787.894],
1274
-        [loc('sources/tvplay.py'),
1275
-         {'attrib-starts': [('Source',
1276
-                             32),
1277
-                            ('Source.get_streams',
1278
-                             237)],
1279
-          'first-line': 233L,
1275
+         1536009825.64],
1276
+        [loc('../../../../../../../Python27/lib/lib-tk/Tkinter.py'),
1277
+         {'attrib-starts': [],
1278
+          'first-line': 0L,
1280 1279
           'folded-linenos': [],
1281
-          'sel-line': 238L,
1282
-          'sel-line-start': 11226L,
1283
-          'selection_end': 11226L,
1284
-          'selection_start': 11226L,
1280
+          'sel-line': 0L,
1281
+          'sel-line-start': 0L,
1282
+          'selection_end': 0L,
1283
+          'selection_start': 0L,
1285 1284
           'zoom': 0L},
1286
-         1534871794.684],
1287
-        [loc('run.py'),
1288
-         {'attrib-starts': [('VideoInfo',
1289
-                             343),
1290
-                            ('VideoInfo.body',
1291
-                             370)],
1292
-          'first-line': 401L,
1285
+         1536009826.274],
1286
+        [loc('sources/enigma2.py'),
1287
+         {'attrib-starts': [('Source',
1288
+                             31),
1289
+                            ('Source.get_content',
1290
+                             56)],
1291
+          'first-line': 52L,
1293 1292
           'folded-linenos': [],
1294
-          'sel-line': 412L,
1295
-          'sel-line-start': 16393L,
1296
-          'selection_end': 16393L,
1297
-          'selection_start': 16393L,
1293
+          'sel-line': 57L,
1294
+          'sel-line-start': 2007L,
1295
+          'selection_end': 2007L,
1296
+          'selection_start': 2007L,
1298 1297
           'zoom': 0L},
1299
-         1534871894.169],
1300
-        [loc('sources/tvplay.py'),
1298
+         1536009893.649],
1299
+        [loc('sources/enigma2.py'),
1301 1300
          {'attrib-starts': [('Source',
1302
-                             32),
1303
-                            ('Source.get_streams',
1304
-                             237)],
1305
-          'first-line': 233L,
1301
+                             31),
1302
+                            ('Source.get_title_desc',
1303
+                             92)],
1304
+          'first-line': 51L,
1306 1305
           'folded-linenos': [],
1307
-          'sel-line': 238L,
1308
-          'sel-line-start': 11226L,
1309
-          'selection_end': 11226L,
1310
-          'selection_start': 11226L,
1306
+          'sel-line': 92L,
1307
+          'sel-line-start': 3532L,
1308
+          'selection_end': 3554L,
1309
+          'selection_start': 3540L,
1311 1310
           'zoom': 0L},
1312
-         1534871898.081]],
1311
+         1536009988.528]],
1313 1312
         20),
1314
-        'current-loc': loc('sources/tvplay.py'),
1313
+        'current-loc': loc('sources/enigma2.py'),
1315 1314
         'editor-state-list': [(loc('run.py'),
1316
-                               {'attrib-starts': [('VideoInfo',
1317
-        343),
1318
-        ('VideoInfo.body',
1319
-         370)],
1320
-                                'first-line': 401L,
1315
+                               {'attrib-starts': [],
1316
+                                'first-line': 717L,
1321 1317
                                 'folded-linenos': [],
1322
-                                'sel-line': 412L,
1323
-                                'sel-line-start': 16393L,
1324
-                                'selection_end': 16393L,
1325
-                                'selection_start': 16393L,
1318
+                                'sel-line': 733L,
1319
+                                'sel-line-start': 29517L,
1320
+                                'selection_end': 29528L,
1321
+                                'selection_start': 29521L,
1326 1322
                                 'zoom': 0L}),
1327 1323
                               (loc('util.py'),
1328 1324
                                {'attrib-starts': [('unescape',
@@ -1342,7 +1338,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1342 1338
         26),
1343 1339
         ('Source.get_info2',
1344 1340
          930)],
1345
-                                'first-line': 934L,
1341
+                                'first-line': 1201L,
1346 1342
                                 'folded-linenos': [132L,
1347 1343
         161L,
1348 1344
         221L,
@@ -1442,6 +1438,18 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1442 1438
                                 'sel-line-start': 7404L,
1443 1439
                                 'selection_end': 7404L,
1444 1440
                                 'selection_start': 7404L,
1441
+                                'zoom': 0L}),
1442
+                              (loc('sources/enigma2.py'),
1443
+                               {'attrib-starts': [('Source',
1444
+        31),
1445
+        ('Source.__init__',
1446
+         33)],
1447
+                                'first-line': 21L,
1448
+                                'folded-linenos': [],
1449
+                                'sel-line': 47L,
1450
+                                'sel-line-start': 1575L,
1451
+                                'selection_end': 1630L,
1452
+                                'selection_start': 1630L,
1445 1453
                                 'zoom': 0L})],
1446 1454
         'has-focus': True,
1447 1455
         'locked': False},
@@ -1454,17 +1462,19 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1454 1462
          loc('sources/config.py'),
1455 1463
          loc('changelog.md'),
1456 1464
          loc('sources/filmix.py'),
1457
-         loc('sources/filmas.py')]),
1465
+         loc('sources/filmas.py'),
1466
+         loc('sources/enigma2.py')]),
1458 1467
                                'open_files': [u'changelog.md',
1468
+        u'run.py',
1459 1469
         u'sources/config.py',
1460 1470
         u'sources/euronews.py',
1461 1471
         u'sources/filmas.py',
1462 1472
         u'sources/filmix.py',
1463 1473
         u'sources/ltc.py',
1464 1474
         u'sources/replay.py',
1475
+        u'sources/tvplay.py',
1465 1476
         u'util.py',
1466
-        u'run.py',
1467
-        u'sources/tvplay.py']},
1477
+        u'sources/enigma2.py']},
1468 1478
         'saved_notebook_display': None,
1469 1479
         'split_percents': {0: 0.587782340862423},
1470 1480
         'splits': 2,
@@ -1479,12 +1489,13 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1479 1489
                          0,
1480 1490
                          2393,
1481 1491
                          1440)}]}
1482
-guimgr.recent-documents = [loc('sources/tvplay.py'),
1483
-                           loc('run.py'),
1492
+guimgr.recent-documents = [loc('sources/enigma2.py'),
1484 1493
                            loc('util.py'),
1494
+                           loc('run.py'),
1495
+                           loc('sources/ltc.py'),
1496
+                           loc('sources/tvplay.py'),
1485 1497
                            loc('sources/euronews.py'),
1486 1498
                            loc('sources/replay.py'),
1487
-                           loc('sources/ltc.py'),
1488 1499
                            loc('sources/filmix.py'),
1489 1500
                            loc('sources/filmas.py'),
1490 1501
                            loc('changelog.md'),
@@ -1780,6 +1791,18 @@ guimgr.visual-state = {loc('../../../Python25/Lib/BeautifulSoup.py'): {'attr'\
1780 1791
         'sel-line-start': 4309L,
1781 1792
         'selection_end': 4309L,
1782 1793
         'selection_start': 4309L,
1794
+        'zoom': 0L},
1795
+                       loc('sources/enigma2.py'): {'attrib-starts': [('Sourc'\
1796
+        'e',
1797
+        31),
1798
+        ('Source.get_content',
1799
+         56)],
1800
+        'first-line': 54L,
1801
+        'folded-linenos': [],
1802
+        'sel-line': 58L,
1803
+        'sel-line-start': 2053L,
1804
+        'selection_end': 2112L,
1805
+        'selection_start': 2112L,
1783 1806
         'zoom': 0L},
1784 1807
                        loc('sources/euronews.py'): {'attrib-starts': [('Sour'\
1785 1808
         'ce',
@@ -2036,6 +2059,15 @@ guimgr.visual-state = {loc('../../../Python25/Lib/BeautifulSoup.py'): {'attr'\
2036 2059
         'sel-line-start': 29594L,
2037 2060
         'selection_end': 29594L,
2038 2061
         'selection_start': 29594L,
2062
+        'zoom': 0L},
2063
+                       loc('../../../../../../../Python27/lib/lib-tk/Tkinter.py'): {'a'\
2064
+        'ttrib-starts': [],
2065
+        'first-line': 0L,
2066
+        'folded-linenos': [],
2067
+        'sel-line': 0L,
2068
+        'sel-line-start': 0L,
2069
+        'selection_end': 0L,
2070
+        'selection_start': 0L,
2039 2071
         'zoom': 0L},
2040 2072
                        loc('x-wingide-zip://C:/Python25/Lib/site-packages/argparse-1.1-py2.5.egg//argparse.py'): {'a'\
2041 2073
         'ttrib-starts': [('_ActionsContainer',

+ 151
- 0
sources/enigma2.py View File

@@ -0,0 +1,151 @@
1
+#!/usr/bin/env python
2
+# coding=utf8
3
+#
4
+# This file is part of PlayStream - enigma2 plugin to play video streams from various sources
5
+# Copyright (c) 2016 ivars777 (ivars777@gmail.com)
6
+# Distributed under the GNU GPL v3. For full terms see http://www.gnu.org/licenses/gpl-3.0.en.html
7
+#
8
+try:
9
+    import json
10
+except:
11
+    import simplejson as json
12
+import requests
13
+import datetime, re, sys,os
14
+from collections import OrderedDict
15
+import ssl
16
+if "_create_unverified_context" in dir(ssl):
17
+    ssl._create_default_https_context = ssl._create_unverified_context
18
+
19
+from SourceBase import SourceBase
20
+
21
+import resolver
22
+try:
23
+    import util
24
+except:
25
+    sys.path.insert(0,'..')
26
+    import util
27
+
28
+headers2dict = lambda  h: dict([l.strip().split(": ") for l in h.strip().splitlines()])
29
+import HTMLParser
30
+h = HTMLParser.HTMLParser()
31
+
32
+class Source(SourceBase):
33
+
34
+    def __init__(self, country="lv",cfg_path=None):
35
+        self.name = "enigma2"
36
+        self.title = "Engima2"
37
+        self.img = "enigma2.png"
38
+        self.desc = "Get streams from engima2 sat receiver"
39
+        self.headers = headers2dict("""
40
+User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
41
+Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
42
+Accept-Language: en-US,en;q=0.5
43
+""")
44
+        #self.url = "http://login.tvplayhome.lt:8081/sb/public/"
45
+        cur_directory = os.path.dirname(os.path.abspath(__file__))
46
+        if not cfg_path: cfg_path = cur_directory
47
+        self.config_file = os.path.join(cfg_path,self.name+".cfg")
48
+        self.options = OrderedDict([("host", "localhost"), ("user",""),("password","")])
49
+        self.options_read()
50
+
51
+        if self.options["user"]:
52
+            self.url = "http://%s/api/" % (self.options["host"])
53
+        else:
54
+            self.url = "http://%s:%s@%s/api/" % (self.options["user"], self.options["password"],self.options["host"])
55
+
56
+    ######### Entry point ########
57
+    def get_content(self, data):
58
+        print "[enigma2] get_content:", data
59
+        source, data, path, plist, clist, params, qs = self.parse_data(data)
60
+        content = []
61
+        content.append(("..return", "back","back.png","Return back"))
62
+
63
+        if clist=="home":
64
+            r = self.call("bouquets?stype=tv")
65
+            content.append(("Current stream", self.name+"::"+"streamcurrent.m3u", self.img, "Current receiver stream"))
66
+            for item in r["bouquets"]:
67
+                title = item[1]
68
+                data2 = "getservices?sRef=%s" % item[0]
69
+                #data2 = "epgbouquet?bRef=%s" % item[1]
70
+                content.append((title, self.name+"::"+data2, self.img, title))
71
+            return content
72
+
73
+        elif clist == "getservices":
74
+            r = self.call(data)
75
+            data3 = data.replace("getservices?sRef", "epgbouquet?bRef")
76
+            r2 = self.call(data3)
77
+            for item in r["services"]:
78
+                title = item["servicename"]
79
+                data2 = "stream.m3u?ref=%s&name=%s" % (item["servicereference"], title)
80
+                img = self.img
81
+                desc = title
82
+                for item2 in r2["events"]:
83
+                    if item2["sref"] == item["servicereference"]:
84
+                        title, img, desc = self.get_title_desc(item2)
85
+                        break
86
+                content.append((title,self.name+"::"+data2, img,desc))
87
+            return content
88
+
89
+        ### kaut kas neparedzets ###
90
+        else:
91
+            return content
92
+
93
+    def get_title_desc(self, event):
94
+        t1 = event["begin_timestamp"]
95
+        t2 = event["begin_timestamp"] + event["duration_sec"]
96
+        t1 = datetime.datetime.fromtimestamp(t1).strftime("%H:%M")
97
+        t2 = datetime.datetime.fromtimestamp(t2).strftime("%H:%M")
98
+        title = "%s - %s []%s-%s]" % (event["sname"], event["title"], t1, t2)
99
+        desc = event["shortdesc"]
100
+        if event["longdesc"]:
101
+            desc += "\n" + event["longdesc"]
102
+        img = event["sref"][:-1].replace(":", "_") + ".png"
103
+        img = self.url.replace("/api/", "/picon/") + img
104
+        return title, img, desc
105
+
106
+
107
+    def is_video(self,data):
108
+        source,data,path,plist,clist,params,qs = self.parse_data(data)
109
+        if clist in ("stream.m3u", "streamcurrent.m3u"):
110
+            return True
111
+        else:
112
+            return False
113
+
114
+    def call(self, data,params=None,headers=None,lang=""):
115
+        if not headers: headers = self.headers
116
+        url = self.url+data
117
+        r = requests.get(url,headers = headers)
118
+        result = json.loads(r.content)
119
+        #result = self._http_request(url,params,headers=headers)
120
+        return result
121
+
122
+    def get_streams(self,data):
123
+        print "[enigma2] get_streams:", data
124
+        if not self.is_video(data):
125
+            return []
126
+        source,data,path,plist,clist,params,qs = self.parse_data(data)
127
+        r = self._http_request(self.url+data)
128
+        m =  re.search("(http(s)*:.+)", r)
129
+        if not m:
130
+            raise Exception("No streams found!")
131
+        data2 = m.group(1)
132
+        title, img, desc = self.get_title_desc(r["events"][0])
133
+        stream = util.item()
134
+        stream["name"] = title
135
+        stream["url"] = data2
136
+        stream["img"] = img
137
+        stream["desc"] = desc
138
+        stream["resolver"] = "enigma2"
139
+        return [stream]
140
+
141
+
142
+if __name__ == "__main__":
143
+    sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
144
+    import run
145
+    source = Source()
146
+    data= sys.argv[1] if len(sys.argv)>1 else source.name+"::home"
147
+    if len(sys.argv) > 2:
148
+        run.run_cli(source, data)
149
+    else:
150
+        run.run(source, data)
151
+    sys.exit()