aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-09-17 22:14:28 +0700
committerSergey M․ <dstftw@gmail.com>2018-09-17 22:14:28 +0700
commite2f61598be49b75f16b501f7a4d24f4c8c230c49 (patch)
treeffc3a66afa4ce900c485b52b60bc823ca7abc157 /youtube_dl
parentc11485162bcbf6f517fd9225850a048fc5f7cec1 (diff)
[twitch] Don't pollute default headers dict
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/twitch.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py
index 26661fdf6..401615683 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -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))