aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2021-01-15 10:32:01 +0100
committerRemita Amine <remitamine@gmail.com>2021-01-15 10:32:01 +0100
commit9d50f862323ed3d7c1ccd014c16d5d25b05de925 (patch)
tree2134cc44f74110e649a074eeada79df3a4f7bc18 /youtube_dl/extractor
parent7e92f9015efe97352e824bb593bd810721f4a604 (diff)
[twitter] Add tests for more cards
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/twitter.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/youtube_dl/extractor/twitter.py b/youtube_dl/extractor/twitter.py
index ec99dfccd..ed495f297 100644
--- a/youtube_dl/extractor/twitter.py
+++ b/youtube_dl/extractor/twitter.py
@@ -407,6 +407,22 @@ class TwitterIE(TwitterBaseIE):
# appplayer card
'url': 'https://twitter.com/poco_dandy/status/1150646424461176832',
'only_matching': True,
+ }, {
+ # video_direct_message card
+ 'url': 'https://twitter.com/qarev001/status/1348948114569269251',
+ 'only_matching': True,
+ }, {
+ # poll2choice_video card
+ 'url': 'https://twitter.com/CAF_Online/status/1349365911120195585',
+ 'only_matching': True,
+ }, {
+ # poll3choice_video card
+ 'url': 'https://twitter.com/SamsungMobileSA/status/1348609186725289984',
+ 'only_matching': True,
+ }, {
+ # poll4choice_video card
+ 'url': 'https://twitter.com/SouthamptonFC/status/1347577658079641604',
+ 'only_matching': True,
}]
def _real_extract(self, url):
@@ -517,7 +533,9 @@ class TwitterIE(TwitterBaseIE):
elif card_name == 'unified_card':
media_entities = self._parse_json(get_binding_value('unified_card'), twid)['media_entities']
extract_from_video_info(next(iter(media_entities.values())))
- # amplify, promo_video_website, promo_video_convo, appplayer, ...
+ # amplify, promo_video_website, promo_video_convo, appplayer,
+ # video_direct_message, poll2choice_video, poll3choice_video,
+ # poll4choice_video, ...
else:
is_amplify = card_name == 'amplify'
vmap_url = get_binding_value('amplify_url_vmap') if is_amplify else get_binding_value('player_stream_url')