Browse Source

COnfig logs ar parametriem

Ivars 8 years ago
parent
commit
78be38616d
7 changed files with 445 additions and 343 deletions
  1. 123
    23
      PlayStream.py
  2. 260
    260
      PlayStream.wpr
  3. 8
    3
      changelog.md
  4. 0
    3
      resolver.py
  5. 2
    3
      sources/SourceBase.py
  6. 1
    1
      sources/ltc.py
  7. 51
    50
      sources/replay.py

+ 123
- 23
PlayStream.py View File

42
 
42
 
43
 import ContentSources
43
 import ContentSources
44
 import util
44
 import util
45
-from sources.SourceBase import stream0
46
 from VideoDownload import downloadJob, HLSDownloadJob,VideoDownloadList
45
 from VideoDownload import downloadJob, HLSDownloadJob,VideoDownloadList
47
 #import enigma2_api
46
 #import enigma2_api
48
-
49
-TMPDIR = "/tmp/playstream/"
50
 e2 = None
47
 e2 = None
51
-config.playstream = ConfigSubsection()
52
-config.playstream.locations = ConfigLocations(default=["/media/hdd/movie/"])
53
-config.playstream.download_dir = ConfigText(default="/media/hdd/movie/")
48
+
49
+##########################################################################
50
+from Components.config import config, ConfigSubsection, ConfigYesNo, getConfigListEntry, \
51
+     ConfigSelection, ConfigNumber, ConfigDirectory,ConfigText
52
+from Components.ConfigList import ConfigListScreen
53
+from Screens.LocationBox import LocationBox
54
+
55
+config.plugins.playstream = ConfigSubsection()
56
+config.plugins.playstream.locations = ConfigLocations(default=["/media/hdd/movie/"])
57
+config.plugins.playstream.download_dir = ConfigDirectory(default="/media/hdd/movie/")
58
+config.plugins.playstream.tmp_dir = ConfigDirectory(default="/tmp/playstream/")
59
+config.plugins.playstream.streamproxy_start = ConfigYesNo(default = True)
60
+#config.plugins.playstream.size = ConfigSelection({"400x240":"400x240","220x132":"220x132","100x60":"100x60"}, default="220x132")
61
+config.plugins.playstream.clear_tmp = ConfigYesNo(default = True)
62
+
63
+class ConfigScreen(ConfigListScreen,Screen):
64
+    skin = """
65
+<screen position="center,center" size="560,400" title="PlayStream Configuration" >
66
+	<ePixmap name="red"    position="0,0"   zPosition="2" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
67
+	<ePixmap name="green"  position="140,0" zPosition="2" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
68
+	<ePixmap name="yellow" position="280,0" zPosition="2" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
69
+	<ePixmap name="blue"   position="420,0" zPosition="2" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />
70
+
71
+	<widget name="key_red" position="0,0" size="140,40" valign="center" halign="center" zPosition="4"  foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
72
+	<widget name="key_green" position="140,0" size="140,40" valign="center" halign="center" zPosition="4"  foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
73
+	<widget name="key_yellow" position="280,0" size="140,40" valign="center" halign="center" zPosition="4"  foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
74
+	<widget name="key_blue" position="420,0" size="140,40" valign="center" halign="center" zPosition="4"  foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
75
+
76
+	<widget name="config" position="10,40" size="540,340" scrollbarMode="showOnDemand" />
77
+</screen>"""
78
+
79
+    def __init__(self, session, args = 0):
80
+        self.session = session
81
+        #self.setup_title = "Options"
82
+        Screen.__init__(self, session)
83
+        cfg = config.plugins.playstream
84
+        self.list = [
85
+            getConfigListEntry(_("Download folder"), cfg.download_dir),
86
+            getConfigListEntry(_("TMP folder"), cfg.tmp_dir),
87
+            getConfigListEntry(_("Clear tmp folder on exit"), cfg.clear_tmp),
88
+            getConfigListEntry(_("Start playstreamproxy"), cfg.streamproxy_start),
89
+        ]
90
+        ConfigListScreen.__init__(self, self.list, session = self.session)
91
+        self["key_red"] = Button(_("Cancel"))
92
+        self["key_green"] = Button(_("Save"))
93
+        self["key_yellow"] = Button("")
94
+        self["key_blue"] = Button("")
95
+        self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
96
+                                         {
97
+                                             "red": self.cancel,
98
+                                             "green": self.save,
99
+                                             "save": self.save,
100
+                                             "cancel": self.cancel,
101
+                                             "ok": self.ok,
102
+                                             }, -2)
103
+
104
+    def getCurrentEntry(self):
105
+        return self["config"].getCurrent()[0]
106
+
107
+    def getCurrentValue(self):
108
+        return str(self["config"].getCurrent()[1].getText())
109
+
110
+    def ok(self):
111
+        if self["config"].getCurrent()[1] == config.plugins.playstream.download_dir:
112
+            folder = config.plugins.playstream.download_dir.value
113
+            #self.session.openWithCallback(self.select_download_dir, LocationBox,"Select Folder")
114
+            self.session.openWithCallback(self.select_download_dir, LocationBox,"Select download folder","",config.plugins.playstream.download_dir.value,config.plugins.playstream.locations,False,"Select folder",None,True,True)
115
+        elif self["config"].getCurrent()[1] == config.plugins.playstream.tmp_dir:
116
+            self.session.openWithCallback(self.select_tmp_dir, LocationBox,"Select tmp folder","",config.plugins.playstream.download_dir.value,config.plugins.playstream.locations,False,"Select folder",None,True,True)
117
+        else:
118
+            self.save()
119
+
120
+    def select_download_dir(self, folder, select=None):
121
+        if not folder:
122
+            return
123
+        print "Folder selected - %s"%folder
124
+        config.plugins.playstream.download_dir.setValue(folder)
125
+        config.plugins.playstream.download_dir.save()
126
+        config.plugins.playstream.locations.save()
127
+        config.save()
128
+
129
+    def select_tmp_dir(self, folder, select=None):
130
+        if not folder:
131
+            return
132
+        print "Folder selected - %s"%folder
133
+        config.plugins.playstream.tmp_dir.setValue(folder)
134
+        config.plugins.playstream.tmp_dir.save()
135
+        config.plugins.playstream.locations.save()
136
+        config.save()
137
+
138
+    def save(self):
139
+        print "saving"
140
+        self.saveAll()
141
+        self.close(True,self.session)
142
+
143
+    def cancel(self):
144
+        #print "cancel"
145
+        self.close(False,self.session)
54
 
146
 
55
 def make_service(stream):
147
 def make_service(stream):
56
     url = stream["url"]
148
     url = stream["url"]
356
     <widget name="key_green" position="290,535" size="140,40" valign="center" halign="center" zPosition="4"  foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
448
     <widget name="key_green" position="290,535" size="140,40" valign="center" halign="center" zPosition="4"  foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
357
     <ePixmap name="yellow" position="430,535" zPosition="2" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
449
     <ePixmap name="yellow" position="430,535" zPosition="2" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
358
     <widget name="key_yellow" position="430,535" size="140,40" valign="center" halign="center" zPosition="4"  foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
450
     <widget name="key_yellow" position="430,535" size="140,40" valign="center" halign="center" zPosition="4"  foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
359
-    <ePixmap name="menu"   position="610,540" zPosition="2" size="140,40"  pixmap="skin_default/buttons/key_menu.png" transparent="1" alphatest="on" />
360
-    <widget name="key_menu" position="610,535" size="140,40" valign="center" halign="center" zPosition="4"  backgroundColor="blue" foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
451
+    <ePixmap name="blue" position="570,535" zPosition="2" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />
452
+    <widget name="key_blue" position="570,535" size="140,40" valign="center" halign="center" zPosition="4"  foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
453
+    <ePixmap name="menu"   position="750,540" zPosition="2" size="140,40"  pixmap="skin_default/buttons/key_menu.png" transparent="1" alphatest="on" />
454
+    <widget name="key_menu" position="750,535" size="140,40" valign="center" halign="center" zPosition="4"  backgroundColor="blue" foregroundColor="white" font="Regular;20" transparent="1" shadowColor="background" shadowOffset="-2,-2" />
361
 
455
 
362
 </screen>"""
456
 </screen>"""
363
 
457
 
369
         self["key_red"] = Button(_("Exit"))
463
         self["key_red"] = Button(_("Exit"))
370
         self["key_green"] = Button(_("Select"))
464
         self["key_green"] = Button(_("Select"))
371
         self["key_yellow"] = Button(_("Options"))
465
         self["key_yellow"] = Button(_("Options"))
466
+        self["key_blue"] = Button(_("Config"))
372
         self["key_menu"] = Button("Menu")
467
         self["key_menu"] = Button("Menu")
373
         self["key_exit"] = Button("Back")
468
         self["key_exit"] = Button("Back")
374
 
469
 
379
                                         "green": self.Ok,
474
                                         "green": self.Ok,
380
                                         "red": self.Cancel,
475
                                         "red": self.Cancel,
381
                                         "yellow": self.options_screen,
476
                                         "yellow": self.options_screen,
382
-                                        "blue": self.download_list,
477
+                                        "blue": self.config_screen,
383
                                         "menu": self.item_menu,
478
                                         "menu": self.item_menu,
384
                                         "cancel": self.Back,
479
                                         "cancel": self.Back,
385
                                     })
480
                                     })
390
         self["title"] = Label()
485
         self["title"] = Label()
391
         self.downloading = 0
486
         self.downloading = 0
392
         self.activeDownloads = 0
487
         self.activeDownloads = 0
