|
|
|
|
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
|