[safari] Don't pollute std_headers (#8778)
authorYen Chi Hsuan <yan12125@gmail.com>
Sun, 6 Mar 2016 09:38:39 +0000 (17:38 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sun, 6 Mar 2016 09:38:39 +0000 (17:38 +0800)
youtube_dl/extractor/safari.py

index 7de7b7273523ea8a43a6d22e8ab684afb4fc5875..a65fc8ed706efa02e4d008494ea8269c10ad8b3a 100644 (file)
@@ -36,12 +36,13 @@ class SafariBaseIE(InfoExtractor):
         if username is None:
             self.raise_login_required('safaribooksonline.com account is required')
 
-        headers = std_headers
+        headers = std_headers.copy()
         if 'Referer' not in headers:
             headers['Referer'] = self._LOGIN_URL
+        login_page_request = sanitized_Request(self._LOGIN_URL, headers=headers)
 
         login_page = self._download_webpage(
-            self._LOGIN_URL, None,
+            login_page_request, None,
             'Downloading login form')
 
         csrf = self._html_search_regex(