393
-        if not os.path.exists(TMPDIR):
394
-            os.mkdir(TMPDIR)
488
+        if not os.path.exists(config.plugins.playstream.tmp_dir.value):
489
+            os.mkdir(config.plugins.playstream.tmp_dir.value)
395
         self.onLayoutFinish.append(self.LayoutFinish)
490
         self.onLayoutFinish.append(self.LayoutFinish)
396
 
491
 
397
     def LayoutFinish(self):
492
     def LayoutFinish(self):
455
         else:
550
         else:
456
             if image_url.startswith("http"):
551
             if image_url.startswith("http"):
457
                 fname = image_url.replace(":","-").replace("/","_")
552
                 fname = image_url.replace(":","-").replace("/","_")
458
-                image_path = os.path.join(TMPDIR, fname)
553
+                image_path = os.path.join(config.plugins.playstream.tmp_dir.value, fname)
459
                 self.download_image(image_path, image_url)
554
                 self.download_image(image_path, image_url)
460
             else: # local file
555
             else: # local file
461
                 image_path = os.path.join(self.cur_directory,image_url)
556
                 image_path = os.path.join(self.cur_directory,image_url)
596
         self.SelectionChanged()
691
         self.SelectionChanged()
597
 
692
 
598
     def Cancel(self):
693
     def Cancel(self):
599
-        #if os.path.exists(TMPDIR):
600
-            #for name in os.listdir(TMPDIR):
601
-                #os.remove(os.path.join(TMPDIR, name))
602
-            #os.rmdir(TMPDIR)
694
+        print "Exiting PlayStream"
695
+        if config.plugins.playstream.clear_tmp.value and os.path.exists(config.plugins.playstream.tmp_dir.value):
696
+            for name in os.listdir(config.plugins.playstream.tmp_dir.value):
697
+                #print "remove "+os.path.join(config.plugins.playstream.tmp_dir.value, name)
698
+                os.remove(os.path.join(config.plugins.playstream.tmp_dir.value, name))
699
+            #os.rmdir(config.plugins.playstream.tmp_dir.value)
603
         self.close()
700
         self.close()
604
 
701
 
605
 
702
 
678
 
775
 
679
         elif answer[1] == 'download_folder':
776
         elif answer[1] == 'download_folder':
680
             #downloadDir = "/media/hdd/movie" #config.plugins.playstream.downloadDir.value TODO
777
             #downloadDir = "/media/hdd/movie" #config.plugins.playstream.downloadDir.value TODO
681
-            self.session.openWithCallback(self.select_download_dir, LocationBox,"Select download folder","",config.playstream.download_dir.value,config.playstream.locations,False,"Select folder",None,True,True)
778
+            self.session.openWithCallback(self.select_download_dir, LocationBox,"Select download folder","",config.plugins.playstream.download_dir.value,config.plugins.playstream.locations,False,"Select folder",None,True,True)
682
 
779
 
683
         elif answer[1] == "delete":
780
         elif answer[1] == "delete":
684
             lst = self.cur_menu[1].replace("config::","")
781
             lst = self.cur_menu[1].replace("config::","")
701
         if not downloadDir:
798
         if not downloadDir:
702
             return
799
             return
703
         print "Folder selected - %s"%downloadDir
800
         print "Folder selected - %s"%downloadDir
704
-        config.playstream.download_dir.setValue(downloadDir)
705
-        config.playstream.download_dir.save()
706
-        config.playstream.locations.save()
801
+        config.plugins.playstream.download_dir.setValue(downloadDir)
802
+        config.plugins.playstream.download_dir.save()
803
+        config.plugins.playstream.locations.save()
707
         config.save()
804
         config.save()
708
 
805
 
709
     def download_list(self):
806
     def download_list(self):
750
         title = self.stream["name"].strip()
847
         title = self.stream["name"].strip()
751
         url = self.stream["url"]
848
         url = self.stream["url"]
752
         stream_type = self.stream["type"] #self.sources.stream_type(stream["url"])
849
         stream_type = self.stream["type"] #self.sources.stream_type(stream["url"])
753
-        downloadDir = config.playstream.download_dir.value
850
+        downloadDir = config.plugins.playstream.download_dir.value
754
         if not os.path.exists(downloadDir):
851
         if not os.path.exists(downloadDir):
755
             print 'Sorry, download directory "%s" not exist!\nPlease specify in the settings existing directory'%downloadDir
852
             print 'Sorry, download directory "%s" not exist!\nPlease specify in the settings existing directory'%downloadDir
756
             self.msg0(_('Sorry, download directory "%s" not exist!\nPlease specify in the settings existing directory'%downloadDir))
853
             self.msg0(_('Sorry, download directory "%s" not exist!\nPlease specify in the settings existing directory'%downloadDir))
831
         self.session.open(MessageBox, txt, MessageBox.TYPE_INFO,timeout=3)
928
         self.session.open(MessageBox, txt, MessageBox.TYPE_INFO,timeout=3)
832
         #self.session.openWithCallback(self.callMyMsg, MessageBox, _("Do you want to exit the plugin?"), MessageBox.TYPE_INFO)
929
         #self.session.openWithCallback(self.callMyMsg, MessageBox, _("Do you want to exit the plugin?"), MessageBox.TYPE_INFO)
833
 
930
 
931
+    def config_screen(self):
932
+        self.session.open(ConfigScreen,self)
933
+
834
     def options_screen(self):
934
     def options_screen(self):
835
         source = self.cur_menu[1].split("::")[0]
935
         source = self.cur_menu[1].split("::")[0]
836
         options = self.sources.options_read(source)
936
         options = self.sources.options_read(source)
857
 from Components.ConfigList import ConfigListScreen
957
 from Components.ConfigList import ConfigListScreen
858
 #from Screens.LocationBox import LocationBox
958
 #from Screens.LocationBox import LocationBox
859
 
959
 
860
-config.plugins.playstream = ConfigSubDict()
960
+#config.plugins.playstream = ConfigSubDict()
861
 
961
 
862
 class OptionsScreen(ConfigListScreen,Screen):
962
 class OptionsScreen(ConfigListScreen,Screen):
863
     skin = """
963
     skin = """
880
         self.main = args[0]
980
         self.main = args[0]
881
         self.setTitle(self.main.cur_menu[0]+" options")
981
         self.setTitle(self.main.cur_menu[0]+" options")
882
         self.source = self.main.cur_menu[1].split("::")[0]
982
         self.source = self.main.cur_menu[1].split("::")[0]
883
-        self.cfg = config.plugins.playstream
983
+        self.cfg = ConfigSubDict() #config.plugins.playstream
884
         self.list = []
984
         self.list = []
885
         self.options = self.main.sources.options_read(self.source)
985
         self.options = self.main.sources.options_read(self.source)
886
         if not self.options:
986
         if not self.options:

+ 260
- 260
PlayStream.wpr View File

5054
         ('MainScreen.Ok',
5054
         ('MainScreen.Ok',
5055
          243)],
5055
          243)],
5056
                           'first-line': 237,
5056
                           'first-line': 237,
5057
-                          'sel-line': 498L}),
5057
+                          'sel-line': 594L}),
5058
                   'cb_item_menu': (loc('PlayStream.py'),
5058
                   'cb_item_menu': (loc('PlayStream.py'),
5059
                                    {'attrib-starts': [('MainScreen',
5059
                                    {'attrib-starts': [('MainScreen',
5060
         72),
5060
         72),
5061
         ('MainScreen.cb_item_menu',
5061
         ('MainScreen.cb_item_menu',
5062
          349)],
5062
          349)],
5063
                                     'first-line': 364,
5063
                                     'first-line': 364,
5064
-                                    'sel-line': 635L}),
5064
+                                    'sel-line': 733L}),
5065
                   'item_menu': (loc('PlayStream.py'),
5065
                   'item_menu': (loc('PlayStream.py'),
5066
                                 {'attrib-starts': [('MainScreen',
5066
                                 {'attrib-starts': [('MainScreen',
5067
         69),
5067
         69),
5068
         ('MainScreen.item_menu',
5068
         ('MainScreen.item_menu',
5069
          320)],
5069
          320)],
5070
                                  'first-line': 312,
5070
                                  'first-line': 312,
5071
-                                 'sel-line': 613L})}
5071
+                                 'sel-line': 711L})}
5072
 edit.file-encoding = {loc('streams.cfg'): 'utf_8'}
5072
 edit.file-encoding = {loc('streams.cfg'): 'utf_8'}
5073
 guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
5073
 guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
5074
                             'windows': [{'name': 'CLLIF0zyp30ULG6MKhIRp1Beg6'\
5074
                             'windows': [{'name': 'CLLIF0zyp30ULG6MKhIRp1Beg6'\
5165
                                        'fMatchCase': False,
5165
                                        'fMatchCase': False,
5166
                                        'fOmitBinary': True,
5166
                                        'fOmitBinary': True,
5167
                                        'fRegexFlags': 46,
5167
                                        'fRegexFlags': 46,
5168
-                                       'fReplaceText': u'movieplace',
5168
+                                       'fReplaceText': u'config.plugins.playstream.',
5169
                                        'fReverse': False,
5169
                                        'fReverse': False,
5170
-                                       'fSearchText': u'urlp',
5170
+                                       'fSearchText': u'yesno',
5171
                                        'fStartPos': 0,
5171
                                        'fStartPos': 0,
5172
                                        'fStyle': 'text',
5172
                                        'fStyle': 'text',
5173
                                        'fWholeWords': False,
5173
                                        'fWholeWords': False,
5252
                       'wide',
5252
                       'wide',
5253
                       1,
5253
                       1,
5254
                       {})],
5254
                       {})],
