From 076e0481f30322b67ba559c700b5713a08939c1b Mon Sep 17 00:00:00 2001 From: kidburglar Date: Sun, 15 Jan 2017 18:24:46 +0100 Subject: [PATCH] Fixes #11572 Not hardcode user-agent for cfscrape --- youtube_dl/extractor/crunchyroll.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/crunchyroll.py b/youtube_dl/extractor/crunchyroll.py index f8bab638f..9d191de9e 100644 --- a/youtube_dl/extractor/crunchyroll.py +++ b/youtube_dl/extractor/crunchyroll.py @@ -24,6 +24,7 @@ from ..utils import ( lowercase_escape, remove_end, sanitized_Request, + std_headers, unified_strdate, urlencode_postdata, xpath_text, @@ -46,7 +47,7 @@ class CrunchyrollBaseIE(InfoExtractor): # Scrape cookie from cloudfront and insert them 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('__cfduid', tokens[0]['__cfduid'])