mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 17:22:31 +01:00
[udemy] Don't pollute default headers dict
This commit is contained in:
parent
e2f61598be
commit
c8f6ab8c38
@ -122,7 +122,9 @@ def _handle_error(self, response):
|
||||
raise ExtractorError(error_str, expected=True)
|
||||
|
||||
def _download_webpage_handle(self, *args, **kwargs):
|
||||
kwargs.setdefault('headers', {})['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4'
|
||||
headers = kwargs.get('headers', {}).copy()
|
||||
headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4'
|
||||
kwargs['headers'] = headers
|
||||
return super(UdemyIE, self)._download_webpage_handle(
|
||||
*args, **compat_kwargs(kwargs))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user