Nuovi domini streamlare e streamsb, possibile fix streamsb

This commit is contained in:
marco
2022-06-22 20:08:46 +02:00
parent 336470cc96
commit f7d661dabf
4 changed files with 17 additions and 17 deletions
+11 -12
View File
@@ -24,18 +24,17 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
if sources:
sources.sort(key=lambda x: int(x[1]), reverse=True)
sources = [(x[1] + 'p', x[0]) for x in sources]
for s in sources:
code, mode, hash = eval(s[1])
dl_url = 'https://{0}/dl?op=download_orig&id={1}&mode={2}&hash={3}'.format(host, code, mode, hash)
data = httptools.downloadpage(dl_url).data
captcha = scrapertools.girc(data, 'https://{0}/'.format(host), base64.b64encode('https://{0}:443'.format(host).encode('utf-8')).decode('utf-8').replace('=', ''))
if captcha:
data = httptools.downloadpage(dl_url, post={'op': 'download_orig', 'id': code, 'mode': mode,
'hash': hash, 'g-recaptcha-response': captcha}, timeout=10).data
media_url = scrapertools.find_single_match(data, 'href="([^"]+)">Direct')
if media_url:
video_urls.append([s[0], media_url])
s = sources[0] # only the first to reduce the number of requests to google recaptcha
code, mode, hash = eval(s[1])
dl_url = 'https://{0}/dl?op=download_orig&id={1}&mode={2}&hash={3}'.format(host, code, mode, hash)
data = httptools.downloadpage(dl_url).data
captcha = scrapertools.girc(data, 'https://{0}/'.format(host), base64.b64encode('https://{0}:443'.format(host).encode('utf-8')).decode('utf-8').replace('=', ''))
if captcha:
data = httptools.downloadpage(dl_url, post={'op': 'download_orig', 'id': code, 'mode': mode,
'hash': hash, 'g-recaptcha-response': captcha}, timeout=10).data
media_url = scrapertools.find_single_match(data, 'href="([^"]+)"[^>]+>Download')
if media_url:
video_urls.append([s[0], media_url])
return video_urls