Browse Source

salabots ltc

Ivars 7 years ago
parent
commit
51b2062dc9
3 changed files with 440 additions and 416 deletions
  1. 382
    359
      project.wpr
  2. 15
    9
      run.py
  3. 43
    48
      sources/ltc.py

+ 382
- 359
project.wpr
File diff suppressed because it is too large
View File


+ 15
- 9
run.py View File

83
         frame3 = Frame(self, height=40)
83
         frame3 = Frame(self, height=40)
84
         frame3.pack(side=TOP, fill=X, padx=15)
84
         frame3.pack(side=TOP, fill=X, padx=15)
85
         self.b_select = Button(frame3, text="Select",
85
         self.b_select = Button(frame3, text="Select",
86
-                              command=lambda :self.list_action(None, "Return"), width=10)
86
+                               command=lambda :self.list_action(None, "Return"), width=10)
87
         self.b_select.pack(side=LEFT, anchor=S)
87
         self.b_select.pack(side=LEFT, anchor=S)
88
 
88
 
89
         self.b_back = Button(frame3, text="Back",
89
         self.b_back = Button(frame3, text="Back",
90
-                                   command=lambda :self.list_action(None, "Escape"), width=10)
90
+                             command=lambda :self.list_action(None, "Escape"), width=10)
91
         self.b_back.pack(side=LEFT, anchor=S)
91
         self.b_back.pack(side=LEFT, anchor=S)
92
 
92
 
93
         self.b_options = Button(frame3, text="Options",
93
         self.b_options = Button(frame3, text="Options",
94
-                                 command=lambda :self.list_action(None, "Options"), width=10)
94
+                                command=lambda :self.list_action(None, "Options"), width=10)
95
         self.b_options.pack(side=LEFT, anchor=S)
95
         self.b_options.pack(side=LEFT, anchor=S)
96
 
96
 
97
         self.b_config = Button(frame3, text="Config",
97
         self.b_config = Button(frame3, text="Config",
98
-                                 command=lambda :self.list_action(None, "Config"), width=10)
98
+                               command=lambda :self.list_action(None, "Config"), width=10)
99
         self.b_config.pack(side=LEFT, anchor=S)
99
         self.b_config.pack(side=LEFT, anchor=S)
100
 
100
 
101
         self.b_exit = Button(frame3, text="Exit",
101
         self.b_exit = Button(frame3, text="Exit",
102
-                            command=self.quit, width=10)
102
+                             command=self.quit, width=10)
103
         self.b_exit.pack(side=LEFT, anchor=S)
103
         self.b_exit.pack(side=LEFT, anchor=S)
104
 
104
 
105
 
105
 
231
                 else:
231
                 else:
232
                     im = None
232
                     im = None
233
         if im:
233
         if im:
234
-            im.thumbnail((400, 250))
234
+            try:
235
+                im.thumbnail((400, 250))
236
+            except Exception as e:
237
+                print "Image convert error"
235
             image = ImageTk.PhotoImage(im)
238
             image = ImageTk.PhotoImage(im)
236
             imagesprite = self.pic.create_image(200, 125,image=image)
239
             imagesprite = self.pic.create_image(200, 125,image=image)
237
             self.pic.image = image
240
             self.pic.image = image
403
                     else:
406
                     else:
404
                         im = None
407
                         im = None
405
             if im:
408
             if im:
406
-                im.thumbnail((400, 400))
409
+                try:
410
+                    im.thumbnail((400, 400))
411
+                except:
412
+                    print "Image convert error"
407
                 image = ImageTk.PhotoImage(im)
413
                 image = ImageTk.PhotoImage(im)
408
                 imagesprite = self.pic.create_image(200, 200,image=image)
414
                 imagesprite = self.pic.create_image(200, 200,image=image)
409
                 self.pic.image = image
415
                 self.pic.image = image
679
     # encode(sys.getfilesystemencoding())
685
     # encode(sys.getfilesystemencoding())
680
     subfile = unicode(subfile).encode(sys.getfilesystemencoding())
686
     subfile = unicode(subfile).encode(sys.getfilesystemencoding())
