Skip to content

Commit

Permalink
[twitter] pass referer with card request(closes #18579)
Browse files Browse the repository at this point in the history
  • Loading branch information
remitamine authored and lkho committed Dec 24, 2018
1 parent 8be8c16 commit f5892c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion youtube_dl/extractor/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ def _real_extract(self, url):
urls.append('https://twitter.com/i/videos/' + video_id)

for u in urls:
webpage = self._download_webpage(u, video_id)
webpage = self._download_webpage(
u, video_id, headers={'Referer': 'https://twitter.com/'})

iframe_url = self._html_search_regex(
r'<iframe[^>]+src="((?:https?:)?//(?:www\.youtube\.com/embed/[^"]+|(?:www\.)?vine\.co/v/\w+/card))"',
Expand Down

0 comments on commit f5892c4

Please sign in to comment.