Ivars 7 anni fa
parent
commit
51b2062dc9
3 ha cambiato i file con 440 aggiunte e 416 eliminazioni
  1. 382
    359
      project.wpr
  2. 15
    9
      run.py
  3. 43
    48
      sources/ltc.py

+ 382
- 359
project.wpr
File diff soppresso perché troppo grande
Vedi File


+ 15
- 9
run.py Vedi File

@@ -83,23 +83,23 @@ class Main(Frame):
83 83
         frame3 = Frame(self, height=40)
84 84
         frame3.pack(side=TOP, fill=X, padx=15)
85 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 87
         self.b_select.pack(side=LEFT, anchor=S)
88 88
 
89 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 91
         self.b_back.pack(side=LEFT, anchor=S)
92 92
 
93 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 95
         self.b_options.pack(side=LEFT, anchor=S)
96 96
 
97 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 99
         self.b_config.pack(side=LEFT, anchor=S)
100 100
 
101 101
         self.b_exit = Button(frame3, text="Exit",
102
-                            command=self.quit, width=10)
102
+                             command=self.quit, width=10)
103 103
         self.b_exit.pack(side=LEFT, anchor=S)
104 104
 
105 105
 
@@ -231,7 +231,10 @@ class Main(Frame):
231 231
                 else:
232 232
                     im = None
233 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 238
             image = ImageTk.PhotoImage(im)
236 239
             imagesprite = self.pic.create_image(200, 125,image=image)
237 240
             self.pic.image = image
@@ -403,7 +406,10 @@ class VideoInfo(tkd.Dialog):
403 406
                     else:
404 407
                         im = None
405 408
             if im:
406
-                im.thumbnail((400, 400))
409
+                try:
410
+                    im.thumbnail((400, 400))
411
+                except:
412
+                    print "Image convert error"
407 413
                 image = ImageTk.PhotoImage(im)
408 414
                 imagesprite = self.pic.create_image(200, 200,image=image)
409 415
                 self.pic.image = image
@@ -679,9 +685,9 @@ def player(url, title = "", subfile = "",headers={}, player="ffplay"):
679 685
     # encode(sys.getfilesystemencoding())
680 686
     subfile = unicode(subfile).encode(sys.getfilesystemencoding())
