Fix Wstream

This commit is contained in:
Alhaziel
2019-10-22 18:58:31 +02:00
parent fd5c33d528
commit a04b06923e
2 changed files with 19 additions and 12 deletions

View File

@@ -8,11 +8,11 @@
"patterns": [
{
"pattern": "wstream\\.video/video\\.php\\?file_code=([a-z0-9A-Z]+)",
"url": "http:\/\/wstream.video\/videok\/\\1"
"url": "http:\/\/wstream.video\/\\1"
},
{
"pattern": "wstream\\.video/(?:embed-|videos/|video/|videow/|videoj/)?([a-z0-9A-Z]+)",
"url": "http:\/\/wstream.video\/videok\/\\1"
"url": "http:\/\/wstream.video\/\\1"
}
],
"ignore_urls": [ ]

View File

@@ -33,20 +33,27 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
data = jsunpack.unpack(post_data)
logger.info("[wstream.py] data=" + data)
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)')
_headers = urllib.urlencode(dict(headers))
i = 0
media_urls = scrapertools.find_multiple_matches(data, '(http.*?\.mp4)')
_headers = urllib.urlencode(dict(headers))
i = 0
for media_url in media_urls:
video_urls.append([vid[i] if vid else 'video' + " mp4 [wstream] ", media_url + '|' + _headers])
i = i + 1
for media_url in media_urls:
video_urls.append([vid[i] if vid else 'video' + " mp4 [wstream] ", media_url + '|' + _headers])
i = i + 1
for video_url in video_urls:
logger.info("[wstream.py] %s - %s" % (video_url[0], video_url[1]))
for video_url in video_urls:
logger.info("[wstream.py] %s - %s" % (video_url[0], video_url[1]))
return video_urls
logger.info(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):