Browse Source

[twitter] pass referer with card request(closes #18579)

master-ytdl-org
Remita Amine 6 years ago
parent
commit
65e29cdac3
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      youtube_dl/extractor/twitter.py

+ 2
- 1
youtube_dl/extractor/twitter.py View File

@ -171,7 +171,8 @@ class TwitterCardIE(TwitterBaseIE):
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))"',


Loading…
Cancel
Save