681
     cmd1 = [r"c:\Program Files\VideoLAN\VLC\vlc.exe",url,
687
     cmd1 = [r"c:\Program Files\VideoLAN\VLC\vlc.exe",url,
682
-           "--meta-title",title,
688
+            "--meta-title",title,
683
            "--http-user-agent","Enigma2"
689
            "--http-user-agent","Enigma2"
684
-    ]
690
+           ]
685
     # gst-launch-1.0 -v souphttpsrc ssl-strict=false proxy=127.0.0.1:8888 extra-headers="Origin:adadadasd"  location="http://bitdash-a.akamaihd.net/content/sintel/sintel.mpd" ! decodebin! autovideosink
691
     # gst-launch-1.0 -v souphttpsrc ssl-strict=false proxy=127.0.0.1:8888 extra-headers="Origin:adadadasd"  location="http://bitdash-a.akamaihd.net/content/sintel/sintel.mpd" ! decodebin! autovideosink
686
     cmd2 = [
692
     cmd2 = [
687
         r"C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0",
693
         r"C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0",

+ 43
- 48
sources/ltc.py View File

35
         self.desc = "Shortcut.lv (lattelecom.tv) satura skatīšanās"
35
         self.desc = "Shortcut.lv (lattelecom.tv) satura skatīšanās"
36
 
36
 
37
         self.token = "" # manstv.lattelecom.tv
37
         self.token = "" # manstv.lattelecom.tv
38
-        self.session_id = ""  # www.lattelecom.tv
38
+        self.session_id = ""  # www.shortcut.lv
39
         self.api_url = "https://manstv.lattelecom.tv/api/v1.4/get/"
39
         self.api_url = "https://manstv.lattelecom.tv/api/v1.4/get/"
40
-        self.api_url2 = "https://www.lattelecom.tv/"
40
+        self.api_url2 = "https://www.shortcut.lv/"
41
         self.headers = headers2dict("""
41
         self.headers = headers2dict("""
42
 User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; SM-G900FD Build/KOT49H)
42
 User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; SM-G900FD Build/KOT49H)
43
 Host: manstv.lattelecom.tv
43
 Host: manstv.lattelecom.tv
44
 Connection: Keep-Alive
44
 Connection: Keep-Alive
45
         """)
45
         """)
