Fix Wstream (di nuovo..)

This commit is contained in:
Alhaziel
2019-10-22 18:58:31 +02:00
committed by marco
parent c082e505fc
commit c14fe12eef
2 changed files with 19 additions and 12 deletions
+2 -2
View File
@@ -8,11 +8,11 @@
"patterns": [ "patterns": [
{ {
"pattern": "wstream\\.video/video\\.php\\?file_code=([a-z0-9A-Z]+)", "pattern": "wstream\\.video/video\\.php\\?file_code=([a-z0-9A-Z]+)",
"url": "http:\/\/wstream.video\/videoj\/\\1" "url": "http:\/\/wstream.video\/\\1"
}, },
{ {
"pattern": "wstream\\.video/(?:embed-|videos/|video/|videow/|videoj/)?([a-z0-9A-Z]+)", "pattern": "wstream\\.video/(?:embed-|videos/|video/|videow/|videoj/)?([a-z0-9A-Z]+)",
"url": "http:\/\/wstream.video\/videoj\/\\1" "url": "http:\/\/wstream.video\/\\1"
} }
], ],
"ignore_urls": [ ] "ignore_urls": [ ]
+8 -1
View File
@@ -33,7 +33,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
data = jsunpack.unpack(post_data) data = jsunpack.unpack(post_data)
logger.info("[wstream.py] data=" + data) logger.info("[wstream.py] data=" + data)
block = scrapertools.find_single_match(data, 'sources:\s*\[[^\]]+\]') block = scrapertools.find_single_match(data, 'sources:\s*\[[^\]]+\]')
if block: data = block if block:
data = block
media_urls = scrapertools.find_multiple_matches(data, '(http.*?\.mp4)') media_urls = scrapertools.find_multiple_matches(data, '(http.*?\.mp4)')
_headers = urllib.urlencode(dict(headers)) _headers = urllib.urlencode(dict(headers))
@@ -46,7 +47,13 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
for video_url in video_urls: for video_url in video_urls:
logger.info("[wstream.py] %s - %s" % (video_url[0], video_url[1])) logger.info("[wstream.py] %s - %s" % (video_url[0], video_url[1]))
logger.info(video_urls)
return video_urls return video_urls
else:
page_urls = scrapertools.find_multiple_matches(data, '''<a href=(?:"|')([^"']+)(?:"|')>''')
if page_urls: page_url = page_urls[-1]
return get_video_url(page_url)
def find_videos(data): def find_videos(data):