5255
-        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('sources/viaplay.py'),
5256
-        {'attrib-starts': [('Source',
5257
-                            26),
5258
-                           ('Source.get_streams',
5259
-                            308)],
5260
-         'first-line': 359L,
5261
-         'folded-linenos': [],
5262
-         'sel-line': 363L,
5263
-         'sel-line-start': 17585L,
5264
-         'selection_end': 17617L,
5265
-         'selection_start': 17617L},
5266
-        1484608183.824],
5267
-        [loc('sources/viaplay.py'),
5268
-         {'attrib-starts': [('Source',
5269
-                             26),
5270
-                            ('Source.get_streams',
5271
-                             308)],
5272
-          'first-line': 359L,
5273
-          'folded-linenos': [],
5274
-          'sel-line': 383L,
5275
-          'sel-line-start': 18370L,
5276
-          'selection_end': 18391L,
5277
-          'selection_start': 18391L},
5278
-         1484608191.386],
5279
-        [loc('sources/viaplay.py'),
5255
+        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('PlayStream.py'),
5256
+        {'attrib-starts': [('ConfigScreen',
5257
+                            63),
5258
+                           ('ConfigScreen.cancel',
5259
+                            143)],
5260
+         'first-line': 122L,
5261
+         'folded-linenos': [191L],
5262
+         'sel-line': 143L,
5263
+         'sel-line-start': 7502L,
5264
+         'selection_end': 7513L,
5265
+         'selection_start': 7506L},
5266
+        1484780355.806],
5267
+        [loc('PlayStream.py'),
5268
+         {'attrib-starts': [('ConfigScreen',
5269
+                             63),
5270
+                            ('ConfigScreen.cancel',
5271
+                             143)],
5272
+          'first-line': 122L,
5273
+          'folded-linenos': [191L],
5274
+          'sel-line': 143L,
5275
+          'sel-line-start': 7502L,
5276
+          'selection_end': 7514L,
5277
+          'selection_start': 7506L},
5278
+         1484780356.592],
5279
+        [loc('PlayStream.py'),
5280
+         {'attrib-starts': [('MainScreen',
5281
+                             424),
5282
+                            ('MainScreen.Cancel',
5283
+                             690)],
5284
+          'first-line': 479L,
5285
+          'folded-linenos': [191L],
5286
+          'sel-line': 694L,
5287
+          'sel-line-start': 30920L,
5288
+          'selection_end': 30937L,
5289
+          'selection_start': 30937L},
5290
+         1484780625.051],
5291
+        [loc('PlayStream.py'),
5280
          {'attrib-starts': [],
5292
          {'attrib-starts': [],
5281
-          'first-line': 428L,
5282
-          'folded-linenos': [],
5283
-          'sel-line': 449L,
5284
-          'sel-line-start': 21214L,
5285
-          'selection_end': 21230L,
5286
-          'selection_start': 21226L},
5287
-         1484608209.637],
5288
-        [loc('sources/viaplay.py'),
5293
+          'first-line': 27L,
5294
+          'folded-linenos': [191L],
5295
+          'sel-line': 47L,
5296
+          'sel-line-start': 1907L,
5297
+          'selection_end': 1913L,
5298
+          'selection_start': 1907L},
5299
+         1484780642.887],
5300
+        [loc('PlayStream.py'),
5301
+         {'attrib-starts': [('ConfigScreen',
5302
+                             62),
5303
+                            ('ConfigScreen.ok',
5304
+                             109)],
5305
+          'first-line': 108L,
5306
+          'folded-linenos': [190L],
5307
+          'sel-line': 115L,
5308
+          'sel-line-start': 6460L,
5309
+          'selection_end': 6534L,
5310
+          'selection_start': 6523L},
5311
+         1484780727.258],
5312
+        [loc('PlayStream.py'),
5289
          {'attrib-starts': [],
5313
          {'attrib-starts': [],
5290
-          'first-line': 427L,
5291
-          'folded-linenos': [],
5292
-          'sel-line': 450L,
5293
-          'sel-line-start': 21262L,
5294
-          'selection_end': 21290L,
5295
-          'selection_start': 21286L},
5296
-         1484608219.88],
5297
-        [loc('sources/viaplay.py'),
5314
+          'first-line': 47L,
5315
+          'folded-linenos': [190L],
5316
+          'sel-line': 52L,
5317
+          'sel-line-start': 2197L,
5318
+          'selection_end': 2221L,
5319
+          'selection_start': 2210L},
5320
+         1484780729.99],
5321
+        [loc('PlayStream.py'),
5298
          {'attrib-starts': [],
5322
          {'attrib-starts': [],
5299
-          'first-line': 7L,
5300
-          'folded-linenos': [],
5301
-          'sel-line': 12L,
5302
-          'sel-line-start': 344L,
5303
-          'selection_end': 365L,
5304
-          'selection_start': 361L},
5305
-         1484608221.118],
5306
-        [loc('sources/viaplay.py'),
5307
-         {'attrib-starts': [('Source',
5308
-                             26),
5309
-                            ('Source.get_streams',
5310
-                             308)],
5311
-          'first-line': 351L,
5312
-          'folded-linenos': [],
5313
-          'sel-line': 372L,
5314
-          'sel-line-start': 17955L,
5315
-          'selection_end': 17972L,
5316
-          'selection_start': 17968L},
5317
-         1484608222.226],
5318
-        [loc('sources/viaplay.py'),
5323
+          'first-line': 47L,
5324
+          'folded-linenos': [190L],
5325
+          'sel-line': 52L,
5326
+          'sel-line-start': 2197L,
5327
+          'selection_end': 2240L,
5328
+          'selection_start': 2229L},
5329
+         1484780731.293],
5330
+        [loc('PlayStream.py'),
5331
+         {'attrib-starts': [('ConfigScreen',
5332
+                             62),
5333
+                            ('ConfigScreen.ok',
5334
+                             109)],
5335
+          'first-line': 91L,
5336
+          'folded-linenos': [190L],
5337
+          'sel-line': 112L,
5338
+          'sel-line-start': 6053L,
5339
+          'selection_end': 6133L,
5340
+          'selection_start': 6122L},
5341
+         1484780742.038],
5342
+        [loc('PlayStream.py'),
5343
+         {'attrib-starts': [('ConfigScreen',
5344
+                             62),
5345
+                            ('ConfigScreen.ok',
5346
+                             109)],
5347
+          'first-line': 100L,
5348
+          'folded-linenos': [190L],
5349
+          'sel-line': 113L,
5350
+          'sel-line-start': 6151L,
5351
+          'selection_end': 6230L,
5352
+          'selection_start': 6219L},
5353
+         1484780744.713],
5354
+        [loc('PlayStream.py'),
5355
+         {'attrib-starts': [('ConfigScreen',
5356
+                             62),
5357
+                            ('ConfigScreen.ok',
5358
+                             109)],
5359
+          'first-line': 100L,
5360
+          'folded-linenos': [190L],
5361
+          'sel-line': 115L,
5362
+          'sel-line-start': 6460L,
5363
+          'selection_end': 6534L,
5364
+          'selection_start': 6523L},
5365
+         1484780745.163],
5366
+        [loc('PlayStream.py'),
5367
+         {'attrib-starts': [('MainScreen',
5368
+                             423),
5369
+                            ('MainScreen.cb_item_menu',
5370
+                             731)],
5371
+          'first-line': 753L,
5372
+          'folded-linenos': [190L],
5373
+          'sel-line': 774L,
5374
+          'sel-line-start': 34465L,
5375
+          'selection_end': 34544L,
5376
+          'selection_start': 34533L},
5377
+         1484780760.773],
5378
+        [loc('PlayStream.py'),
5319
          {'attrib-starts': [],
5379
          {'attrib-starts': [],
5320
-          'first-line': 428L,
5321
-          'folded-linenos': [],
5322
-          'sel-line': 449L,
5323
-          'sel-line-start': 21214L,
5324
-          'selection_end': 21230L,
5325
-          'selection_start': 21226L},
5326
-         1484608613.773],
5380
+          'first-line': 933L,
5381
+          'folded-linenos': [190L],
5382
+          'sel-line': 954L,
5383
+          'sel-line-start': 42167L,
5384
+          'selection_end': 42192L,
5385
+          'selection_start': 42181L},
5386
+         1484780762.115],
5327
         [loc('PlayStream.py'),
5387
         [loc('PlayStream.py'),
5328
-         {'attrib-starts': [('make_service',
5329
-                             54)],
5330
-          'first-line': 53L,
5331
-          'folded-linenos': [],
5332
-          'sel-line': 73L,
5333
-          'sel-line-start': 2951L,
5334
-          'selection_end': 2982L,
5335
-          'selection_start': 2982L},
5336
-         1484608795.724],
5337
-        [loc('sources/movieplace.py'),
5338
-         {'attrib-starts': [('Source',
5339
-                             23),
5340
-                            ('Source.__init__',
5341
-                             25)],
5342
-          'first-line': 6L,
5343
-          'folded-linenos': [],
5388
+         {'attrib-starts': [],
5389
+          'first-line': 933L,
5390
+          'folded-linenos': [190L],
5391
+          'sel-line': 954L,
5392
+          'sel-line-start': 42167L,
5393
+          'selection_end': 42211L,
5394
+          'selection_start': 42200L},
5395
+         1484780762.57],
5396
+        [loc('PlayStream.py'),
5397
+         {'attrib-starts': [('OptionsScreen',
5398
+                             958),
5399
+                            ('OptionsScreen.ok',
5400
+                             1009)],
5401
+          'first-line': 992L,
5402
+          'folded-linenos': [190L],
5403
+          'sel-line': 1013L,
5404
+          'sel-line-start': 45763L,
5405
+          'selection_end': 45834L,
5406
+          'selection_start': 45823L},
5407
+         1484780763.064],
5408
+        [loc('PlayStream.py'),
5409
+         {'attrib-starts': [],
5410
+          'first-line': 23L,
5411
+          'folded-linenos': [190L],
5344
           'sel-line': 28L,
5412
           'sel-line': 28L,
5345
-          'sel-line-start': 808L,
5346
-          'selection_end': 864L,
5347
-          'selection_start': 864L},
5348
-         1484645225.827],
5349
-        [loc('ContentSources.py'),
5350
-         {'attrib-starts': [('ContentSources',
5351
-                             15),
5352
-                            ('ContentSources.get_content',
5353
-                             48)],
5354
-          'first-line': 47L,
5355
-          'folded-linenos': [],
5356
-          'sel-line': 60L,
5357
-          'sel-line-start': 2605L,
5358
-          'selection_end': 2626L,
5359
-          'selection_start': 2626L},
5360
-         1484645249.28],
5361
-        [loc('sources/filmix.py'),
5362
-         {'attrib-starts': [('Source',
5363
-                             24),
5364
-                            ('Source.get_content',
5365
-                             49)],
5366
-          'first-line': 97L,
5367
-          'folded-linenos': [],
5368
-          'sel-line': 119L,
5369
-          'sel-line-start': 4772L,
5370
-          'selection_end': 4772L,
5371
-          'selection_start': 4772L},
5372
-         1484645274.974],
5373
-        [loc('util.py'),
5374
-         {'attrib-starts': [('play_video',
5375
-                             49)],
5376
-          'first-line': 58L,
5377
-          'folded-linenos': [],
5378
-          'sel-line': 71L,
5379
-          'sel-line-start': 1951L,
5380
-          'selection_end': 1951L,
5381
-          'selection_start': 1951L},
5382
-         1484645288.691],
5383
-        [loc('sources/filmix.py'),
5384
-         {'attrib-starts': [('Source',
5385
-                             24),
5386
-                            ('Source.get_content',
5387
-                             49)],
5388
-          'first-line': 70L,
5389
-          'folded-linenos': [],
5390
-          'sel-line': 75L,
5391
-          'sel-line-start': 2549L,
5392
-          'selection_end': 2549L,
5393
-          'selection_start': 2549L},
5394
-         1484681063.486],
5395
-        [loc('ContentSources.py'),
5396
-         {'attrib-starts': [('ContentSources',
5397
-                             14),
5398
-                            ('ContentSources.get_content',
5399
-                             47)],
5400
-          'first-line': 0L,
5401
-          'folded-linenos': [],
5402
-          'sel-line': 59L,
5403
-          'sel-line-start': 2432L,
5404
-          'selection_end': 2453L,
5405
-          'selection_start': 2453L},
5406
-         1484681485.732],
5407
-        [loc('sources/filmix.py'),
5408
-         {'attrib-starts': [('Source',
5409
-                             24),
5410
-                            ('Source.get_content',
5411
-                             49)],
5412
-          'first-line': 0L,
5413
-          'folded-linenos': [],
5414
-          'sel-line': 75L,
5415
-          'sel-line-start': 2549L,
5416
-          'selection_end': 2549L,
5417
-          'selection_start': 2549L},
5418
-         1484681490.881],
5419
-        [loc('ContentSources.py'),
5413
+          'sel-line-start': 1089L,
5414
+          'selection_end': 1113L,
5415
+          'selection_start': 1102L},
5416
+         1484780764.532],
5417
+        [loc('PlayStream.py'),
5418
+         {'attrib-starts': [],
5419
+          'first-line': 23L,
5420
+          'folded-linenos': [190L],
5421
+          'sel-line': 28L,
5422
+          'sel-line-start': 1089L,
5423
+          'selection_end': 1132L,
5424
+          'selection_start': 1121L},
5425
+         1484780765.415],
5426
+        [loc('PlayStream.py'),
5420
          {'attrib-starts': [],
5427
          {'attrib-starts': [],
5421
-          'first-line': 154L,
5422
-          'folded-linenos': [],
5423
-          'sel-line': 179L,
5424
-          'sel-line-start': 6128L,
5425
-          'selection_end': 6163L,
5426
-          'selection_start': 6163L},
5427
-         1484682345.643],
5428
-        [loc('sources/serialguru.py'),
5429
-         {'attrib-starts': [('Source',
5430
-                             21),
5431
-                            ('Source.get_content',
5432
-                             45)],
5433
-          'first-line': 151L,
5434
-          'folded-linenos': [],
5435
-          'sel-line': 165L,
5436
-          'sel-line-start': 9363L,
5437
-          'selection_end': 9363L,
5438
-          'selection_start': 9363L},
5439
-         1484682357.737],
5440
-        [loc('ContentSources.py'),
5428
+          'first-line': 31L,
5429
+          'folded-linenos': [190L],
5430
+          'sel-line': 52L,
5431
+          'sel-line-start': 2197L,
5432
+          'selection_end': 2221L,
5433
+          'selection_start': 2210L},
5434
+         1484780766.662],
5435
+        [loc('PlayStream.py'),
5441
          {'attrib-starts': [],
5436
          {'attrib-starts': [],
5442
-          'first-line': 176L,
5443
-          'folded-linenos': [],
5444
-          'sel-line': 198L,
5445
-          'sel-line-start': 6811L,
5446
-          'selection_end': 6811L,
5447
-          'selection_start': 6811L},
5448
-         1484683092.344],
5449
-        [loc('util.py'),
5450
-         {'attrib-starts': [('play_video',
5451
-                             49)],
5452
-          'first-line': 57L,
5453
-          'folded-linenos': [],
5454
-          'sel-line': 71L,
5455
-          'sel-line-start': 1951L,
5456
-          'selection_end': 1951L,
5457
-          'selection_start': 1951L},
5458
-         1484683112.755],
5459
-        [loc('ContentSources.py'),
5437
+          'first-line': 31L,
5438
+          'folded-linenos': [190L],
5439
+          'sel-line': 52L,
5440
+          'sel-line-start': 2197L,
5441
+          'selection_end': 2240L,
5442
+          'selection_start': 2229L},
5443
+         1484780767.334],
5444
+        [loc('PlayStream.py'),
5445
+         {'attrib-starts': [('ConfigScreen',
5446
+                             62),
5447
+                            ('ConfigScreen.ok',
5448
+                             109)],
5449
+          'first-line': 0L,
5450
+          'folded-linenos': [190L],
5451
+          'sel-line': 113L,
5452
+          'sel-line-start': 6151L,
5453
+          'selection_end': 6230L,
5454
+          'selection_start': 6219L},
5455
+         1484780976.305],
5456
+        [loc('PlayStream.py'),
5460
          {'attrib-starts': [],
5457
          {'attrib-starts': [],
5461
-          'first-line': 176L,
5462
-          'folded-linenos': [],
5463
-          'sel-line': 198L,
5464
-          'sel-line-start': 6811L,
5465
-          'selection_end': 6812L,
5466
-          'selection_start': 6812L},
5467
-         1484683129.526]],
5458
+          'first-line': 930L,
5459
+          'folded-linenos': [190L],
5460
+          'sel-line': 952L,
5461
+          'sel-line-start': 42018L,
5462
+          'selection_end': 42089L,
5463
+          'selection_start': 42074L},
5464
+         1484781120.258]],
5468
         20),