681 687
     cmd1 = [r"c:\Program Files\VideoLAN\VLC\vlc.exe",url,
682
-           "--meta-title",title,
688
+            "--meta-title",title,
683 689
            "--http-user-agent","Enigma2"
684
-    ]
690
+           ]
685 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 692
     cmd2 = [
687 693
         r"C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0",

+ 43
- 48
sources/ltc.py Vedi File

@@ -35,16 +35,15 @@ class Source(SourceBase):
35 35
         self.desc = "Shortcut.lv (lattelecom.tv) satura skatīšanās"
36 36
 
37 37
         self.token = "" # manstv.lattelecom.tv
38
-        self.session_id = ""  # www.lattelecom.tv
38
+        self.session_id = ""  # www.shortcut.lv
39 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 41
         self.headers = headers2dict("""
42 42
 User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; SM-G900FD Build/KOT49H)
43 43
 Host: manstv.lattelecom.tv
44 44
 Connection: Keep-Alive
45 45
         """)
46 46
         self.headers2 = headers2dict("""
47
-Host: www.lattelecom.tv
48 47
 Connection: keep-alive
49 48
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
50 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,7 +105,7 @@ Accept-Language: en-US,en;q=0.8
106 105
                     if not item[1]:
107 106
                         title = title + "[P]"
108 107
                     data2 = item[0][0:-1]
109
-                    img = "https://www.lattelecom.tv" + item[2]
108
+                    img = "https://www.shortcut.lv" + item[2]
110 109
                     desc = title
111 110
                     content.append((title,self.name+"::"+data2,img,desc))
112 111
                 return content
@@ -133,10 +132,10 @@ Accept-Language: en-US,en;q=0.8
133 132
                 if item["xprs_id"] in js:
134 133
                     epg = js[item["xprs_id"]]
135 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 137
                 else:
139
-                    img = "https://manstv.lattelecom.tv/"+ item['broadcast_default_picture']
138
+                    img = "https://manstv.shortcut.lv/"+ item['broadcast_default_picture']
140 139
                     desc = title
141 140
                 content.append((title,self.name+"::"+data2,img,desc))
142 141
             return content
@@ -276,30 +275,30 @@ Accept-Language: en-US,en;q=0.8
276 275
         ### Videonoma galvenā
277 276
         elif data=="videonoma":
278 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 297
             return content
299 298
 
300 299
         ### Videonomas saraksti
301 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 302
             r = self._http_request(url,headers=self.headers2)
304 303
             if not r:
305 304
                 return content
@@ -314,7 +313,7 @@ Accept-Language: en-US,en;q=0.8
314 313
                 if data2[-1]=="/": data2=data2[:-1]
315 314
                 if "/raidijumi/" in data2:
316 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 317
                 desc = "%s\n%s"%(title,item["genre"].encode("utf8"))
319 318
                 if "is_premium" in item and item["is_premium"]:
320 319
                     title = title + " [P]"
@@ -329,7 +328,7 @@ Accept-Language: en-US,en;q=0.8
329 328
 
330 329
         ### Sērijas
331 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 332
             r = self._http_request(url,headers=self.headers2)
334 333
             if not r:
335 334
                 return content
@@ -357,10 +356,10 @@ Accept-Language: en-US,en;q=0.8
357 356
                 else:  # Sezonas epizožu saraksts
358 357
                     if not "season_nr" in qs:
359 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 363
                     r = self._http_request(url,headers=self.headers2)
365 364
                     try:
366 365
                         js = json.loads(r)
@@ -370,7 +369,7 @@ Accept-Language: en-US,en;q=0.8
370 369
                     for item in result:
371 370
                         title = "%s - %s(%s)"%(raidijums,item[2],item[3])
372 371
                         data2 = item[0][1:]
373
-                        img = "https://www.lattelecom.tv"+item[1]
372
+                        img = "https://www.shortcut.lv"+item[1]
374 373
                         desc = title
375 374
                         content.append((title,self.name+"::"+data2,img,desc))
376 375
                     return content
@@ -381,7 +380,7 @@ Accept-Language: en-US,en;q=0.8
381 380
                 for item in result:
382 381
                     title = "%s - %s(%s)"%(raidijums,item[2],item[3])
383 382
                     data2 = item[0][1:]
384
-                    img = "https://www.lattelecom.tv"+item[1]
383
+                    img = "https://www.shortcut.lv"+item[1]
385 384
                     desc = title
386 385
                     content.append((title,self.name+"::"+data2,img,desc))
387 386
                 return content
@@ -820,7 +819,7 @@ Host: manstv.lattelecom.tv
820 819
         img = nfo["thumb"]
821 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 823
         headers = self.headers2
825 824
         headers["Cookie"] = self.session_id
826 825
         response = urllib2.urlopen(urllib2.Request(url, headers=headers))
@@ -891,12 +890,12 @@ Host: manstv.lattelecom.tv
891 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 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 894
     def login2(self,user="",password=""):
896 895
         """Login in to site, create session cookies"""
897 896
         if not user: user=self.options["user"]
898 897
         if not password: password = self.options["password"]
899
-        url0 = "https://www.lattelecom.tv"
898
+        url0 = "https://www.shortcut.lv"
900 899
         class NoRedirectHandler(urllib2.HTTPRedirectHandler):
901 900
             def http_error_302(self, req, fp, code, msg, headers):
902 901
                 infourl = urllib.addinfourl(fp, headers, req.get_full_url())
@@ -910,7 +909,6 @@ Host: manstv.lattelecom.tv
910 909
 
911 910
         # Dabūjam sesijas id un url_gif, kas redirektējas uz auth_url
912 911
         headers = headers2dict("""
913
-Host: www.lattelecom.tv
914 912
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
915 913
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
916 914
 Accept-Language: en-US,en;q=0.5
@@ -924,12 +922,11 @@ Connection: keep-alive
924 922
 
925 923
         # Dabūtjam auth_url
926 924
         headers = headers2dict("""
927
-Host: www.lattelecom.tv
928 925
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
929 926
 Accept: image/png,image/*;q=0.8,*/*;q=0.5
930 927
 Accept-Language: en-US,en;q=0.5
931 928
 DNT: 1
932
-Referer: https://www.lattelecom.tv/
929
+Referer: https://www.shortcut.lv/
933 930
     """)
934 931
         headers["Cookie"] = session_id
935 932
         urllib2.install_opener(urllib2.build_opener(NoRedirectHandler()))
@@ -938,17 +935,16 @@ Referer: https://www.lattelecom.tv/
938 935
             url_auth = response.headers["location"]
939 936
         else:
940 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 941
         # Pierakstāmies iekš auth.lattelecom.lv
945 942
         headers = headers2dict("""
946
-        Host: auth.lattelecom.lv
947 943
         User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
948 944
         Accept: image/png,image/*;q=0.8,*/*;q=0.5
949 945
         Accept-Language: en-US,en;q=0.5
950 946
         DNT: 1
951
-        Referer: https://www.lattelecom.tv/
947
+        Referer: https://www.shortcut.lv/
952 948
         """)
953 949
         response = urllib2.urlopen(urllib2.Request(url_auth, headers=headers))
954 950
         if not response.code == 302:
@@ -958,17 +954,16 @@ Referer: https://www.lattelecom.tv/
958 954
 
959 955
         # Mēģinam ielogoties
960 956
         headers = headers2dict("""
961
-Host: www.lattelecom.tv
962 957
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
963 958
 Accept: text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
964 959
 Accept-Language: en-US,en;q=0.5
965 960
 DNT: 1
966 961
 X-Requested-With: XMLHttpRequest
967
-Referer: https://www.lattelecom.tv/
962
+Referer: https://www.shortcut.lv/
968 963
 """)
969 964
         headers["Cookie"] = session_id
970 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 967
         req = urllib2.Request(url, headers=headers)
973 968
         response = urllib2.urlopen(req)
974 969
         #with open("auth.htm","w") as f: f.write(response.read())
@@ -988,7 +983,7 @@ Referer: https://www.lattelecom.tv/
988 983
         if not self.session_id:
989 984
             return False
990 985
         else:
991
-            url = "https://www.lattelecom.tv/profils"
986
+            url = "https://www.shortcut.lv/profils"
992 987
             response = urllib2.urlopen(urllib2.Request(url, headers=self.headers2))
993 988
             if response.code == 200:
994 989
                 return True