aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2018-12-18 22:46:19 +0100
committerRemita Amine <remitamine@gmail.com>2018-12-18 22:49:01 +0100
commit65e29cdac3f3ee14e07c200293438426b1135719 (patch)
tree23ffa1fa8ff9633f100231864cb86b5c35284d95 /youtube_dl
parent4ee184545455d1ebf4a9f97f86ade2c4a3b3e03b (diff)
[twitter] pass referer with card request(closes #18579)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/twitter.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/extractor/twitter.py b/youtube_dl/extractor/twitter.py
index de41065d6..41d0b6be8 100644
--- a/youtube_dl/extractor/twitter.py
+++ b/youtube_dl/extractor/twitter.py
@@ -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))"',