5465
         20),
5469
-        'current-loc': loc('ContentSources.py'),
5466
+        'current-loc': loc('PlayStream.py'),
5470
         'editor-state-list': [(loc('plugin.py'),
5467
         'editor-state-list': [(loc('plugin.py'),
5471
                                {'attrib-starts': [('main',
5468
                                {'attrib-starts': [('main',
5472
         4)],
5469
         4)],
5477
                                 'selection_end': 118L,
5474
                                 'selection_end': 118L,
5478
                                 'selection_start': 112L}),
5475
                                 'selection_start': 112L}),
5479
                               (loc('PlayStream.py'),
5476
                               (loc('PlayStream.py'),
5480
-                               {'attrib-starts': [('make_service',
5481
-        54)],
5482
-                                'first-line': 53L,
5483
-                                'folded-linenos': [],
5484
-                                'sel-line': 73L,
5485
-                                'sel-line-start': 2951L,
5486
-                                'selection_end': 2982L,
5487
-                                'selection_start': 2982L}),
5477
+                               {'attrib-starts': [('MainScreen',
5478
+        423),
5479
+        ('MainScreen.__init__',
5480
+         457)],
5481
+                                'first-line': 457L,
5482
+                                'folded-linenos': [190L],
5483
+                                'sel-line': 465L,
5484
+                                'sel-line-start': 21582L,
5485
+                                'selection_end': 21625L,
5486
+                                'selection_start': 21625L}),
5488
                               (loc('ContentSources.py'),
5487
                               (loc('ContentSources.py'),
5489
                                {'attrib-starts': [],
5488
                                {'attrib-starts': [],
5490
                                 'first-line': 0L,
5489
                                 'first-line': 0L,
5591
                                 'sel-line-start': 21214L,
5590
                                 'sel-line-start': 21214L,
5592
                                 'selection_end': 21230L,
5591
                                 'selection_end': 21230L,
5593
                                 'selection_start': 21226L})],
5592
                                 'selection_start': 21226L})],
5594
-        'has-focus': False,
5593
+        'has-focus': True,
5595
         'locked': False},
