Browse Source

[twitch] Don't pollute default headers dict

master-ytdl-org
Sergey M․ 6 years ago
parent
commit
e2f61598be
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      youtube_dl/extractor/twitch.py

+ 3
- 1
youtube_dl/extractor/twitch.py View File

@ -51,7 +51,9 @@ class TwitchBaseIE(InfoExtractor):
expected=True)
def _call_api(self, path, item_id, *args, **kwargs):
kwargs.setdefault('headers', {})['Client-ID'] = self._CLIENT_ID
headers = kwargs.get('headers', {}).copy()
headers['Client-ID'] = self._CLIENT_ID
kwargs['headers'] = headers
response = self._download_json(
'%s/%s' % (self._API_BASE, path), item_id,
*args, **compat_kwargs(kwargs))


Loading…
Cancel
Save