|
@@ -17,12 +17,16 @@ if "_create_unverified_context" in dir(ssl):
|
17
|
17
|
ssl._create_default_https_context = ssl._create_unverified_context
|
18
|
18
|
|
19
|
19
|
from SourceBase import SourceBase
|
|
20
|
+import util
|
20
|
21
|
|
21
|
|
-API_URL = 'http://replay.lsm.lv/'
|
22
|
22
|
headers2dict = lambda h: dict([l.strip().split(": ") for l in h.strip().splitlines()])
|
23
|
23
|
headers0 = headers2dict("""
|
24
|
|
-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
|
25
|
|
-""")
|
|
24
|
+User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.04
|
|
25
|
+Accept: application/json, text/javascript, */*; q=0.01
|
|
26
|
+Accept-Language: en-US,en;q=0.5
|
|
27
|
+Accept-Encoding: gzip, deflate, br
|
|
28
|
+Content-Type: application/x-www-form-urlencoded; charset=UTF-8
|
|
29
|
+X-Requested-With: XMLHttpRequest""")
|
26
|
30
|
import HTMLParser
|
27
|
31
|
h = HTMLParser.HTMLParser()
|
28
|
32
|
|
|
@@ -34,6 +38,7 @@ class Source(SourceBase):
|
34
|
38
|
self.img = "https://tvdom.tv/front/assets/images/logo.png"
|
35
|
39
|
self.desc = "TVDom.tv portāla satura skatīšanās"
|
36
|
40
|
self.headers = headers0
|
|
41
|
+ self.url = "https://tvdom.tv/"
|
37
|
42
|
|
38
|
43
|
self.country=country
|
39
|
44
|
self.session = None
|
|
@@ -42,7 +47,7 @@ class Source(SourceBase):
|
42
|
47
|
cur_directory = os.path.dirname(os.path.abspath(__file__))
|
43
|
48
|
if not cfg_path: cfg_path = cur_directory
|
44
|
49
|
self.config_file = os.path.join(cfg_path,self.name+".cfg")
|
45
|
|
- self.options = OrderedDict([("user","lietotajs"),("password","parole")])
|
|
50
|
+ self.options = OrderedDict([("user","lietotajs"),("password","parole"), ("region", "lv"), ("lang", "lv")])
|
46
|
51
|
self.options_read()
|
47
|
52
|
|
48
|
53
|
def login(self,user="",password=""):
|
|
@@ -80,13 +85,16 @@ Referer: https://tvdom.tv/
|
80
|
85
|
def get_content(self, data):
|
81
|
86
|
print "[tvdom] get_content:", data
|
82
|
87
|
source,data,path,plist,clist,params,qs = self.parse_data(data)
|
83
|
|
- lang = qs["lang"] if "lang" in qs else self.country
|
|
88
|
+ lang = self.options["lang"]
|
|
89
|
+ region = self.options["region"]
|
84
|
90
|
content=[]
|
85
|
91
|
content.append(("..return", "back","","Return back"))
|
86
|
92
|
|
87
|
93
|
if clist=="home":
|
88
|
94
|
content.extend([
|
89
|
95
|
("Live stream", "tvdom::tiesraides","","TV live streams"),
|
|
96
|
+ ("Archive - last", "tvdom::arhivs?filter=new&page=0&limit=30®ion=%s&language=%s" % (region, lang),"","Video archive - last videos"),
|
|
97
|
+ ("Archive - popular", "tvdom::arhivs?filter=new&page=0&limit=30®ion=%s&language=%s"% (region, lang),"","Video archive - popular video"),
|
90
|
98
|
("Archive - categories", "tvdom::arhivs","","Video archive by categories"),
|
91
|
99
|
("Search", "tvdom::search/?srch-term={0}","","Search archive"),
|
92
|
100
|
|
|
@@ -96,70 +104,51 @@ Referer: https://tvdom.tv/
|
96
|
104
|
|
97
|
105
|
### Tiesraides kanalu saraksts ###
|
98
|
106
|
elif data=="tiesraides":
|
99
|
|
- ch_name = {"49":"Дом Кино","50":"Карусель","51":"Время","52":"Музыка Первого","53":"Телекафе"}
|
100
|
|
- url = "https://tvdom.tv/"
|
101
|
|
- r = self._http_request(url)
|
102
|
|
- #channels1 = re.findall(r'data-xprs_status="\d" data-href="/tiesraides/([^/]+)/[^"]+">.+?src="([^"]+)" alt="([^"]+)">', r, re.DOTALL)
|
103
|
|
- channels2 = re.findall(r'<a class="channel-name">([^<]*)</a>\s+<div class="redirect-to-url" data-href="/tiesraides/([^/]+)/[^"]*">.+?<img style="width:100%;" src="([^"]+)".+?<h3>([^<]+)</h3>.+?<p class="unix">([^<]+)</p>', r, re.DOTALL)
|
104
|
|
- channels = {}
|
105
|
|
- for item in channels2:
|
106
|
|
- title = item[0]
|
107
|
|
- title = h.unescape(title.decode("utf8")).encode("utf8")
|
108
|
|
- img = "https://tvdom.tv"+item[2]
|
109
|
|
- data2 = "tiesraides/%s/"%item[1]
|
110
|
|
- desc = "%s\n%s\n%s"%(title,item[3],item[4])
|
111
|
|
- channels[item[1]]={"title":title,"img":img,"desc":desc}
|
112
|
|
- #content.append((title,self.name+"::"+data2,img,desc))
|
113
|
|
-
|
114
|
|
- for r2 in re.findall(r'<div class="thumbnail-menu pull-left updater"(.+?)</div>\s+</div>', r, re.DOTALL):
|
115
|
|
- ch = re.search('data-href="/tiesraides/([^/]+)/[^"]*"', r2, re.DOTALL).group(1)
|
116
|
|
- data2 = "tiesraides/"+ch
|
117
|
|
- m = re.search('src="(.+?)" alt="(.+?)">', r2, re.DOTALL)
|
118
|
|
- title = m.group(2)
|
119
|
|
- img = m.group(1)
|
120
|
|
- desc = title
|
121
|
|
- if ch in channels:
|
122
|
|
- img = channels[ch]["img"]
|
123
|
|
- desc = channels[ch]["desc"]
|
124
|
|
- else:
|
125
|
|
- m = re.search('<img src="([^"]+)" alt="aaaaaa([^"]+)"><h3>.+<p class="unix">([^<]+)</p>', r2, re.DOTALL)
|
126
|
|
- if m:
|
127
|
|
- desc = "%s\n%s\n%s"%(title,m.group(1),m.group(3))
|
128
|
|
- img = m.group(2)
|
129
|
|
- content.append((title,self.name+"::"+data2,img,desc))
|
|
107
|
+ data1 = "infinity/on_front_filter_channels_list.json"
|
|
108
|
+ params = "hd=&language=%s®ion=%s" % (self.options["lang"], self.options["region"])
|
|
109
|
+ r = self.call_json(data1, params)
|
|
110
|
+ for genre in r["data"]:
|
|
111
|
+ for item in r["data"][genre]:
|
|
112
|
+ ch = item["channel_name"]
|
|
113
|
+ title = u"%s - %s" % (item["channel_name"], item["program_title"])
|
|
114
|
+ img = "https://tvdom.tv"+item["channel_logo"]
|
|
115
|
+ data2 = item["program_url"][1:]
|
|
116
|
+ desc = u"%s\n%s-%s"%(title,item["time_start"],item["time_stop"])
|
|
117
|
+ content.append((title,self.name+"::"+data2,img,desc))
|
130
|
118
|
return content
|
131
|
119
|
|
132
|
|
- elif clist == "tiesraides":
|
133
|
|
- if not self.session:
|
134
|
|
- self.login()
|
135
|
|
- url = "https://tvdom.tv/" + data
|
136
|
|
- headers = self.headers
|
137
|
|
- headers["Cookie"] = "PHPSESSID=%s; neverending_story=1;"%self.session
|
138
|
|
- r = self._http_request(url,headers=headers)
|
139
|
|
- m = re.search("var streamConnectionUrl = '([^']+)'", r, re.DOTALL)
|
140
|
|
- if m:
|
141
|
|
- data2 = m.group(1)
|
142
|
|
- else:
|
143
|
|
- return ("No stream found %s"%data,"","","No stream found")
|
144
|
|
- m = re.search('title: "([^"]+)"', r, re.DOTALL)
|
145
|
|
- title = m.group(1) if m else data2
|
146
|
|
- m = re.search('<div id="panel">([^<]+)<', r, re.DOTALL)
|
147
|
|
- desc = m.group(1) if m else title
|
148
|
|
- m = re.search('<div id="panel">([^<]+)<', r, re.DOTALL)
|
149
|
|
- desc = m.group(1) if m else title
|
150
|
|
- m = re.search('var promo_image *= "([^"]+)', r, re.DOTALL)
|
151
|
|
- img = m.group(1) if m else ""
|
152
|
|
- return (title,data2,img,desc)
|
|
120
|
+# elif clist == "tiesraides":
|
|
121
|
+# if not self.session:
|
|
122
|
+# self.login()
|
|
123
|
+# url = "https://tvdom.tv/" + data
|
|
124
|
+# headers = self.headers
|
|
125
|
+# headers["Cookie"] = "PHPSESSID=%s; neverending_story=1;"%self.session
|
|
126
|
+# r = self._http_request(url,headers=headers)
|
|
127
|
+# m = re.search("var streamConnectionUrl = '([^']+)'", r, re.DOTALL)
|
|
128
|
+# if m:
|
|
129
|
+# data2 = m.group(1)
|
|
130
|
+# else:
|
|
131
|
+# return ("No stream found %s"%data,"","","No stream found")
|
|
132
|
+# m = re.search('title: "([^"]+)"', r, re.DOTALL)
|
|
133
|
+# title = m.group(1) if m else data2
|
|
134
|
+# m = re.search('<div id="panel">([^<]+)<', r, re.DOTALL)
|
|
135
|
+# desc = m.group(1) if m else title
|
|
136
|
+# m = re.search('<div id="panel">([^<]+)<', r, re.DOTALL)
|
|
137
|
+# desc = m.group(1) if m else title
|
|
138
|
+# m = re.search('var promo_image *= "([^"]+)', r, re.DOTALL)
|
|
139
|
+# img = m.group(1) if m else ""
|
|
140
|
+# return (title,data2,img,desc)
|
153
|
141
|
|
154
|
142
|
### Search ###
|
155
|
143
|
elif clist=="search":
|
156
|
144
|
url = "https://tvdom.tv/" + data
|
157
|
145
|
r = self._http_request(url)
|
158
|
|
- for item in re.findall(r'<li data-xprs-search="\d+" data-href="([^"]+)".*?<img class="img-responsive" src="([^"]+)".*?<h3>([^<]+)</h3>.*?<h5>([^<]+)</h5>', r, re.DOTALL):
|
159
|
|
- title = item[2] + " "+ item[3]
|
|
146
|
+ result = re.findall(r'<div class="film-block_img">\s*<img src="([^"]+).+?<a href="/([^"]+)">([^<]+)</a>\s*</div>\s*<ul class="film-block_descr_tag">\s*<li><a href="">([^<]+)</a>', r, re.DOTALL)
|
|
147
|
+ for item in result:
|
|
148
|
+ title = item[2] + " ("+ item[3] + ")"
|
160
|
149
|
title = h.unescape(title.decode("utf8")).encode("utf8")
|
161
|
|
- img = "https://tvdom.tv" + item[1]
|
162
|
|
- data2 = item[0][1:]
|
|
150
|
+ img = "https://tvdom.tv" + item[0]
|
|
151
|
+ data2 = item[1]
|
163
|
152
|
desc = title
|
164
|
153
|
content.append((title,self.name+"::"+data2,img,desc))
|
165
|
154
|
return content
|
|
@@ -167,36 +156,103 @@ Referer: https://tvdom.tv/
|
167
|
156
|
### Arhīva kategorijas ###
|
168
|
157
|
elif data=="arhivs":
|
169
|
158
|
url = "https://tvdom.tv/"+data
|
|
159
|
+ headers = self.headers
|
|
160
|
+ headers["Cookie"] = "neverending_story=1; user_selected_language=%s"% (self.options["lang"])
|
170
|
161
|
r = self._http_request(url)
|
171
|
|
- for item in re.findall('pointer" href="/([^"]+)">([^<]+)</a>', r, re.DOTALL):
|
172
|
|
- title = item[1]
|
173
|
|
- title = h.unescape(title.decode("utf8")).encode("utf8")
|
|
162
|
+ result = re.findall(r'data-text-mobile="(.+?)" data-id="(\d+)" data-filter-type="archive_genre">', r)
|
|
163
|
+ for item in result:
|
|
164
|
+ title = item[0]
|
174
|
165
|
img = ""
|
175
|
|
- data2 = item[0]
|
|
166
|
+ data2 = "arhivs?" + "genre1=%s&filter=new®ion=%s&lang=%s&page=0&limit=30" % (item[1], region, lang)
|
176
|
167
|
desc = title
|
177
|
168
|
content.append((title,self.name+"::"+data2,img,desc))
|
178
|
169
|
return content
|
179
|
170
|
|
180
|
171
|
### Arhīva kategorijas programmas ###
|
181
|
172
|
elif clist=="arhivs":
|
182
|
|
- url = "https://tvdom.tv/"+data
|
183
|
|
- r = self._http_request(url)
|
184
|
|
- for item in re.findall(r"""<li><div class="thumbnail pull-left" onclick="location\.href='([^']+)'" data-toggle="popover" title="([^"]+)" data-content="([^"]*)".+?<img class="img-responsive archive-image" src="([^"]+)""", r, re.DOTALL):
|
185
|
|
- #for item in re.findall(r"""<li><div class="thumbnail pull-left" onclick="location\.href='([^']+)'" data-toggle="popover" title="([^"]+)" data-content="([^"]+)".+?<img class="img-responsive archive-image" src="([^"]+)""", r, re.DOTALL):
|
186
|
|
- title = item[1].replace("<br>"," - ")
|
187
|
|
- title = h.unescape(title.decode("utf8")).encode("utf8")
|
188
|
|
- img = "https://tvdom.tv"+item[3]
|
189
|
|
- data2 = item[0][1:]
|
190
|
|
- desc = item[2]
|
|
173
|
+ data1 = "infinity/on_front_archive_get_events2.json"
|
|
174
|
+ r = self.call_json(data1, params[1:])
|
|
175
|
+
|
|
176
|
+ for item in r["data"]:
|
|
177
|
+ title = item["title"] + "- " + item["online_time"]
|
|
178
|
+ img = "https://tvdom.tv"+item["image"]
|
|
179
|
+ data2 = item["url"][1:]
|
|
180
|
+ desc = u"%s\nlast: %s\npopularity: %s\n%s" % (title, item["online_time"], item["popularity"], item["channel_code"])
|
191
|
181
|
content.append((title,self.name+"::"+data2,img,desc))
|
|
182
|
+ if len(r["data"]) == 30:
|
|
183
|
+ page = int(qs["page"]) + 1
|
|
184
|
+ data2 = re.sub("page=\d+", "page=%s" % page, data)
|
|
185
|
+ content.append(("Next page",self.name+"::"+data2,"","Go to next page"))
|
192
|
186
|
return content
|
193
|
187
|
|
194
|
188
|
### Arhīva programmas video saraksts ###
|
195
|
189
|
elif clist=="play_arhivs" and len(data.split("/"))==3 and not re.search("_\d+",plist[2]):
|
196
|
190
|
url = "https://tvdom.tv/"+data
|
197
|
191
|
r = self._http_request(url)
|
198
|
|
- vid=re.search(r"id:(\d+), type: type", r, re.DOTALL).group(1)
|
|
192
|
+ vid=re.search('materialIdentifier : "(\d+)', r, re.DOTALL).group(1)
|
|
193
|
+ pname = re.split("[_\.\-]", plist[-1])[0]
|
199
|
194
|
data2 = data+"_"+vid
|
|
195
|
+ m = re.search(r'var program_title\s*= "(.+?)"', r)
|
|
196
|
+ title = title0 = m.group(1) if m else data2
|
|
197
|
+ m = re.search('<p class="content-info__descr-item">(.+?)</p>', r, re.DOTALL)
|
|
198
|
+ datums = m.group(1).strip() if m else ""
|
|
199
|
+ title = title + " " + datums
|
|
200
|
+ m = re.search('<p class="video-player__descr-text" style="height: 100px;">(.+?)<span', r, re.DOTALL)
|
|
201
|
+ desc = m.group(1).strip() if m else title
|
|
202
|
+ m = re.search('var share_image\s*= "([^"]+)', r, re.DOTALL)
|
|
203
|
+ img = m.group(1) if m else ""
|
|
204
|
+ content.append((title,self.name+"::"+data2,img,desc))
|
|
205
|
+ i2 = r.find("content content--indent-pb")
|
|
206
|
+ r2 = r if i2 == -1 else r[:i2]
|
|
207
|
+ result = re.findall(r'<img src="([^"]+)" class="content-item__image" alt=""><a href="/([^"]+)" class="content-item__hide-info">.+?<h3 class="content-item__name">\s*<a href="#">\s*([^<]*)\s*<br>\s*([^<]*)\s*</a>\s*</h3>', r2, re.DOTALL)
|
|
208
|
+ for item in result:
|
|
209
|
+ if pname not in item[1]:
|
|
210
|
+ continue
|
|
211
|
+ title = item[2] + " " + item[3].strip()
|
|
212
|
+ title = h.unescape(title.decode("utf8")).encode("utf8")
|
|
213
|
+ img = "https://tvdom.tv"+item[0]
|
|
214
|
+ data2 = item[1]
|
|
215
|
+ desc = title # TODO
|
|
216
|
+ content.append((title,self.name+"::"+data2,img,desc))
|
|
217
|
+ return content
|
|
218
|
+
|
|
219
|
+ ### Arhīva video
|
|
220
|
+# elif clist=="play_arhivs" and len(data.split("/"))==3 and re.search("_\d+",plist[2]):
|
|
221
|
+# url = "https://tvdom.tv/" + data
|
|
222
|
+# headers = self.headers
|
|
223
|
+# headers["Cookie"] = "PHPSESSID=%s; neverending_story=1;"%self.session
|
|
224
|
+# r = self._http_request(url,headers=headers)
|
|
225
|
+# m = re.search('var streamConnectionUrl = "([^"]+)"', r, re.DOTALL)
|
|
226
|
+# if m:
|
|
227
|
+# data2 = m.group(1)
|
|
228
|
+# else:
|
|
229
|
+# return ("No stream found %s"%data,"","","No stream found")
|
|
230
|
+# m = re.search('program_title = "([^"]+)"', r, re.DOTALL)
|
|
231
|
+# title = m.group(1) if m else data2
|
|
232
|
+# m = re.search('<a class="episode">Pārraides laiks ēterā: <span>([^<]+)</span></a>', r, re.DOTALL)
|
|
233
|
+# datums = m.group(1) if m else ""
|
|
234
|
+# title = title + " " + datums
|
|
235
|
+# m = re.search('<div id="panel">([^<]+)<', r, re.DOTALL)
|
|
236
|
+# desc = m.group(1) if m else title
|
|
237
|
+# m = re.search('<div id="panel">([^<]+)<', r, re.DOTALL)
|
|
238
|
+# desc = m.group(1) if m else title
|
|
239
|
+# m = re.search('var share_image *= "([^"]+)', r, re.DOTALL)
|
|
240
|
+# img = m.group(1) if m else ""
|
|
241
|
+# return (title,data2,img,desc)
|
|
242
|
+
|
|
243
|
+ def get_streams(self,data):
|
|
244
|
+ print "[tvdom] get_streams:", data
|
|
245
|
+ if not self.is_video(data):
|
|
246
|
+ return []
|
|
247
|
+ source,data,path,plist,clist,params,qs = self.parse_data(data)
|
|
248
|
+ if not self.session:
|
|
249
|
+ self.login()
|
|
250
|
+ url = "https://tvdom.tv/" + data
|
|
251
|
+ headers = self.headers
|
|
252
|
+ headers["Cookie"] = "PHPSESSID=%s; neverending_story=1;"%self.session
|
|
253
|
+ r = self._http_request(url,headers=headers)
|
|
254
|
+
|
|
255
|
+ if clist == "play_arhivs":
|
200
|
256
|
m = re.search('program_title = "([^"]+)"', r, re.DOTALL)
|
201
|
257
|
title = m.group(1) if m else data2
|
202
|
258
|
m = re.search('<a class="episode">Pārraides laiks ēterā: <span>([^<]+)</span></a>', r, re.DOTALL)
|
|
@@ -208,41 +264,51 @@ Referer: https://tvdom.tv/
|
208
|
264
|
desc = m.group(1) if m else title
|
209
|
265
|
m = re.search('var share_image *= "([^"]+)', r, re.DOTALL)
|
210
|
266
|
img = m.group(1) if m else ""
|
211
|
|
- content.append((title,self.name+"::"+data2,img,desc))
|
212
|
|
- i = r.find('<span class="slider-top-title"')
|
213
|
|
- if i>0: r = r[:i]
|
214
|
|
- for item in re.findall('<div class="col-md-9 redirect-to-url same-event" data-href="/([^"]+)">.+?image" src="([^"]+)".+?<h3 class="same-title">([^<]+)</h3>.*?<h5 class="same-online">([^<]+)</h5>', r, re.DOTALL):
|
215
|
|
- title = item[2] + " " + item[3]
|
216
|
|
- title = h.unescape(title.decode("utf8")).encode("utf8")
|
217
|
|
- img = "https://tvdom.tv"+item[1]
|
218
|
|
- data2 = item[0]
|
219
|
|
- desc = title # TODO
|
220
|
|
- content.append((title,self.name+"::"+data2,img,desc))
|
221
|
|
- return content
|
222
|
267
|
|
223
|
|
- ### Arhīva video
|
224
|
|
- elif clist=="play_arhivs" and len(data.split("/"))==3 and re.search("_\d+",plist[2]):
|
225
|
|
- url = "https://tvdom.tv/" + data
|
226
|
|
- headers = self.headers
|
227
|
|
- headers["Cookie"] = "PHPSESSID=%s; neverending_story=1;"%self.session
|
228
|
|
- r = self._http_request(url,headers=headers)
|
229
|
|
- m = re.search('var streamConnectionUrl = "([^"]+)"', r, re.DOTALL)
|
|
268
|
+ m = re.search(r"var streams\s*= ({[^;]+);", r, re.DOTALL)
|
|
269
|
+ if not m:
|
|
270
|
+ raise Exception("No stream found")
|
|
271
|
+ js = json.loads(m.group(1))
|
|
272
|
+ streams = []
|
|
273
|
+ for st in js:
|
|
274
|
+ if st == "qualities": continue
|
|
275
|
+ s = js[st]
|
|
276
|
+ data2 = s["url"]
|
|
277
|
+ stream = util.item()
|
|
278
|
+ stream["name"] = title
|
|
279
|
+ stream["url"] = data2
|
|
280
|
+ stream["img"] = img
|
|
281
|
+ stream["desc"] = desc
|
|
282
|
+ stream["resolver"] = "tvdom"
|
|
283
|
+ stream["quality"] = st
|
|
284
|
+ stream["order"] = int(st[:-1])
|
|
285
|
+ streams.append(stream)
|
|
286
|
+
|
|
287
|
+ streams = sorted(streams,key=lambda item: item["order"],reverse=True)
|
|
288
|
+ return streams
|
|
289
|
+
|
|
290
|
+ # Tiešraides video
|
|
291
|
+ else:
|
|
292
|
+ m = re.search("var streamConnectionUrl = '([^']+)'", r, re.DOTALL)
|
230
|
293
|
if m:
|
231
|
294
|
data2 = m.group(1)
|
232
|
295
|
else:
|
233
|
|
- return ("No stream found %s"%data,"","","No stream found")
|
234
|
|
- m = re.search('program_title = "([^"]+)"', r, re.DOTALL)
|
|
296
|
+ raise Exception("No stream found")
|
|
297
|
+ m = re.search('title: "([^"]+)"', r, re.DOTALL)
|
235
|
298
|
title = m.group(1) if m else data2
|
236
|
|
- m = re.search('<a class="episode">Pārraides laiks ēterā: <span>([^<]+)</span></a>', r, re.DOTALL)
|
237
|
|
- datums = m.group(1) if m else ""
|
238
|
|
- title = title + " " + datums
|
239
|
299
|
m = re.search('<div id="panel">([^<]+)<', r, re.DOTALL)
|
240
|
300
|
desc = m.group(1) if m else title
|
241
|
301
|
m = re.search('<div id="panel">([^<]+)<', r, re.DOTALL)
|
242
|
302
|
desc = m.group(1) if m else title
|
243
|
|
- m = re.search('var share_image *= "([^"]+)', r, re.DOTALL)
|
|
303
|
+ m = re.search('var promo_image *= "([^"]+)', r, re.DOTALL)
|
244
|
304
|
img = m.group(1) if m else ""
|
245
|
|
- return (title,data2,img,desc)
|
|
305
|
+ stream = util.item()
|
|
306
|
+ stream["name"] = title
|
|
307
|
+ stream["url"] = data2
|
|
308
|
+ stream["img"] = img
|
|
309
|
+ stream["desc"] = desc
|
|
310
|
+ stream["resolver"] = "tvdom"
|
|
311
|
+ return [stream]
|
246
|
312
|
|
247
|
313
|
|
248
|
314
|
def is_video(self,data):
|
|
@@ -255,13 +321,6 @@ Referer: https://tvdom.tv/
|
255
|
321
|
else:
|
256
|
322
|
return False
|
257
|
323
|
|
258
|
|
- def call(self, data,headers=headers0,lang=""):
|
259
|
|
- if not lang: lang = self.country
|
260
|
|
- url = API_URL%lang + data
|
261
|
|
- #print "[TVPlay Api] url: ",url
|
262
|
|
- result = []
|
263
|
|
- content = self._http_request(url)
|
264
|
|
- return content
|
265
|
324
|
|
266
|
325
|
if __name__ == "__main__":
|
267
|
326
|
country= "lv"
|