5594
         'locked': False},
5596
         [loc('plugin.py'),
5595
         [loc('plugin.py'),
5597
          loc('PlayStream.py'),
5596
          loc('PlayStream.py'),
5606
          loc('sources/SourceBase.py'),
5605
          loc('sources/SourceBase.py'),
5607
          loc('util.py'),
5606
          loc('util.py'),
5608
          loc('sources/viaplay.py')]),
5607
          loc('sources/viaplay.py')]),
5609
-                               'open_files': [u'PlayStream.py',
5610
-        u'playstreamproxy.py',
5608
+                               'open_files': [u'playstreamproxy.py',
5611
         u'plugin.py',
5609
         u'plugin.py',
5612
         u'resolver.py',
5610
         u'resolver.py',
5613
         u'resolvers/hqqresolver.py',
5611
         u'resolvers/hqqresolver.py',
5614
         u'sources/SourceBase.py',
5612
         u'sources/SourceBase.py',
5613
+        u'sources/filmix.py',
5615
         u'sources/iplayer.py',
5614
         u'sources/iplayer.py',
5616
         u'sources/movieplace.py',
5615
         u'sources/movieplace.py',
5617
         u'sources/replay.py',
5616
         u'sources/replay.py',
5618
         u'sources/viaplay.py',
5617
         u'sources/viaplay.py',
5619
-        u'sources/filmix.py',
5620
         u'util.py',
5618
         u'util.py',
5621
-        u'ContentSources.py']},
5619
+        u'ContentSources.py',
5620
+        u'PlayStream.py']},
5622
         'saved_notebook_display': None,
5621
         'saved_notebook_display': None,
5623
         'split_percents': {0: 0.3093198992443325},
5622
         'split_percents': {0: 0.3093198992443325},
5624
         'splits': 2,
5623
         'splits': 2,
5633
                          52,
5632
                          52,
5634
                          2408,
5633
                          2408,
5635
                          1390)}]}
5634
                          1390)}]}
5636
-guimgr.recent-documents = [loc('ContentSources.py'),
5635
+guimgr.recent-documents = [loc('PlayStream.py'),
5636
+                           loc('ContentSources.py'),
5637
                            loc('util.py'),
5637
                            loc('util.py'),
5638
                            loc('sources/filmix.py'),
5638
                            loc('sources/filmix.py'),
5639
                            loc('sources/movieplace.py'),
5639
                            loc('sources/movieplace.py'),
5640
-                           loc('PlayStream.py'),
5641
                            loc('sources/viaplay.py'),
5640
                            loc('sources/viaplay.py'),
5642
                            loc('resolver.py'),
5641
                            loc('resolver.py'),
5643
                            loc('resolvers/hqqresolver.py'),
5642
                            loc('resolvers/hqqresolver.py'),
6395
         'sel-line-start': 0L,
6394
         'sel-line-start': 0L,
6396
         'selection_end': 0L,
6395
         'selection_end': 0L,
6397
         'selection_start': 0L},
6396
         'selection_start': 0L},
