From: nyuszika7h Date: Wed, 2 Jan 2019 16:46:07 +0000 (+0100) Subject: [discovery] Use geo verification headers X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=2122d7151deca9c7047426320cd73152cb907afa;p=youtube-dl.git [discovery] Use geo verification headers --- diff --git a/youtube_dl/extractor/discovery.py b/youtube_dl/extractor/discovery.py index 44fbc41bb..b70c307a7 100644 --- a/youtube_dl/extractor/discovery.py +++ b/youtube_dl/extractor/discovery.py @@ -94,11 +94,12 @@ class DiscoveryIE(DiscoveryGoBaseIE): })['access_token'] try: + headers = self.geo_verification_headers() + headers['Authorization'] = 'Bearer ' + access_token + stream = self._download_json( 'https://api.discovery.com/v1/streaming/video/' + video_id, - display_id, headers={ - 'Authorization': 'Bearer ' + access_token, - }) + display_id, headers=headers) except ExtractorError as e: if isinstance(e.cause, compat_HTTPError) and e.cause.code in (401, 403): e_description = self._parse_json(