diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-04-16 18:57:50 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-04-16 18:57:50 +0800 |
commit | 36b7d9dbfaf43c357034e8b8792cdd5fb1363fb9 (patch) | |
tree | 3d6e02617bff9bb095d48206dc2eb4fe01faa753 /youtube_dl | |
parent | 8c65e4a52707413607f5f70725ed71053dd257f1 (diff) |
[twitter] Don't check /cards/ URLs
Fixes #9181
In this tweet, there are two cards:
1. https://twitter.com/i/cards/tfw/v1/719944006306701313
This shows #TeamCap vs. #TeamIronMan
2. https://twitter.com/i/videos/tweet/719944021058060289
This is the real video and can be handled by TwitterCardIE
In all current test_Twitter* tests, /videos/tweet/ approach works fine.
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/twitter.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/youtube_dl/extractor/twitter.py b/youtube_dl/extractor/twitter.py index 1f32ea2eb..ea673054f 100644 --- a/youtube_dl/extractor/twitter.py +++ b/youtube_dl/extractor/twitter.py @@ -260,6 +260,17 @@ class TwitterIE(InfoExtractor): 'upload_date': '20140615', }, 'add_ie': ['Vine'], + }, { + 'url': 'https://twitter.com/captainamerica/status/719944021058060289', + # md5 constantly changes + 'info_dict': { + 'id': '719944021058060289', + 'ext': 'mp4', + 'title': 'Captain America - @King0fNerd Are you sure you made the right choice? Find out in theaters.', + 'description': 'Captain America on Twitter: "@King0fNerd Are you sure you made the right choice? Find out in theaters. https://t.co/GpgYi9xMJI"', + 'uploader_id': 'captainamerica', + 'uploader': 'Captain America', + }, }] def _real_extract(self, url): @@ -284,17 +295,6 @@ class TwitterIE(InfoExtractor): 'title': username + ' - ' + title, } - card_id = self._search_regex( - r'["\']/i/cards/tfw/v1/(\d+)', webpage, 'twitter card url', default=None) - if card_id: - card_url = 'https://twitter.com/i/cards/tfw/v1/' + card_id - info.update({ - '_type': 'url_transparent', - 'ie_key': 'TwitterCard', - 'url': card_url, - }) - return info - mobj = re.search(r'''(?x) <video[^>]+class="animated-gif"(?P<more_info>[^>]+)>\s* <source[^>]+video-src="(?P<url>[^"]+)" |