[bitchute] Fix extraction by pass custom User-Agent
authorAndrew Udvare <Tatsh@users.noreply.github.com>
Mon, 27 Aug 2018 15:04:56 +0000 (11:04 -0400)
committerSergey M <dstftw@gmail.com>
Mon, 27 Aug 2018 15:04:56 +0000 (22:04 +0700)
youtube_dl/extractor/bitchute.py

index da263714ab62caad78f60b01eb33148f6f9abb99..446a1ab19f93955ab143e729628e4ecf1add9b16 100644 (file)
@@ -33,7 +33,9 @@ class BitChuteIE(InfoExtractor):
         video_id = self._match_id(url)
 
         webpage = self._download_webpage(
-            'https://www.bitchute.com/video/%s' % video_id, video_id)
+            'https://www.bitchute.com/video/%s' % video_id, video_id, headers={
+                'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.57 Safari/537.36',
+            })
 
         title = self._search_regex(
             (r'<[^>]+\bid=["\']video-title[^>]+>([^<]+)', r'<title>([^<]+)'),