DooD Stream, Fix Kodi 18

This commit is contained in:
Alhaziel01
2021-06-01 09:18:58 +02:00
parent e7038d0e58
commit abf92a832f
8 changed files with 30 additions and 30 deletions

View File

@@ -199,7 +199,7 @@ class CloudScraper(Session):
try:
print(dump.dump_all(req).decode('utf-8', errors='backslashreplace'))
except ValueError as e:
print(f"Debug Error: {getattr(e, 'message', e)}")
print("Debug Error: {}".format(getattr(e, 'message', e)))
# ------------------------------------------------------------------------------- #
# Unescape / decode html entities
@@ -225,10 +225,10 @@ class CloudScraper(Session):
resp._content = brotli.decompress(resp.content)
else:
logging.warning(
f'You\'re running urllib3 {requests.packages.urllib3.__version__}, Brotli content detected, '
'You\'re running urllib3 {}, Brotli content detected, '
'Which requires manual decompression, '
'But option allow_brotli is set to False, '
'We will not continue to decompress.'
'We will not continue to decompress.'.format(requests.packages.urllib3.__version__)
)
return resp
@@ -290,7 +290,7 @@ class CloudScraper(Session):
_ = self._solveDepthCnt
self.simpleException(
CloudflareLoopProtection,
f"!!Loop Protection!! We have tried to solve {_} time(s) in a row."
"!!Loop Protection!! We have tried to solve {} time(s) in a row.".format(_)
)
self._solveDepthCnt += 1
@@ -500,11 +500,11 @@ class CloudScraper(Session):
except Exception as e:
self.simpleException(
CloudflareIUAMError,
f"Unable to parse Cloudflare anti-bots page: {getattr(e, 'message', e)}"
"Unable to parse Cloudflare anti-bots page: {}".format(getattr(e, 'message', e))
)
return {
'url': f"{hostParsed.scheme}://{hostParsed.netloc}{self.unescape(formPayload['challengeUUID'])}",
'url': "{}://{}{}".format(hostParsed.scheme, hostParsed.netloc, self.unescape(formPayload['challengeUUID'])),
'data': payload
}
@@ -585,7 +585,7 @@ class CloudScraper(Session):
hostParsed = urlparse(url)
return {
'url': f"{hostParsed.scheme}://{hostParsed.netloc}{self.unescape(formPayload['challengeUUID'])}",
'url': "{}://{}{}".format(hostParsed.scheme, hostParsed.netloc, self.unescape(formPayload['challengeUUID'])),
'data': dataPayload
}
@@ -695,7 +695,7 @@ class CloudScraper(Session):
cloudflare_kwargs,
'headers',
{
'Origin': f'{urlParsed.scheme}://{urlParsed.netloc}',
'Origin': '{}://{}'.format(urlParsed.scheme, urlParsed.netloc),
'Referer': resp.url
}
)
@@ -793,7 +793,7 @@ class CloudScraper(Session):
resp = scraper.get(url, **kwargs)
resp.raise_for_status()
except Exception:
logging.error(f'"{url}" returned an error. Could not collect tokens.')
logging.error('"{}" returned an error. Could not collect tokens.'.format(url))
raise
domain = urlparse(resp.url).netloc
@@ -801,7 +801,7 @@ class CloudScraper(Session):
cookie_domain = None
for d in scraper.cookies.list_domains():
if d.startswith('.') and d in (f'.{domain}'):
if d.startswith('.') and d in ('.{}'.format(domain)):
cookie_domain = d
break
else:
@@ -834,9 +834,9 @@ class CloudScraper(Session):
if ssl.OPENSSL_VERSION_INFO < (1, 1, 1):
print(
f"DEPRECATION: The OpenSSL being used by this python install ({ssl.OPENSSL_VERSION}) does not meet the minimum supported "
"DEPRECATION: The OpenSSL being used by this python install ({}) does not meet the minimum supported "
"version (>= OpenSSL 1.1.1) in order to support TLS 1.3 required by Cloudflare, "
"You may encounter an unexpected Captcha or cloudflare 1020 blocks."
"You may encounter an unexpected Captcha or cloudflare 1020 blocks.".format(ssl.OPENSSL_VERSION)
)
# ------------------------------------------------------------------------------- #