46
         self.headers2 = headers2dict("""
46
         self.headers2 = headers2dict("""
47
-Host: www.lattelecom.tv
48
 Connection: keep-alive
47
 Connection: keep-alive
49
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
48
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
50
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
49
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
106
                     if not item[1]:
105
                     if not item[1]:
107
                         title = title + "[P]"
106
                         title = title + "[P]"
108
                     data2 = item[0][0:-1]
107
                     data2 = item[0][0:-1]
109
-                    img = "https://www.lattelecom.tv" + item[2]
108
+                    img = "https://www.shortcut.lv" + item[2]
110
                     desc = title
109
                     desc = title
111
                     content.append((title,self.name+"::"+data2,img,desc))
110
                     content.append((title,self.name+"::"+data2,img,desc))
112
                 return content
111
                 return content
133
                 if item["xprs_id"] in js:
132
                 if item["xprs_id"] in js:
134
                     epg = js[item["xprs_id"]]
133
                     epg = js[item["xprs_id"]]
135
                     desc = "%s - %s (%s-%s)"%(title,epg[0]["t"],epg[0]["hs"],epg[0]["he"])
134
                     desc = "%s - %s (%s-%s)"%(title,epg[0]["t"],epg[0]["hs"],epg[0]["he"])
136
-                    #img = "https://www.lattelecom.tv" + epg[0]["p"]
137
-                    img = "https://manstv.lattelecom.tv/"+ item['broadcast_default_picture']
135
+                    #img = "https://www.shortcut.lv" + epg[0]["p"]
136
+                    img = "https://manstv.shortcut.lv/"+ item['broadcast_default_picture']
138
                 else:
137
                 else:
139
-                    img = "https://manstv.lattelecom.tv/"+ item['broadcast_default_picture']
138
+                    img = "https://manstv.shortcut.lv/"+ item['broadcast_default_picture']
140
                     desc = title
139
                     desc = title
141
                 content.append((title,self.name+"::"+data2,img,desc))
140
                 content.append((title,self.name+"::"+data2,img,desc))
142
             return content
141
             return content
276
         ### Videonoma galvenā
275
         ### Videonoma galvenā
277
         elif data=="videonoma":
276
         elif data=="videonoma":
278
             content.extend([
277
             content.extend([
279
-                ("Filmas - jaunākās", "ltc::videonoma?page=0&genre=all_movies&sorts=laiks&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/media/features/2013-12-17/aa3b_videonoma_dropdown_filmas.png","Jaunākās filmas"),
280
-                ("Filmas - pēc nosaukuma", "ltc::videonoma?page=0&genre=all_movies&sorts=title&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/media/features/2013-12-17/aa3b_videonoma_dropdown_filmas.png","Filmas pēc nosaukuma"),
281
-                ("Filmas - latviski", 'ltc::videonoma?page=0&genre=all_movies&sorts=title&cnt=40&clear=true&filter={"valoda":["lv"]}',"https://www.lattelecom.tv/media/features/2013-12-17/aa3b_videonoma_dropdown_filmas.png","Filmas latviešu valodā"),
282
-                ("Filmas - pēc reitinga", "ltc::videonoma?page=0&genre=all_movies&sorts=imbd&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/media/features/2013-12-17/aa3b_videonoma_dropdown_filmas.png","Filmas pēc IMBD reitinga"),
283
-                ("Filmas bērniem - jaunākās", "ltc::videonoma?page=0&genre=3&sorts=laiks&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_berniem.png","Jaunākie bernu video"),
284
-                ("Filmas bērniem - pēc nosaukuma", "ltc::videonoma?page=0&genre=3&sorts=title&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_berniem.png","Bērnu video pēc nosaukuma"),
285
-                ("Filmas bērniem - latviski", 'ltc::videonoma?page=0&genre=3&sorts=title&cnt=40&clear=true&filter={"valoda":[\"lv\"]}',"https://www.lattelecom.tv/images/redesign/videonoma_dropdown_berniem.png","Bērnu video latviski"),
286
-                ("Filmas bērniem - pēc reitinga", "ltc::videonoma?page=0&genre=3&sorts=imbd&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_berniem.png","Bērnu video pēc IMBD reitinga"),
287
-                ("Sērijas - jaunākās", "ltc::videonoma?page=0&genre=27&sorts=laiks&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_raidijumi.png","Jaunākās sērijas"),
288
-                ("Sērijas - pēc nosaukuma", "ltc::videonoma?page=0&genre=27&sorts=title&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_raidijumi.png","Sērijas pēc pēc nosaukuma"),
289
-                ("Sērijas animācijas - jaunākās", "ltc::videonoma?page=0&genre=27&sorts=laiks&cnt=40&clear=true&filter={\"zanrs\":[\"201\"]}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_raidijumi.png","Animācijas serijas"),
290
-                ("Sērijas animācijas - pēc nosaukuma", "ltc::videonoma?page=0&genre=27&sorts=title&cnt=40&clear=true&filter={\"zanrs\":[\"201\"]}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_raidijumi.png","Animācijas serijas"),
291
-                ("Sērijas ģimenes - jaunākās", "ltc::videonoma?page=0&genre=27&sorts=laiks&cnt=40&clear=true&filter={\"zanrs\":[\"195\"]}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_raidijumi.png","Animācijas serijas"),
292
-                ("Sērijas ģimenes - pēc nosaukuma", "ltc::videonoma?page=0&genre=27&sorts=title&cnt=40&clear=true&filter={\"zanrs\":[\"195\"]}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_raidijumi.png","Animācijas serijas"),
293
-                ("Sērijas latviski - jaunākās", 'ltc::videonoma?page=0&genre=27&sorts=laiks&cnt=40&clear=true&filter={"valoda":["lv"]}',"https://www.lattelecom.tv/images/redesign/videonoma_dropdown_raidijumi.png","Sērijas  latviski"),
294
-                ("Sērijas latviski - pēc nosaukuma", 'ltc::videonoma?page=0&genre=27&sorts=title&cnt=40&clear=true&filter={"valoda":["lv"]}',"https://www.lattelecom.tv/images/redesign/videonoma_dropdown_raidijumi.png","Sērijas  latviski"),
295
-                ("Koncerti - jaunākie", "ltc::videonoma?page=0&genre=19&sorts=laiks&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_koncerti.png","Jaunākie koncerti"),
296
-                ("Koncerti - pēc nosaukuma", "ltc::videonoma?page=0&genre=19&sorts=title&cnt=40&clear=true&filter={}","https://www.lattelecom.tv/images/redesign/videonoma_dropdown_koncerti.png","Koncerti pēc pēc nosaukuma"),
278
+                ("Filmas - jaunākās", "ltc::videonoma?page=0&genre=all_movies&sorts=laiks&cnt=40&clear=true&filter={}","https://www.shortcut.lv/media/features/2013-12-17/aa3b_videonoma_dropdown_filmas.png","Jaunākās filmas"),
279
+                ("Filmas - pēc nosaukuma", "ltc::videonoma?page=0&genre=all_movies&sorts=title&cnt=40&clear=true&filter={}","https://www.shortcut.lv/media/features/2013-12-17/aa3b_videonoma_dropdown_filmas.png","Filmas pēc nosaukuma"),
280
+                ("Filmas - latviski", 'ltc::videonoma?page=0&genre=all_movies&sorts=laiks&cnt=40&clear=true&filter={"valoda":["lv"]}',"https://www.shortcut.lv/media/features/2013-12-17/aa3b_videonoma_dropdown_filmas.png","Filmas latviešu valodā"),
281
+                ("Filmas - pēc reitinga", "ltc::videonoma?page=0&genre=all_movies&sorts=imbd&cnt=40&clear=true&filter={}","https://www.shortcut.lv/media/features/2013-12-17/aa3b_videonoma_dropdown_filmas.png","Filmas pēc IMBD reitinga"),
282
+                ("Filmas bērniem - jaunākās", "ltc::videonoma?page=0&genre=3&sorts=laiks&cnt=40&clear=true&filter={}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_berniem.png","Jaunākie bernu video"),
283
+                ("Filmas bērniem - pēc nosaukuma", "ltc::videonoma?page=0&genre=3&sorts=title&cnt=40&clear=true&filter={}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_berniem.png","Bērnu video pēc nosaukuma"),
284
+                ("Filmas bērniem - latviski", 'ltc::videonoma?page=0&genre=3&sorts=laiks&cnt=40&clear=true&filter={"valoda":[\"lv\"]}',"https://www.shortcut.lv/images/redesign/videonoma_dropdown_berniem.png","Bērnu video latviski"),
285
+                ("Filmas bērniem - pēc reitinga", "ltc::videonoma?page=0&genre=3&sorts=imbd&cnt=40&clear=true&filter={}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_berniem.png","Bērnu video pēc IMBD reitinga"),
286
+                ("Sērijas - jaunākās", "ltc::videonoma?page=0&genre=27&sorts=laiks&cnt=40&clear=true&filter={}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_raidijumi.png","Jaunākās sērijas"),
287
+                ("Sērijas - pēc nosaukuma", "ltc::videonoma?page=0&genre=27&sorts=title&cnt=40&clear=true&filter={}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_raidijumi.png","Sērijas pēc pēc nosaukuma"),
288
+                ("Sērijas animācijas - jaunākās", "ltc::videonoma?page=0&genre=27&sorts=laiks&cnt=40&clear=true&filter={\"zanrs\":[\"201\"]}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_raidijumi.png","Animācijas serijas"),
289
+                ("Sērijas animācijas - pēc nosaukuma", "ltc::videonoma?page=0&genre=27&sorts=title&cnt=40&clear=true&filter={\"zanrs\":[\"201\"]}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_raidijumi.png","Animācijas serijas"),
290
+                ("Sērijas ģimenes - jaunākās", "ltc::videonoma?page=0&genre=27&sorts=laiks&cnt=40&clear=true&filter={\"zanrs\":[\"195\"]}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_raidijumi.png","Animācijas serijas"),
291
+                ("Sērijas ģimenes - pēc nosaukuma", "ltc::videonoma?page=0&genre=27&sorts=title&cnt=40&clear=true&filter={\"zanrs\":[\"195\"]}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_raidijumi.png","Animācijas serijas"),
292
+                ("Sērijas latviski - jaunākās", 'ltc::videonoma?page=0&genre=27&sorts=laiks&cnt=40&clear=true&filter={"valoda":["lv"]}',"https://www.shortcut.lv/images/redesign/videonoma_dropdown_raidijumi.png","Sērijas  latviski"),
293
+                ("Sērijas latviski - pēc nosaukuma", 'ltc::videonoma?page=0&genre=27&sorts=title&cnt=40&clear=true&filter={"valoda":["lv"]}',"https://www.shortcut.lv/images/redesign/videonoma_dropdown_raidijumi.png","Sērijas  latviski"),
294
+                ("Koncerti - jaunākie", "ltc::videonoma?page=0&genre=19&sorts=laiks&cnt=40&clear=true&filter={}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_koncerti.png","Jaunākie koncerti"),
295
+                ("Koncerti - pēc nosaukuma", "ltc::videonoma?page=0&genre=19&sorts=title&cnt=40&clear=true&filter={}","https://www.shortcut.lv/images/redesign/videonoma_dropdown_koncerti.png","Koncerti pēc pēc nosaukuma"),
297
             ])
296
             ])
298
             return content
297
             return content
299
 
298
 
300
         ### Videonomas saraksti
299
         ### Videonomas saraksti
301
         elif path == "videonoma":
300
         elif path == "videonoma":
302
-            url = "https://www.lattelecom.tv/movies-snippet.json"+params
301
+            url = "https://www.shortcut.lv/movies-snippet.json"+params
303
             r = self._http_request(url,headers=self.headers2)
302
             r = self._http_request(url,headers=self.headers2)
304
             if not r:
303
             if not r:
305
                 return content
304
                 return content
314
                 if data2[-1]=="/": data2=data2[:-1]
313
                 if data2[-1]=="/": data2=data2[:-1]
315
                 if "/raidijumi/" in data2:
314
                 if "/raidijumi/" in data2:
316
                     data2 += "?series" # TODO
315
                     data2 += "?series" # TODO
317
-                img = "https://www.lattelecom.tv"+item["image"].encode("utf8")
316
+                img = "https://www.shortcut.lv"+item["image"].encode("utf8")
318
                 desc = "%s\n%s"%(title,item["genre"].encode("utf8"))
317
                 desc = "%s\n%s"%(title,item["genre"].encode("utf8"))
319
                 if "is_premium" in item and item["is_premium"]:
318
                 if "is_premium" in item and item["is_premium"]:
320
                     title = title + " [P]"
319
                     title = title + " [P]"
329
 
328
 
330
         ### Sērijas
329
         ### Sērijas
331
         elif clist=="videonoma" and  (params=="?series" or "season_nr" in qs):
330
         elif clist=="videonoma" and  (params=="?series" or "season_nr" in qs):
332
-            url = "https://www.lattelecom.tv/"+path
331
+            url = "https://www.shortcut.lv/"+path
333
             r = self._http_request(url,headers=self.headers2)
332
             r = self._http_request(url,headers=self.headers2)
334
             if not r:
333
             if not r:
335
                 return content
334
                 return content
357
                 else:  # Sezonas epizožu saraksts
356
                 else:  # Sezonas epizožu saraksts
358
                     if not "season_nr" in qs:
357
                     if not "season_nr" in qs:
359
                         qs["season_nr"]="0"
358
                         qs["season_nr"]="0"
360
-                    # https://www.lattelecom.tv/api/episode-loader-design17/0?chunk_size=4&sorting=epizode&series_id=dora_the_explorer
361
-                    # https://www.lattelecom.tv/api/episode-loader-design17/3?chunk_size=4&sorting=epizode&series_id=dora_the_explorer&movie_id=10161&z360tv=&is_active_season=false HTTP/1.1
362
-                    # https://www.lattelecom.tv/api/episode-loader-design17/3?chunk_size=4&sorting=epizode&series_id=dora_the_explorer
363
-                    url = "https://www.lattelecom.tv/api/episode-loader-design17/%s?chunk_size=4&sorting=epizode&series_id=%s" % (qs["season_nr"], vid)
359
+                    # https://www.shortcut.lv/api/episode-loader-design17/0?chunk_size=4&sorting=epizode&series_id=dora_the_explorer
360
+                    # https://www.shortcut.lv/api/episode-loader-design17/3?chunk_size=4&sorting=epizode&series_id=dora_the_explorer&movie_id=10161&z360tv=&is_active_season=false HTTP/1.1
361
+                    # https://www.shortcut.lv/api/episode-loader-design17/3?chunk_size=4&sorting=epizode&series_id=dora_the_explorer
362
+                    url = "https://www.shortcut.lv/api/episode-loader-design17/%s?chunk_size=4&sorting=epizode&series_id=%s" % (qs["season_nr"], vid)
364
                     r = self._http_request(url,headers=self.headers2)
363
                     r = self._http_request(url,headers=self.headers2)
365
                     try:
364
                     try:
366
                         js = json.loads(r)
365
                         js = json.loads(r)
370
                     for item in result:
369
                     for item in result:
371
                         title = "%s - %s(%s)"%(raidijums,item[2],item[3])
370
                         title = "%s - %s(%s)"%(raidijums,item[2],item[3])
372
                         data2 = item[0][1:]
371
                         data2 = item[0][1:]
373
-                        img = "https://www.lattelecom.tv"+item[1]
372
+                        img = "https://www.shortcut.lv"+item[1]
374
                         desc = title
373
                         desc = title
375
                         content.append((title,self.name+"::"+data2,img,desc))
374
                         content.append((title,self.name+"::"+data2,img,desc))
376
                     return content
375
                     return content
381
                 for item in result:
380
                 for item in result:
382
                     title = "%s - %s(%s)"%(raidijums,item[2],item[3])
381
                     title = "%s - %s(%s)"%(raidijums,item[2],item[3])
383
                     data2 = item[0][1:]
382
                     data2 = item[0][1:]
384
-                    img = "https://www.lattelecom.tv"+item[1]
383
+                    img = "https://www.shortcut.lv"+item[1]
385
                     desc = title
384
                     desc = title
386
                     content.append((title,self.name+"::"+data2,img,desc))
385
                     content.append((title,self.name+"::"+data2,img,desc))
387
                 return content
386
                 return content
820
         img = nfo["thumb"]
819
         img = nfo["thumb"]
821
         #xml = util.nfo2xml(nfo)
820
         #xml = util.nfo2xml(nfo)
822
 
821
 
823
-        url = "https://www.lattelecom.tv/xmls/%s.xml"%video_id
822
+        url = "https://www.shortcut.lv/xmls/%s.xml"%video_id
824
         headers = self.headers2
823
         headers = self.headers2
825
         headers["Cookie"] = self.session_id
824
         headers["Cookie"] = self.session_id
826
         response = urllib2.urlopen(urllib2.Request(url, headers=headers))
825
         response = urllib2.urlopen(urllib2.Request(url, headers=headers))
891
         #data["hls"] = "http://%s/mobile-vod/%s/playlist.m3u8?resource_id=%s&auth_token=%s"%(data["server"],data["mp4"],data["resource_id"],data["token"])
890
         #data["hls"] = "http://%s/mobile-vod/%s/playlist.m3u8?resource_id=%s&auth_token=%s"%(data["server"],data["mp4"],data["resource_id"],data["token"])
892
         ##data["hls"]="http://%s/mobile-vod/mp4:%s/playlist.m3u8?resource_id=%s&auth_token=app_%s"%(data["server"],data["mp4"],data["resource_id"],data["token"])
891
         ##data["hls"]="http://%s/mobile-vod/mp4:%s/playlist.m3u8?resource_id=%s&auth_token=app_%s"%(data["server"],data["mp4"],data["resource_id"],data["token"])
893
 
892
 
894
-    ### wwww.lattelecom.tv izsaukumi
893
+    ### wwww.shortcut.lv izsaukumi
895
     def login2(self,user="",password=""):
894
     def login2(self,user="",password=""):
896
         """Login in to site, create session cookies"""
895
         """Login in to site, create session cookies"""
897
         if not user: user=self.options["user"]
896
         if not user: user=self.options["user"]
898
         if not password: password = self.options["password"]
897
         if not password: password = self.options["password"]
899
-        url0 = "https://www.lattelecom.tv"
898
+        url0 = "https://www.shortcut.lv"
900
         class NoRedirectHandler(urllib2.HTTPRedirectHandler):
899
         class NoRedirectHandler(urllib2.HTTPRedirectHandler):
901
             def http_error_302(self, req, fp, code, msg, headers):
900
             def http_error_302(self, req, fp, code, msg, headers):
902
                 infourl = urllib.addinfourl(fp, headers, req.get_full_url())
901
                 infourl = urllib.addinfourl(fp, headers, req.get_full_url())
910
 
909
 
911
         # Dabūjam sesijas id un url_gif, kas redirektējas uz auth_url
910
         # Dabūjam sesijas id un url_gif, kas redirektējas uz auth_url
912
         headers = headers2dict("""
911
         headers = headers2dict("""
913
-Host: www.lattelecom.tv
914
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
912
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
915
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
913
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
916
 Accept-Language: en-US,en;q=0.5
914
 Accept-Language: en-US,en;q=0.5
924
 
922
 
925
         # Dabūtjam auth_url
923
         # Dabūtjam auth_url
926
         headers = headers2dict("""
924
         headers = headers2dict("""
927
-Host: www.lattelecom.tv
928
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
925
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
929
 Accept: image/png,image/*;q=0.8,*/*;q=0.5
926
 Accept: image/png,image/*;q=0.8,*/*;q=0.5
930
 Accept-Language: en-US,en;q=0.5
927
 Accept-Language: en-US,en;q=0.5
931
 DNT: 1
928
 DNT: 1
932
-Referer: https://www.lattelecom.tv/
929
+Referer: https://www.shortcut.lv/
933
     """)
930
     """)
934
         headers["Cookie"] = session_id
931
         headers["Cookie"] = session_id
935
         urllib2.install_opener(urllib2.build_opener(NoRedirectHandler()))
932
         urllib2.install_opener(urllib2.build_opener(NoRedirectHandler()))
938
             url_auth = response.headers["location"]
935
             url_auth = response.headers["location"]
939
         else:
936
         else:
940
             self.error = u"auth.gif nenostrādāja"
937
             self.error = u"auth.gif nenostrādāja"
941
-            #raise u"auth.gif nenostrādāja"
942
-            return False
938
+            raise Exception(u"auth.gif nenostrādāja")
939
+            #return False
943
 
940
 
944
         # Pierakstāmies iekš auth.lattelecom.lv
941
         # Pierakstāmies iekš auth.lattelecom.lv
945
         headers = headers2dict("""
942
         headers = headers2dict("""
946
-        Host: auth.lattelecom.lv
947
         User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
943
         User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
948
         Accept: image/png,image/*;q=0.8,*/*;q=0.5
944
         Accept: image/png,image/*;q=0.8,*/*;q=0.5
949
         Accept-Language: en-US,en;q=0.5
945
         Accept-Language: en-US,en;q=0.5
950
         DNT: 1
946
         DNT: 1
951
-        Referer: https://www.lattelecom.tv/
947
+        Referer: https://www.shortcut.lv/
952
         """)
948
         """)
953
         response = urllib2.urlopen(urllib2.Request(url_auth, headers=headers))
949
         response = urllib2.urlopen(urllib2.Request(url_auth, headers=headers))
954
         if not response.code == 302:
950
         if not response.code == 302:
958
 
954
 
959
         # Mēģinam ielogoties
955
         # Mēģinam ielogoties
960
         headers = headers2dict("""
956
         headers = headers2dict("""
961
-Host: www.lattelecom.tv
962
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
957
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
963
 Accept: text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
958
 Accept: text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
964
 Accept-Language: en-US,en;q=0.5
959
 Accept-Language: en-US,en;q=0.5
965
 DNT: 1
960
 DNT: 1
966
 X-Requested-With: XMLHttpRequest
961
 X-Requested-With: XMLHttpRequest
967
-Referer: https://www.lattelecom.tv/
962
+Referer: https://www.shortcut.lv/
968
 """)
963
 """)
969
         headers["Cookie"] = session_id
964
         headers["Cookie"] = session_id
970
         #data = "login=yes&email=%s&passw=%s"%(user,password)
965
         #data = "login=yes&email=%s&passw=%s"%(user,password)
971
-        url = "https://www.lattelecom.tv/login.json?callback=jQuery111303344749731668816_1463817318435&username=%s&password=%s&captcha=&sid=&_="%(user,password)
966
+        url = "https://www.shortcut.lv/login.json?callback=jQuery111303344749731668816_1463817318435&username=%s&password=%s&captcha=&sid=&_="%(user,password)
972
         req = urllib2.Request(url, headers=headers)
967
         req = urllib2.Request(url, headers=headers)
973
         response = urllib2.urlopen(req)
968
         response = urllib2.urlopen(req)
974
         #with open("auth.htm","w") as f: f.write(response.read())
969
         #with open("auth.htm","w") as f: f.write(response.read())
988
         if not self.session_id:
983
         if not self.session_id:
989
             return False
984
             return False
990
         else:
985
         else:
991
-            url = "https://www.lattelecom.tv/profils"
986
+            url = "https://www.shortcut.lv/profils"
992
             response = urllib2.urlopen(urllib2.Request(url, headers=self.headers2))
987
             response = urllib2.urlopen(urllib2.Request(url, headers=self.headers2))
993
             if response.code == 200:
988
             if response.code == 200:
994
                 return True
989
                 return True