6398
-                       loc('../../../../Python27/Lib/BaseHTTPServer.py'): {'a'\
6397
+                       loc('../../../../Python27/lib/BaseHTTPServer.py'): {'a'\
6399
         'ttrib-starts': [('BaseHTTPRequestHandler',
6398
         'ttrib-starts': [('BaseHTTPRequestHandler',
6400
                           113),
6399
                           113),
6401
                          ('BaseHTTPRequestHandler.handle_one_request',
6400
                          ('BaseHTTPRequestHandler.handle_one_request',
6406
         'sel-line-start': 12434,
6405
         'sel-line-start': 12434,
6407
         'selection_end': 12434,
6406
         'selection_end': 12434,
6408
         'selection_start': 12434},
6407
         'selection_start': 12434},
6409
-                       loc('../../../../Python27/Lib/base64.py'): {'attrib-s'\
6408
+                       loc('../../../../Python27/lib/base64.py'): {'attrib-s'\
6410
         'tarts': [('b64decode',
6409
         'tarts': [('b64decode',
6411
                    58)],
6410
                    58)],
6412
         'first-line': 54,
6411
         'first-line': 54,
6415
         'sel-line-start': 2478,
6414
         'sel-line-start': 2478,
6416
         'selection_end': 2478,
6415
         'selection_end': 2478,
6417
         'selection_start': 2478},
6416
         'selection_start': 2478},
6418
-                       loc('../../../../Python27/Lib/re.py'): {'attrib-start'\
6417
+                       loc('../../../../Python27/lib/re.py'): {'attrib-start'\
6419
         's': [('findall',
6418
         's': [('findall',
6420
                172)],
6419
                172)],
6421
         'first-line': 162,
6420
         'first-line': 162,
6424
         'sel-line-start': 8708,
6423
         'sel-line-start': 8708,
6425
         'selection_end': 8708,
6424
         'selection_end': 8708,
6426
         'selection_start': 8708},
6425
         'selection_start': 8708},
6427
-                       loc('../../../../Python27/Lib/site.py'): {'attrib-sta'\
6428
-        'rts': [('setquit',
6429
-                 333),
6430
-                ('setquit.Quitter',
6431
-                 347),
6432
-                ('setquit.Quitter.__call__',
6433
-                 352)],
6434
-        'first-line': 342,
6435
-        'folded-linenos': [],
6436
-        'sel-line': 359,
6437
-        'sel-line-start': 12399,
6438
-        'selection_end': 12399,
6439
-        'selection_start': 12399},
6440
                        loc('../../../../Python27/lib/site-packages/gi/__init__.py'): {'a'\
6426
                        loc('../../../../Python27/lib/site-packages/gi/__init__.py'): {'a'\
6441
         'ttrib-starts': [],
6427
         'ttrib-starts': [],
6442
         'first-line': 24,
6428
         'first-line': 24,
6475
         'sel-line': 55,
6461
         'sel-line': 55,
6476
         'sel-line-start': 2762,
6462
         'sel-line-start': 2762,
6477
         'selection_end': 2762,
6463
         'selection_end': 2762,
6478
-        'selection_start': 2762}}
6464
+        'selection_start': 2762},
6465
+                       loc('../../../../Python27/lib/site.py'): {'attrib-sta'\
6466
+        'rts': [('setquit',
6467
+                 333),
6468
+                ('setquit.Quitter',
6469
+                 347),
6470
+                ('setquit.Quitter.__call__',
6471
+                 352)],
6472
+        'first-line': 342,
6473
+        'folded-linenos': [],
6474
+        'sel-line': 359,
6475
+        'sel-line-start': 12399,
6476
+        'selection_end': 12399,
6477
+        'selection_start': 12399}}
6479
 proj.build-cmd = {None: ('default',
6478
 proj.build-cmd = {None: ('default',
6480
                          None)}
6479
                          None)}
6481
 proj.default-encoding = 'utf_8'
6480
 proj.default-encoding = 'utf_8'
6486
 proj.pypath = {None: ('custom',
6485
 proj.pypath = {None: ('custom',
6487
                       [u'c:\\Data\\Programming\\enigma2\\python',
6486
                       [u'c:\\Data\\Programming\\enigma2\\python',
6488
                        u''])}
6487
                        u''])}
6489
-search.replace-history = [u'movieplace',
6488
+search.replace-history = [u'config.pluginss.playstream.',
6489
+                          u'movieplace',
6490
                           u'https://filmix\\.me',
6490
                           u'https://filmix\\.me',
6491
                           u'https://filmix.me/',
6491
                           u'https://filmix.me/',
6492
                           u'filmix.me',
6492
                           u'filmix.me',
6493
                           u'self',
6493
                           u'self',
6494
                           u'current']
6494
                           u'current']
6495
-search.search-history = [u'urlp',
6495
+search.search-history = [u'yesno',
6496
+                         u'LocationBox',
6497
+                         u'TMPDIR',
6498
+                         u'def Canc',
6499
+                         u'ConfigSubDict',
6500
+                         u'config.plugins.playstream.',
6501
+                         u'config.pluginss.playstream.',
6502
+                         u'config.playstream.',
6503
+                         u'config.',
6504
+                         u'select_download_dir',
6505
+                         u'playstream',
6506
+                         u'tmpdir',
6507
+                         u'exit',
6508
+                         u'config.playstream.download_dir',
6509
+                         u'tmp',
6510
+                         u'urlp',
6496
                          u'88',
6511
                          u'88',
6497
                          u'localhost',
6512
                          u'localhost',
6498
                          u'stream = ',
6513
                          u'stream = ',
6499
-                         u'get_streams',
6500
-                         u'resolve',
6501
-                         u'util',
6502
-                         u'streamproxy_encode',
6503
-                         u'proxy',
6504
-                         u'make_service',
6505
-                         u'surl',
6506
-                         u'options_',
6507
-                         u'options_read',
6508
-                         u'options_screen',
6509
-                         u'options',
6510
-                         u'?',
6511
-                         u'play',
6512
-                         u'eServiceReference',
6513
-                         u'kinofilmnet',
6514
-                         u'_substi']
6514
+                         u'get_streams']
6515
 testing.stored-results = (1,
6515
 testing.stored-results = (1,
6516
                           [],
6516
                           [],
6517
                           {})
6517
                           {})

+ 8
- 3
changelog.md View File

1
+
2
+**0.5t** (19.01.2016):
3
+- Konfigurācijas logs, tmp folder uzdošana, opcija notīrīt tmp folderi pie iziešanas
4
+- Sīki labojumi
5
+
6
+**0.5s** (17.01.2016):
7
+- koda refaktorings/houskeepings
8
+
1
 **0.5p** (15.01.2016):
9
 **0.5p** (15.01.2016):
2
 - movieplace.lv saturs (daļēji, nav meklēšanas, seariālu, ne visi video hostingi,)
10
 - movieplace.lv saturs (daļēji, nav meklēšanas, seariālu, ne visi video hostingi,)
3
 - hqq hostētus strīmus spēlē ar stream_type=5002 (ja ir exteplayer3) + proxy, jo gstreamrim ir problēmas
11
 - hqq hostētus strīmus spēlē ar stream_type=5002 (ja ir exteplayer3) + proxy, jo gstreamrim ir problēmas
4
 - kodik, kapnob resolveri priekš movieplace.lv
12
 - kodik, kapnob resolveri priekš movieplace.lv
5
 - u.c. labojumi
13
 - u.c. labojumi
6
 
14
 
7
-**0.5s** (17.01.2016):
8
-- koda refaktorings/houskeepings
9
-
10
 **0.5n** (15.01.2016):
15
 **0.5n** (15.01.2016):
11
 - salabots filmix (tagad filmix.me)
16
 - salabots filmix (tagad filmix.me)
12
 - .ts strīmus spēlē ar service_type = 1 (nevis 4097)
17
 - .ts strīmus spēlē ar service_type = 1 (nevis 4097)

+ 0
- 3
resolver.py View File

52
     del module
52
     del module
53
 RESOLVERS = sorted(RESOLVERS, key=lambda m: -m.__priority__)
53
 RESOLVERS = sorted(RESOLVERS, key=lambda m: -m.__priority__)
54
 
54
 
55
-def item():
56
-    stream0 = {'name': '', 'url': '', 'quality': '???', 'surl': '', 'subs': '', 'headers': {},"desc":"","img":"","lang":"","type":"","order":0}
57
-    return stream0
58
 
55
 
59
 def resolve(url):
56
 def resolve(url):
60
     """
57
     """

+ 2
- 3
sources/SourceBase.py View File

11
 import requests
11
 import requests
12
 from collections import OrderedDict
12
 from collections import OrderedDict
13
 import ConfigParser
13
 import ConfigParser
14
+import util
14
 
15
 
15
 headers2dict = lambda  h: dict([l.strip().split(": ") for l in h.strip().splitlines()])
16
 headers2dict = lambda  h: dict([l.strip().split(": ") for l in h.strip().splitlines()])
16
-stream0 = {'name': '', 'url': '', 'quality': '???', 'surl': '', 'subs': '', 'headers': {},"desc":"","img":"","lang":"","type":"","order":0}
17
-
18
 
17
 
19
 class SourceBase(object):
18
 class SourceBase(object):
20
     """Stream source base class"""
19
     """Stream source base class"""
51
         if not self.is_video(data):
50
         if not self.is_video(data):
52
             return []
51
             return []
53
         content = self.get_content(data)
52
         content = self.get_content(data)
54
-        stream = stream0
53
+        stream = util.item()
55
         stream["name"] = content[0].encode("utf8") if isinstance(content[0],unicode) else content[0]
54
         stream["name"] = content[0].encode("utf8") if isinstance(content[0],unicode) else content[0]
56
         stream["url"] = content[1].encode("utf8") if isinstance(content[1],unicode) else content[1]
55
         stream["url"] = content[1].encode("utf8") if isinstance(content[1],unicode) else content[1]
57
         stream["img"] = content[2].encode("utf8") if isinstance(content[2],unicode) else content[2]
56
         stream["img"] = content[2].encode("utf8") if isinstance(content[2],unicode) else content[2]

+ 1
- 1
sources/ltc.py View File

13
 import HTMLParser
13
 import HTMLParser
14
 import json
14
 import json
15
 import datetime
15
 import datetime
16
-from SourceBase import SourceBase, stream_type, stream0
16
+from SourceBase import SourceBase, stream_type
17
 import util
17
 import util
18
 from collections import OrderedDict
18
 from collections import OrderedDict
19
 
19
 

+ 51
- 50
sources/replay.py View File

13
 import urllib2, urllib
13
 import urllib2, urllib
14
 import datetime, re, sys
14
 import datetime, re, sys
15
 from SourceBase import SourceBase
15
 from SourceBase import SourceBase
16
+import util
16
 
17
 
17
 API_URL = 'http://replay.lsm.lv/%s/'
18
 API_URL = 'http://replay.lsm.lv/%s/'
18
 headers2dict = lambda  h: dict([l.strip().split(": ") for l in h.strip().splitlines()])
19
 headers2dict = lambda  h: dict([l.strip().split(": ") for l in h.strip().splitlines()])
22
 import HTMLParser
23
 import HTMLParser
23
 h = HTMLParser.HTMLParser()
24
 h = HTMLParser.HTMLParser()
24
 from YouTubeVideoUrl import YouTubeVideoUrl
25
 from YouTubeVideoUrl import YouTubeVideoUrl
25
-    
26
+
26
 class Source(SourceBase):
27
 class Source(SourceBase):
27
-    
28
+
28
     def __init__(self,country="lv"):
29
     def __init__(self,country="lv"):
29
         self.name = "replay"
30
         self.name = "replay"
30
         self.title = "Replay.lv (LTV)"
31
         self.title = "Replay.lv (LTV)"
31
         self.img = "http://replay.lsm.lv/apple-touch-icon.png"
32
         self.img = "http://replay.lsm.lv/apple-touch-icon.png"
32
         self.desc = "LSM replay.lv satura skatīšanās"
33
         self.desc = "LSM replay.lv satura skatīšanās"
33
-        
34
+
34
         self.country=country
35
         self.country=country
35
         self.pic_size = "327x250" #"1000x765"
36
         self.pic_size = "327x250" #"1000x765"
36
-        
37
+
37
     def get_content(self, data):
38
     def get_content(self, data):
38
         print "[replay] get_content:", data
39
         print "[replay] get_content:", data
39
         if "::" in data:
40
         if "::" in data:
40
-            data = data.split("::")[1] 
41
+            data = data.split("::")[1]
41
         path = data.split("?")[0]
42
         path = data.split("?")[0]
42
         clist = path.split("/")[0]
43
         clist = path.split("/")[0]
43
         params = data[data.find("?"):] if "?" in data else ""
44
         params = data[data.find("?"):] if "?" in data else ""
44
         qs = dict(map(lambda x:x.split("="),re.findall("\w+=\w+",params)))
45
         qs = dict(map(lambda x:x.split("="),re.findall("\w+=\w+",params)))
45
         lang = qs["lang"] if "lang" in qs else self.country
46
         lang = qs["lang"] if "lang" in qs else self.country
46
-    
47
+
47
         content=[]
48
         content=[]
48
         content.append(("..return", "back","","Return back"))
49
         content.append(("..return", "back","","Return back"))
49
-        
50
+
50
         if clist=="home":
51
         if clist=="home":
51
             content.extend([
52
             content.extend([
52
                 ("Live streams", "replay::tiesraide","","TV live streams"),
53
                 ("Live streams", "replay::tiesraide","","TV live streams"),
53
-                ("Search LV", "replay::search/?term={0}&lang=lv","","Search content LV"),                
54
+                ("Search LV", "replay::search/?term={0}&lang=lv","","Search content LV"),
54
                 ("Last videos LV", "replay::visi/jaunakie/?source=ltv&lang=lv","","Last aired videos LV"),
55
                 ("Last videos LV", "replay::visi/jaunakie/?source=ltv&lang=lv","","Last aired videos LV"),
55
-                ("Last videos by categories LV", "replay::kategorijas/?lang=lv","","Last videos by categories LV"),                
56
+                ("Last videos by categories LV", "replay::kategorijas/?lang=lv","","Last videos by categories LV"),
56
                 ("All programs LV", "replay::raidijumi/?type=video","","All programs by name LV"),
57
                 ("All programs LV", "replay::raidijumi/?type=video","","All programs by name LV"),
57
                 ("Programs by categories LV", "replay::categories?lang=lv","","All programs by categories LV"),
58
                 ("Programs by categories LV", "replay::categories?lang=lv","","All programs by categories LV"),
58
                 #("Channels", "replay::channels?language=%s"%self.country,"","TV channels"),
59
                 #("Channels", "replay::channels?language=%s"%self.country,"","TV channels"),
59
-                ("Videos by popularity LV", "replay::visi/popularie/?source=ltv&lang=lv","","Programs by popularity"), 
60
-                
61
-                ("Search RU", "replay::search/?term={0}&lang=ru","","Search content RU"),                
60
+                ("Videos by popularity LV", "replay::visi/popularie/?source=ltv&lang=lv","","Programs by popularity"),
61
+
62
+                ("Search RU", "replay::search/?term={0}&lang=ru","","Search content RU"),
62
                 ("Last videos RU", "replay::vse/novie/?source=ltv&lang=ru","","Last aired videos RU"),
63
                 ("Last videos RU", "replay::vse/novie/?source=ltv&lang=ru","","Last aired videos RU"),
63
-                ("Last videos by categories RU", "replay::kategorijas/?lang=ru","","Last videos by categories RU"),                                
64
-                ("All programs RU", "replay::peredachi/?lang=ru&type=video","","All programs by name"),         
64
+                ("Last videos by categories RU", "replay::kategorijas/?lang=ru","","Last videos by categories RU"),
65
+                ("All programs RU", "replay::peredachi/?lang=ru&type=video","","All programs by name"),
65
                 ("Programs by categories RU", "replay::categories?lang=ru","","Programs by categories RU")
66
                 ("Programs by categories RU", "replay::categories?lang=ru","","Programs by categories RU")
66
             ])
67
             ])
67
             return content
68
             return content
68
-        
69
+
69
         ### programmu kategorijas ###
70
         ### programmu kategorijas ###
70
         elif clist=="categories":
71
         elif clist=="categories":
71
-            url = "http://replay.lsm.lv/lv/raidijumi/?lang=lv&type=video" if lang =="lv" else "http://replay.lsm.lv/ru/peredachi/?lang=ru&type=video"        
72
+            url = "http://replay.lsm.lv/lv/raidijumi/?lang=lv&type=video" if lang =="lv" else "http://replay.lsm.lv/ru/peredachi/?lang=ru&type=video"
72
             r = self._http_request(url)
73
             r = self._http_request(url)
73
             for item in re.findall(r'<a .+href="(\?lang=\w+&type=video&theme=\d+)">([^<]+)</a>\t', r):
74
             for item in re.findall(r'<a .+href="(\?lang=\w+&type=video&theme=\d+)">([^<]+)</a>\t', r):
74
                 title = item[1]
75
                 title = item[1]
78
                 desc = title
79
                 desc = title
79
                 content.append((title,self.name+"::"+data2,img,desc))
80
                 content.append((title,self.name+"::"+data2,img,desc))
80
             return content
81
             return content
81
-        
82
+
82
         ### jaunāko raidijumu kategorijas ###
83
         ### jaunāko raidijumu kategorijas ###
83
         elif clist=="kategorijas":
84
         elif clist=="kategorijas":
84
-            url = "http://replay.lsm.lv/lv/" if lang =="lv" else "http://replay.lsm.lv/ru/"        
85
+            url = "http://replay.lsm.lv/lv/" if lang =="lv" else "http://replay.lsm.lv/ru/"
85
             r = self._http_request(url)
86
             r = self._http_request(url)
86
             for item in re.findall(r'<a href="/(lv|ru)/kategorija/(\w+)/">.+?<i class="[^"]+"></i>.+?<span>([^<]+)</span>', r, re.DOTALL):
87
             for item in re.findall(r'<a href="/(lv|ru)/kategorija/(\w+)/">.+?<i class="[^"]+"></i>.+?<span>([^<]+)</span>', r, re.DOTALL):
87
                 title = item[2]
88
                 title = item[2]
90
                 desc = title
91
                 desc = title
91
                 content.append((title,self.name+"::"+data2,img,desc))
92
                 content.append((title,self.name+"::"+data2,img,desc))
92
             return content
93
             return content
93
-        
94
+
94
         ### Tiešraides kanānālu saraksts
95
         ### Tiešraides kanānālu saraksts
95
         elif path=="tiesraide":
96
         elif path=="tiesraide":
96
             url = "http://replay.lsm.lv/styles/main.css"
97
             url = "http://replay.lsm.lv/styles/main.css"
104
                 desc = title+" tiesraide (%s)"%veids
105
                 desc = title+" tiesraide (%s)"%veids
105
                 content.append((title,self.name+"::"+data2,img,desc))
106
                 content.append((title,self.name+"::"+data2,img,desc))
106
             return content
107
             return content
107
-        
108
+
108
         ### Kanāla tiesraide
109
         ### Kanāla tiesraide
109
         elif clist == "tiesraide" and "/" in data:
110
         elif clist == "tiesraide" and "/" in data:
110
             ch = data.split('/')[1]
111
             ch = data.split('/')[1]
111
-            veids = "video" if "tv" in ch else "audio"           
112
+            veids = "video" if "tv" in ch else "audio"
112
             #url = "http://replay.lsm.lv/lv/tiesraide/ltv7/"
113
             #url = "http://replay.lsm.lv/lv/tiesraide/ltv7/"
113
             url = "http://replay.lsm.lv/lv/tiesraide/%s/"%ch
114
             url = "http://replay.lsm.lv/lv/tiesraide/%s/"%ch
114
             r= self._http_request(url)
115
             r= self._http_request(url)
115
-            
116
+
116
             m = re.search('%s/">.+?<h5>([^<]+)+</h5>.*?<time>([^<]+)</time>'%ch, r, re.DOTALL)
117
             m = re.search('%s/">.+?<h5>([^<]+)+</h5>.*?<time>([^<]+)</time>'%ch, r, re.DOTALL)
117
             tagad = m.group(1).strip() if m else ""
118
             tagad = m.group(1).strip() if m else ""
118
             laiks = m.group(2).strip() if m else ""
119
             laiks = m.group(2).strip() if m else ""
120
             m = re.search("<h1>([^<]+)</h1>", r)
121
             m = re.search("<h1>([^<]+)</h1>", r)
121
             title = m.group(1).strip() if m else path.split("/")[1].upper()
122
             title = m.group(1).strip() if m else path.split("/")[1].upper()
122
             title = "%s - %s (%s)"%(title,tagad,laiks)
123
             title = "%s - %s (%s)"%(title,tagad,laiks)
123
-            
124
+
124
             if veids == "video":
125
             if veids == "video":
125
                 m = re.search('<div class="video"><iframe.+src="([^"]+)"', r)
126
                 m = re.search('<div class="video"><iframe.+src="([^"]+)"', r)
126
-                if not m: 
127
+                if not m:
127
                     content=("No stream found %s"%data,"","","No stream found")
128
                     content=("No stream found %s"%data,"","","No stream found")
128
-                    return content           
129
+                    return content
129
                 url = m.group(1)
130
                 url = m.group(1)
130
                 headers = headers2dict("""
131
                 headers = headers2dict("""
131
             User-Agent: Mozilla/5.0 (Linux; U; Android 4.4.4; Nexus 5 Build/KTU84P) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
132
             User-Agent: Mozilla/5.0 (Linux; U; Android 4.4.4; Nexus 5 Build/KTU84P) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
132
             Referer: http://replay.lsm.lv/lv/ieraksts/ltv/70398/tiesa-runa.-lielbritanija-gatavojas-referendumam-par-tu/
133
             Referer: http://replay.lsm.lv/lv/ieraksts/ltv/70398/tiesa-runa.-lielbritanija-gatavojas-referendumam-par-tu/
133
                     """)
134
                     """)
134
                 r = self._http_request(url,headers=headers)
135
                 r = self._http_request(url,headers=headers)
135
-            
136
+
136
                 m = re.search('<div class="video-player"><iframe.+src="([^"]+)"', r)
137
                 m = re.search('<div class="video-player"><iframe.+src="([^"]+)"', r)
137
                 if not m:
138
                 if not m:
138
                     content=("No stream found %s"%data,"","","No stream found")
139
                     content=("No stream found %s"%data,"","","No stream found")
139
                     return content
140
                     return content
140
                 url = m.group(1)
141
                 url = m.group(1)
141
-                            
142
+
142
                 r = self._http_request(url,headers=headers)
143
                 r = self._http_request(url,headers=headers)
143
                 m = re.search('"([^"]+m3u8[^"]+)"', r)
144
                 m = re.search('"([^"]+m3u8[^"]+)"', r)
144
                 if not m:
145
                 if not m:
145
                     content=("No stream found %s"%data,"","","No stream found")
146
                     content=("No stream found %s"%data,"","","No stream found")
146
-                    return content           
147
+                    return content
147
                 data2 = m.group(1).replace("\\","")
148
                 data2 = m.group(1).replace("\\","")
148
-                
149
+
149
             else: # audio
150
             else: # audio
150
                 lrn = ch.replace("lr","")
151
                 lrn = ch.replace("lr","")
151
                 url = "http://www.latvijasradio.lsm.lv/lv/tiesraide/?channel=%s"%lrn
152
                 url = "http://www.latvijasradio.lsm.lv/lv/tiesraide/?channel=%s"%lrn
153
                 m = re.search('"file":"([^"]+?m3u8.*?)"', r)
154
                 m = re.search('"file":"([^"]+?m3u8.*?)"', r)
154
                 if not m:
155
                 if not m:
155
                     content=("No stream found %s"%data,"","","No stream found")
156
                     content=("No stream found %s"%data,"","","No stream found")
156
-                    return content           
157
+                    return content
157
                 data2 = m.group(1).replace("\\","")
158
                 data2 = m.group(1).replace("\\","")
158
-                
159
+
159
             img = ""
160
             img = ""
160
             desc = ""
161
             desc = ""
161
             content =(title,data2,img,desc)
162
             content =(title,data2,img,desc)
162
-            return content           
163
-                       
163
+            return content
164
+
164
         #m = re.search(r'(\?page=\d+)" class=" paging__prev', r, re.IGNORECASE)
165
         #m = re.search(r'(\?page=\d+)" class=" paging__prev', r, re.IGNORECASE)
165
         #if m:
166
         #if m:
166
         #    data = re.sub("\?page=\d+", "", data)
167
         #    data = re.sub("\?page=\d+", "", data)
167
         #    data2 = data+m.group(1)
168
         #    data2 = data+m.group(1)
168
-        #    content.append(("Previous page",self.name+"::"+data2,"","Previous page"))                            
169
-        
169
+        #    content.append(("Previous page",self.name+"::"+data2,"","Previous page"))
170
+
170
         r = self.call(data, lang=lang)
171
         r = self.call(data, lang=lang)
171
         if not r:
172
         if not r:
172
             return content
173
             return content
173
-        
174
+
174
         if clist == "search":
175
         if clist == "search":
175
             #for r2 in re.findall('<article itemtype="http://schema.org/Article" itemscope class="thumbnail thumbnail--default ">(.+?)</article>', r2, re.DOTALL):
176
             #for r2 in re.findall('<article itemtype="http://schema.org/Article" itemscope class="thumbnail thumbnail--default ">(.+?)</article>', r2, re.DOTALL):
176
             for item in re.findall('itemprop="image" data-image="([^"]+)".+?<figcaption><h5 itemprop="name"><a itemprop="url" href="([^<]+)">([^<]+)</a></h5></figcaption>', r):
177
             for item in re.findall('itemprop="image" data-image="([^"]+)".+?<figcaption><h5 itemprop="name"><a itemprop="url" href="([^<]+)">([^<]+)</a></h5></figcaption>', r):
179
                 img = "http://replay.lsm.lv" + item[0]
180
                 img = "http://replay.lsm.lv" + item[0]
180
                 desc  = title
181
                 desc  = title
181
                 content.append((title,self.name+"::"+data2,img,desc))
182
                 content.append((title,self.name+"::"+data2,img,desc))
182
-                
183
+
183
             #for item in re.findall('itemprop="image" data-image="([^"]+)".+?<figcaption><h4 itemprop="about"><a href="([^"]+)">([^<]+)</a></h4>.*?<h5 itemprop="name"><a itemprop="url" href="([^"]+)">([^<]+)</a></h5>.+?datetime="([^"]+)" class="thumbnail__date ">([^<]+)</time>', r2):
184
             #for item in re.findall('itemprop="image" data-image="([^"]+)".+?<figcaption><h4 itemprop="about"><a href="([^"]+)">([^<]+)</a></h4>.*?<h5 itemprop="name"><a itemprop="url" href="([^"]+)">([^<]+)</a></h5>.+?datetime="([^"]+)" class="thumbnail__date ">([^<]+)</time>', r2):
184
-            for item in re.findall('itemprop="image" data-image="([^"]+)".+? class="icon-(ltv|lr).+?<figcaption><h4 itemprop="about"><a href="([^"]+)">([^<]+)</a></h4>.*?<h5 itemprop="name"><a itemprop="url" href="([^"]+)">([^<]+)</a></h5>.+?datetime="([^"]+)" class="thumbnail__date ">([^<]+)</time>', r):  
185
+            for item in re.findall('itemprop="image" data-image="([^"]+)".+? class="icon-(ltv|lr).+?<figcaption><h4 itemprop="about"><a href="([^"]+)">([^<]+)</a></h4>.*?<h5 itemprop="name"><a itemprop="url" href="([^"]+)">([^<]+)</a></h5>.+?datetime="([^"]+)" class="thumbnail__date ">([^<]+)</time>', r):
185
                 if item[1]=="lr":continue
186
                 if item[1]=="lr":continue
186
                 title = "%s - %s (%s)"%(item[3],item[5],item[7])
187
                 title = "%s - %s (%s)"%(item[3],item[5],item[7])
187
                 data2 = item[4].replace("/%s/"%lang,"")+"?lang=%s"%lang
188
                 data2 = item[4].replace("/%s/"%lang,"")+"?lang=%s"%lang
188
                 img = item[0].replace("https:","http:")
189
                 img = item[0].replace("https:","http:")
189
                 desc = title
190
                 desc = title
190
                 content.append((title,self.name+"::"+data2,img,desc))
191
                 content.append((title,self.name+"::"+data2,img,desc))
191
-    
192
+
192
         ### Raidijumi (programmas) ###
193
         ### Raidijumi (programmas) ###
193
         elif clist in ( "raidijumi","peredachi"):
194
         elif clist in ( "raidijumi","peredachi"):
194
             for item in re.findall('<li itemprop="name"><a href="([^"]+)" itemprop="url">([^<]+)', r):
195
             for item in re.findall('<li itemprop="name"><a href="([^"]+)" itemprop="url">([^<]+)', r):
198
                 img = ""
199
                 img = ""
199
                 desc  = ""
200
                 desc  = ""
200
                 content.append((title,self.name+"::"+data2,img,desc))
201
                 content.append((title,self.name+"::"+data2,img,desc))
201
-                 
202
+
202
         ### Raidijuma ieraksti speciālie###
203
         ### Raidijuma ieraksti speciālie###
203
         elif clist in ( "visi","vse",):
204
         elif clist in ( "visi","vse",):
204
             for item in re.findall('(?i)<figure><a href="([^"]+)" itemprop="image" data-image="([^"]+)".+class="thumbnail__duration">([^<]+)</time></figure><figcaption><h4 itemprop="about"><a href="[^"]+">([^<]+)</a></h4>.+>([^<]+).*</h5>.+>([^<]+)</time></figcaption>', r):
205
             for item in re.findall('(?i)<figure><a href="([^"]+)" itemprop="image" data-image="([^"]+)".+class="thumbnail__duration">([^<]+)</time></figure><figcaption><h4 itemprop="about"><a href="[^"]+">([^<]+)</a></h4>.+>([^<]+).*</h5>.+>([^<]+)</time></figcaption>', r):
207
                 img = item[1].replace("https:","http:")
208
                 img = item[1].replace("https:","http:")
208
                 desc  = "%s - %s\n%s"%(item[5],item[2],item[4])
209
                 desc  = "%s - %s\n%s"%(item[5],item[2],item[4])
209
                 content.append((title,self.name+"::"+data2,img,desc))
210
                 content.append((title,self.name+"::"+data2,img,desc))
210
-                
211
+
211
         ### Raidijuma ieraksti (videos)
212
         ### Raidijuma ieraksti (videos)
212
-        elif clist in ("raidijums","peredacha","kategorija"): 
213
+        elif clist in ("raidijums","peredacha","kategorija"):
213
             for item in re.findall('<article .+ href="([^"]+)".+image="([^"]+)".+class="thumbnail__duration">([^<]+).+">([^<]+).+class="thumbnail__date ">([^"]+)</time></figcaption></article>', r):
214
             for item in re.findall('<article .+ href="([^"]+)".+image="([^"]+)".+class="thumbnail__duration">([^<]+).+">([^<]+).+class="thumbnail__date ">([^"]+)</time></figcaption></article>', r):
214
                 title = item[3]
215
                 title = item[3]
215
                 data2 = item[0].replace("/%s/"%lang,"")+"?lang=%s"%lang
216
                 data2 = item[0].replace("/%s/"%lang,"")+"?lang=%s"%lang
216
                 img = item[1].replace("https:","http:")
217
                 img = item[1].replace("https:","http:")
217
                 desc = "%s - %s"%(item[4],item[2])
218
                 desc = "%s - %s"%(item[4],item[2])
218
                 content.append((title,self.name+"::"+data2,img,desc))
219
                 content.append((title,self.name+"::"+data2,img,desc))
219
-        
220
+
220
         ### Ieraksts (video) ###
221
         ### Ieraksts (video) ###
221
         elif clist in ("ieraksts","statja"):
222
         elif clist in ("ieraksts","statja"):
222
             m = re.search('src="([^"]+)"></iframe>', r)
223
             m = re.search('src="([^"]+)"></iframe>', r)
230
                 m = re.search('"file":"([^"]+)', r2)
231
                 m = re.search('"file":"([^"]+)', r2)
231
                 if m:
232
                 if m:
232
                     data2 = m.group(1).replace("\\","")
233
                     data2 = m.group(1).replace("\\","")
233
-                    m = re.search('"idstring":"([^"]+)', r2)                    
234
+                    m = re.search('"idstring":"([^"]+)', r2)
234
                     title = m.group(1) if m else ""
235
                     title = m.group(1) if m else ""
235
                     title = title.decode("unicode-escape").encode("utf8")
236
                     title = title.decode("unicode-escape").encode("utf8")
236
                     title = title.replace("\n","")
237
                     title = title.replace("\n","")
241
                         data2 = YouTubeVideoUrl().extract(video_id)
242
                         data2 = YouTubeVideoUrl().extract(video_id)
242
                         if not data2:
243
                         if not data2:
243
                             content=("No stream found %s"%data,"","","No stream found")
244
                             content=("No stream found %s"%data,"","","No stream found")
244
-                            return content                           
245
+                            return content
245
                     content =(title,data2,img,desc)
246
                     content =(title,data2,img,desc)
246
                     return content
247
                     return content
247
             content=("No stream found %s"%data,"","","No stream found")
248
             content=("No stream found %s"%data,"","","No stream found")
248
             return content
249
             return content
249
-                
250
+
250
         m = re.search(r'href="\?([^"]+)" class=" paging__next', r)
251
         m = re.search(r'href="\?([^"]+)" class=" paging__next', r)
251
         if m:
252
         if m:
252
             page = int(re.search("page=(\d+)",m.group(1)).group(1))
253
             page = int(re.search("page=(\d+)",m.group(1)).group(1))
257
                     data2 =data+"&page=%i"%page
258
                     data2 =data+"&page=%i"%page
258
                 else:
259
                 else:
259
                     data2 =data+"?page=%i"%page
260
                     data2 =data+"?page=%i"%page
260
-            content.append(("Next page",self.name+"::"+data2,"","Next page"))                            
261
-                
261
+            content.append(("Next page",self.name+"::"+data2,"","Next page"))
262
+
262
         return content
263
         return content
263
-    
264
+
264
     def is_video(self,data):
265
     def is_video(self,data):
265
         if "::" in data:
266
         if "::" in data:
266
             data = data.split("::")[1]
267
             data = data.split("::")[1]
271
             return True
272
             return True
272
         else:
273
         else:
273
             return False
274
             return False
274
-    
275
+
275
     def call(self, data,headers=headers0,lang=""):
276
     def call(self, data,headers=headers0,lang=""):
276
         if not lang: lang = self.country
277
         if not lang: lang = self.country
277
         url = API_URL%lang + data
278
         url = API_URL%lang + data