|
@@ -31,11 +31,11 @@ h = HTMLParser.HTMLParser()
|
31
|
31
|
class Source(SourceBase):
|
32
|
32
|
|
33
|
33
|
def __init__(self,country="",cfg_path=None):
|
34
|
|
- self.hidden = True # nerāda menu nestrādājošos avotus
|
|
34
|
+ #self.hidden = True # nerāda menu nestrādājošos avotus
|
35
|
35
|
self.name = "cinemalive"
|
36
|
36
|
self.title = "cinemalive.tv"
|
37
|
|
- self.img = "cinemalive..png" #"https://cinemalive.tv/assets/img/logo.png"
|
38
|
|
- self.desc = "cinemalive.tv satura skatīšanās"
|
|
37
|
+ self.img = "cinemalive.png" #"https://cinemalive.tv/assets/img/logo.png"
|
|
38
|
+ self.desc = "Filmas latviski"
|
39
|
39
|
self.country=country
|
40
|
40
|
self.headers = headers2dict("""
|
41
|
41
|
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
|
|
@@ -59,17 +59,22 @@ Accept-Language: en-US,en;q=0.8
|
59
|
59
|
|
60
|
60
|
if clist=="home":
|
61
|
61
|
content.extend([
|
62
|
|
- ("Search", "cinemalive::scripts/search.php?search={0}","","Search"),
|
63
|
|
- ("Filmas latviski - visas", "cinemalive::filmaslatviski/visas/lapa/1","","Filmas latviski - visas"),
|
|
62
|
+ ("Search", "cinemalive::?s={0}","","Search"),
|
|
63
|
+ #("Filmas latviski - visas", "cinemalive::filmaslatviski/","","Filmas latviski - visas"),
|
64
|
64
|
("Filmas angliski", "cinemalive::home_en","","Filmas angliski"),
|
65
|
|
- ("Filmas latviski - jaunākās", "cinemalive::filmaslatviski/jaunakas/lapa/1","","Filmas latviski - jaunākās"),
|
66
|
|
- ("Filmas latviski - vertētākās", "cinemalive::filmaslatviski/vertetakas/lapa/1","","Filmas latviski - vērtētākās"),
|
67
|
|
- ("Filmas latviski - skatitakās", "cinemalive::filmaslatviski/skatitakas/lapa/1","","Filmas latviski - skatītākās"),
|
|
65
|
+ #("Filmas latviski - jaunākās", "cinemalive::filmaslatviski/?get=jaunakas","","Filmas latviski - jaunākās"),
|
|
66
|
+ #("Filmas latviski - vertētākās", "cinemalive::filmaslatviski/?get=vertetakas","","Filmas latviski - vērtētākās"),
|
|
67
|
+ #("Filmas latviski - skatitakās", "cinemalive::filmaslatviski/?get=skatitakas","","Filmas latviski - skatītākās"),
|
|
68
|
+ #("Filmas latviski - animācija", "cinemalive::genre/animacija/","","Filmas latviski - animacijas"),
|
|
69
|
+ #("Filmas latviski - ģimenes", "cinemalive::genre/gimenes/","","Filmas latviski - ģimenes"),
|
68
|
70
|
])
|
69
|
71
|
r = self.call("filmaslatviski")
|
70
|
|
- for item in re.findall(r'<li class="nav-submenu-item"><a href="/([\w/]+)">(.+?)</a></li>', r):
|
|
72
|
+ i0 = r.find('<div class="menu">')
|
|
73
|
+ result = re.findall(r'menu-item-41\d+"><a href="([^"]+)">([^<]+)</a>', r[i0:])
|
|
74
|
+ for item in result:
|
71
|
75
|
title = "Filmas latviski - "+item[1]
|
72
|
|
- data2 = item[0]+"/lapa/1"
|
|
76
|
+ data2 = item[0].replace("https://cinemalive.tv", "") #+"lapa/1/"
|
|
77
|
+ data2 = data2[1:]
|
73
|
78
|
img = self.img
|
74
|
79
|
desc = title
|
75
|
80
|
content.append((title,self.name+"::"+data2,img,desc))
|
|
@@ -77,54 +82,74 @@ Accept-Language: en-US,en;q=0.8
|
77
|
82
|
|
78
|
83
|
elif clist=="home_en":
|
79
|
84
|
content.extend([
|
80
|
|
- ("Search", "cinemalive::scripts/search.php?search={0}","","Search"),
|
81
|
|
- ("Movies English - all", "cinemalive::moviesenglish/all/page/1","","Movies English - all"),
|
82
|
|
- ("Movies Latvian", "cinemalive::home","","Filmas latviski"),
|
83
|
|
- ("Movies English - newest", "cinemalive::moviesenglish/newestmovies/page/1","","Movies English - newest"),
|
84
|
|
- ("Movies English - top rated", "cinemalive::moviesenglish/toprated/page/1","","Movies English - top rated"),
|
85
|
|
- ("Movies English - most watched", "cinemalive::moviesenglish/mostwatched/page/1","","Movies English - most watched"),
|
|
85
|
+ ("Search", "cinemalive::?s={0}","","Search"),
|
|
86
|
+ #("Movies English - all", "cinemalive::moviesenglish/all/page/1","","Movies English - all"),
|
|
87
|
+ #("Movies Latvian", "cinemalive::home","","Filmas latviski"),
|
|
88
|
+ #("Movies English - newest", "cinemalive::moviesenglish/newestmovies/page/1","","Movies English - newest"),
|
|
89
|
+ #("Movies English - top rated", "cinemalive::moviesenglish/toprated/page/1","","Movies English - top rated"),
|
|
90
|
+ #("Movies English - most watched", "cinemalive::moviesenglish/mostwatched/page/1","","Movies English - most watched"),
|
86
|
91
|
])
|
87
|
92
|
r = self.call("moviesenglish")
|
88
|
|
- for item in re.findall(r'<li class="nav-submenu-item"><a href="/([\w/]+)">(.+?)</a></li>', r):
|
|
93
|
+ i0 = r.find('<div class="menu">')
|
|
94
|
+ result = re.findall(r'menu-item-4[23]\d+"><a href="([^"]+)">([^<]+)</a>', r[i0:])
|
|
95
|
+ for item in result:
|
89
|
96
|
title = "Movies English - "+item[1]
|
90
|
|
- data2 = item[0]+"/page/1"
|
|
97
|
+ data2 = item[0].replace("https://cinemalive.tv", "") #+"lapa/1/"
|
|
98
|
+ data2 = data2[1:]
|
|
99
|
+ if not (data2.startswith("movie") or data2.startswith("genre")):continue
|
91
|
100
|
img = self.img
|
92
|
101
|
desc = title
|
93
|
102
|
content.append((title,self.name+"::"+data2,img,desc))
|
94
|
103
|
return content
|
95
|
104
|
|
96
|
105
|
|
97
|
|
- elif "search.php" in data:
|
|
106
|
+ elif clist == "" in data:
|
|
107
|
+ r = self.call(data)
|
|
108
|
+ result = re.findall("<article>(.+?)</article>", r)
|
|
109
|
+ for r2 in result:
|
|
110
|
+ m = re.search('<div class="title"><a href="https://cinemalive.tv/([^"]+)">(.+?)</a></div>', r2)
|
|
111
|
+ title = m.group(2)
|
|
112
|
+ data2 = m.group(1)
|
|
113
|
+ title = re.sub("<[^>]+>", "", title)
|
|
114
|
+ m = re.search('<img src="([^"]+)"', r2)
|
|
115
|
+ img = m.group(1).replace("-150x150", "-185x278") if m else ""
|
|
116
|
+ m = re.search(r'<span class="year">(\d+)</span>', r2)
|
|
117
|
+ year = m.group(1) if m else ""
|
|
118
|
+ if year:
|
|
119
|
+ title = title + "(%s)" % year
|
|
120
|
+ m = re.search(r"url\(https://cinemalive\.tv/static_main/assets/img/flags/(\w+)\.png\)", r2)
|
|
121
|
+ flag = m.group(1) if m else ""
|
|
122
|
+ if flag:
|
|
123
|
+ title = title + "[%s]" % flag
|
|
124
|
+ m = re.search('<div class="contenido"><p>([^<]+)</p>', r2)
|
|
125
|
+ desc = m.group(1) if m else ""
|
98
|
126
|
|
99
|
|
- r=self.call(path,params=params[1:],headers=self.headers2)
|
100
|
|
- result = re.findall(r'<div class="results.+?<a href="https://cinemalive\.tv/(.+?)">.+?<img src="(.+?)".+?<span style="color:#bcbcbc">([^<]+)</span> <span style="color:#5a606d;font-size:12px;">([^<]+)</span><br/>.+?<p class="dec" style="font-size:12px; color:#777;line-height:14px;">([^<]+)</p>', r, re.DOTALL)
|
101
|
|
- for item in result:
|
102
|
|
- title = item[2]
|
103
|
|
- title0 = re.sub(" \(\d+\)","",title)
|
104
|
|
- if title0 == item[3]:
|
105
|
|
- title = title+" [EN]"
|
106
|
|
- else:
|
107
|
|
- title = title + "/"+ item[3]+" [LV]"
|
108
|
|
- title = util.unescape(title)
|
109
|
|
- data2 = item[0]
|
110
|
|
- img = item[1].replace("xs.","sm.")
|
111
|
|
- desc = util.unescape(item[4])
|
112
|
127
|
content.append((title,self.name+"::"+data2,img,desc))
|
113
|
128
|
return content
|
114
|
129
|
|
115
|
|
- elif clist in ("filmaslatviski","moviesenglish"):
|
116
|
|
- r = self.call(data)
|
117
|
|
- if not r:
|
|
130
|
+ elif clist in ("filmaslatviski","moviesenglish", "genre"):
|
|
131
|
+ r0 = self.call(data)
|
|
132
|
+ if not r0:
|
118
|
133
|
return content
|
119
|
|
- result = re.findall(r'<div class="base-used">.+?<a href="https://cinemalive.tv/([^"]+)">.+?<img class="img-thumbnail" src="/([^"]+)" alt="([^"]+)"/>.+?<p class="year">(\d+)</p>', r, re.DOTALL)
|
120
|
|
- for item in result:
|
121
|
|
- title = item[2] + " (%s)"%item[3]
|
122
|
|
- data2 = item[0]
|
123
|
|
- img = "https://cinemalive.tv/"+item[1]
|
124
|
|
- title = util.unescape(title)
|
125
|
|
- desc = title
|
|
134
|
+ #result = re.findall(r'<div class="base-used">.+?<a href="https://cinemalive.tv/([^"]+)">.+?<img class="img-thumbnail" src="/([^"]+)" alt="([^"]+)"/>.+?<p class="year">(\d+)</p>', r, re.DOTALL)
|
|
135
|
+ result = re.findall('<article id="post.+?</article>', r0, re.IGNORECASE)
|
|
136
|
+ for r in result:
|
|
137
|
+ m = re.search('alt="([^"]+)"', r, re.IGNORECASE)
|
|
138
|
+ title = m.group(1)
|
|
139
|
+ m = re.search('class="quality">(.+?)</span>', r, re.IGNORECASE)
|
|
140
|
+ sub = " [%s]" % m.group(1) if m else ""
|
|
141
|
+ m = re.search(r"</h3><span>(\d+)</span>", r, re.IGNORECASE)
|
|
142
|
+ gads = " (%s)" % m.group(1) if m else ""
|
|
143
|
+ title = title + gads + sub
|
|
144
|
+ m = re.search('<h3><a href="https://cinemalive.tv/([^"]+)"', r, re.IGNORECASE)
|
|
145
|
+ data2 = m.group(1)
|
|
146
|
+ m = re.search('img src="([^"]+)"', r, re.IGNORECASE)
|
|
147
|
+ img = m.group(1) if m else ""
|
|
148
|
+ m = re.search('class="texto">([^<]+)<', r, re.IGNORECASE)
|
|
149
|
+ desc = m.group(1)
|
|
150
|
+ #TODO - papildus info no apraksta
|
126
|
151
|
content.append((title,self.name+"::"+data2,img,desc))
|
127
|
|
- m = re.search(r"""<a href='https://cinemalive\.tv/([^']+)' style="border-right:none;">»</a>""", r, re.DOTALL)
|
|
152
|
+ m = re.search(r"""<span class="current">\d+</span><a href='https://cinemalive.tv/([^']+)'""", r0)
|
128
|
153
|
if m:
|
129
|
154
|
data2 = m.group(1)
|
130
|
155
|
content.append(("Next page",self.name+"::"+data2,self.img,"Next page"))
|
|
@@ -150,44 +175,46 @@ Accept-Language: en-US,en;q=0.8
|
150
|
175
|
title0 = re.search("<title>([^<]+)</title>", r).group(1)
|
151
|
176
|
lang = "LV" if "Filma Online Latviski" in title0 else "EN"
|
152
|
177
|
title = title0.replace(" - Filma Online Latviski","").replace(" - Movie Online English HD","")
|
153
|
|
- desc = re.search('<p class="plot">(.+?)</p>', r).group(1)
|
154
|
|
- img = "http://cinemalive.tv"+re.search('<img src="(.+?)" class="img-thumbnail"', r).group(1)
|
155
|
|
-
|
156
|
|
- m = re.search(r'<video id=.+?<source src="([^"]+\.mp4)"', r, re.DOTALL)
|
|
178
|
+ m = re.search(' class="wp-content"><p>(.+?)</p>', r, re.IGNORECASE)
|
|
179
|
+ desc = m.group(1) if m else title
|
|
180
|
+ m = re.search('<div class="poster"><img src="([^"]+)"', r, re.IGNORECASE)
|
|
181
|
+ img = m.group(1) if m else ""
|
|
182
|
+
|
|
183
|
+ # <iframe class="metaframe rptss" src="https://cloudsany.com/i/tqxkulkkcind"
|
|
184
|
+ m = re.search('<iframe class="metaframe rptss" src="([^"]+)"', r, re.IGNORECASE)
|
|
185
|
+ if not m:
|
|
186
|
+ raise Exception("Can not find stream")
|
|
187
|
+ url = m.group(1)
|
|
188
|
+ r = self._http_request(url)
|
|
189
|
+ m = re.search(r"'(https\|.+?jwplayer)'", r)
|
|
190
|
+ if not m:
|
|
191
|
+ raise Exception("Can not find stream")
|
|
192
|
+ p = m.group(1).split("|")
|
|
193
|
+ p0 = m.group(1)
|
|
194
|
+ m = re.search(r"(Latvian)\|label\|(srt)\|(jqfm2sqwar22)\|subtitles", p0)
|
157
|
195
|
if m:
|
158
|
|
- s = util.item()
|
159
|
|
- s["url"] = m.group(1)
|
160
|
|
- s["name"] = util.unescape(title)
|
161
|
|
- s["desc"] = util.unescape(desc)
|
162
|
|
- s["img"] = img
|
163
|
|
- s["type"] = self.stream_type(s["url"])
|
164
|
|
- s["lang"] = lang
|
165
|
|
- return [s]
|
166
|
|
-
|
167
|
|
- #m = re.search('<div class="viboom-overroll"><iframe src="([^"]+)"', r)
|
168
|
|
- #if m:
|
169
|
|
- result = re.findall('<div id="video_container"><iframe.+?src="(.+?)"', r)
|
170
|
|
- if result:
|
171
|
|
- streams = resolve(result[0])
|
172
|
|
- for s in streams:
|
173
|
|
- s["name"] = util.unescape(title)
|
174
|
|
- s["desc"] = util.unescape(desc)
|
175
|
|
- s["img"] = img
|
176
|
|
- s["type"] = self.stream_type(s["url"])
|
177
|
|
- s["lang"] = lang
|
178
|
|
- if len(result)>1:
|
179
|
|
- lang2 = "EN" if lang=="LV" else "LV"
|
180
|
|
- streams2 = resolve(result[1])
|
181
|
|
- for s in streams2:
|
182
|
|
- s["name"] = util.unescape(title)
|
183
|
|
- s["desc"] = util.unescape(desc)
|
184
|
|
- s["img"] = img
|
185
|
|
- s["type"]= self.stream_type(s["url"])
|
186
|
|
- s["lang"] = lang2
|
187
|
|
- streams.append(s)
|
188
|
|
- return streams
|
189
|
|
- else:
|
190
|
|
- return []
|
|
196
|
+ url_sub = "https://cloudsany.com/subtitles/%s.%s" % (m.group(3), m.group(2))
|
|
197
|
+ url_title = m.group(1)
|
|
198
|
+ print url_title
|
|
199
|
+ m = re.search(r"tracks\|(\w+)\|(\w+)\|(\w+)\|files\|(\w+)\|(\w+)\|(\w+)", p0)
|
|
200
|
+ if m:
|
|
201
|
+ #https://dl4.sanii.co/files/8/80mbh8zjyuh61n/video.mp4
|
|
202
|
+ # 0://1v.1u.1t/1s/2/1r/1q.1p
|
|
203
|
+ num = re.search(r"0://1\w\.1\w\.1\w/1\w/(\d+)", r).group(1)
|
|
204
|
+ url = "https://%s.%s.%s/files/%s/%s/%s.%s" % (
|
|
205
|
+ m.group(6), m.group(5), m.group(4), num, m.group(3), m.group(2), m.group(1))
|
|
206
|
+ print url
|
|
207
|
+ x = 1
|
|
208
|
+
|
|
209
|
+ s = util.item()
|
|
210
|
+ s["url"] = url
|
|
211
|
+ s["name"] = util.unescape(title)
|
|
212
|
+ s["desc"] = util.unescape(desc)
|
|
213
|
+ s["img"] = img
|
|
214
|
+ s["type"] = self.stream_type(s["url"])
|
|
215
|
+ s["lang"] = lang
|
|
216
|
+ return [s]
|
|
217
|
+
|
191
|
218
|
|
192
|
219
|
|
193
|
220
|
if __name__ == "__main__":
|