projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c114851
)
[twitch] Don't pollute default headers dict
author
Sergey M․
<dstftw@gmail.com>
Mon, 17 Sep 2018 15:14:28 +0000
(22:14 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Mon, 17 Sep 2018 15:14:28 +0000
(22:14 +0700)
youtube_dl/extractor/twitch.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/twitch.py
b/youtube_dl/extractor/twitch.py
index 26661fdf635c2891fad68e695595e45b1aad0e51..401615683dc9b22e4110a6db06dd959c524d96f9 100644
(file)
--- 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))