Fixes #11572 Not hardcode user-agent for cfscrape
This commit is contained in:
parent
72cb991f90
commit
076e0481f3
@ -24,6 +24,7 @@ from ..utils import (
|
|||||||
lowercase_escape,
|
lowercase_escape,
|
||||||
remove_end,
|
remove_end,
|
||||||
sanitized_Request,
|
sanitized_Request,
|
||||||
|
std_headers,
|
||||||
unified_strdate,
|
unified_strdate,
|
||||||
urlencode_postdata,
|
urlencode_postdata,
|
||||||
xpath_text,
|
xpath_text,
|
||||||
@ -46,7 +47,7 @@ class CrunchyrollBaseIE(InfoExtractor):
|
|||||||
|
|
||||||
# Scrape cookie from cloudfront and insert them
|
# Scrape cookie from cloudfront and insert them
|
||||||
scraper = cfscrape.create_scraper()
|
scraper = cfscrape.create_scraper()
|
||||||
tokens = scraper.get_tokens(self._LOGIN_URL, 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/47.0 (Chrome)')
|
tokens = scraper.get_tokens(self._LOGIN_URL, std_headers['User-Agent'])
|
||||||
self._set_crunchyroll_cookie('cf_clearance', tokens[0]['cf_clearance'])
|
self._set_crunchyroll_cookie('cf_clearance', tokens[0]['cf_clearance'])
|
||||||
self._set_crunchyroll_cookie('__cfduid', tokens[0]['__cfduid'])
|
self._set_crunchyroll_cookie('__cfduid', tokens[0]['__cfduid'])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user