projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ee1845
)
[twitter] pass referer with card request(closes #18579)
author
Remita Amine
<remitamine@gmail.com>
Tue, 18 Dec 2018 21:46:19 +0000
(22:46 +0100)
committer
Remita Amine
<remitamine@gmail.com>
Tue, 18 Dec 2018 21:49:01 +0000
(22:49 +0100)
youtube_dl/extractor/twitter.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/twitter.py
b/youtube_dl/extractor/twitter.py
index de41065d64921af6e861775f85dc5f3011caa524..41d0b6be8c8654bba8db336e1032f95abdc72e05 100644
(file)
--- 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))"',