aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/generic.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-06-30 12:01:30 +0100
committerRemita Amine <remitamine@gmail.com>2016-06-30 12:01:30 +0100
commit329179073b93e37ab76e759d1fe96d8f984367f3 (patch)
tree0c1b734c0a21819d099b0278ac55ce6f0108c20e /youtube_dl/extractor/generic.py
parent4d86d2008eeae5d4e75d8f688a666e7b9504bbeb (diff)
[generic] add generic support for twitter:player embeds
Diffstat (limited to 'youtube_dl/extractor/generic.py')
-rw-r--r--youtube_dl/extractor/generic.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py
index 712dd8a94..c2a7f9202 100644
--- a/youtube_dl/extractor/generic.py
+++ b/youtube_dl/extractor/generic.py
@@ -1245,6 +1245,22 @@ class GenericIE(InfoExtractor):
'uploader': 'www.hudl.com',
},
},
+ # twitter:player embed
+ {
+ 'url': 'http://www.theatlantic.com/video/index/484130/what-do-black-holes-sound-like/',
+ 'md5': 'a3e0df96369831de324f0778e126653c',
+ 'info_dict': {
+ 'id': '4909620399001',
+ 'ext': 'mp4',
+ 'title': 'What Do Black Holes Sound Like?',
+ 'description': 'what do black holes sound like',
+ 'upload_date': '20160524',
+ 'uploader_id': '29913724001',
+ 'timestamp': 1464107587,
+ 'uploader': 'TheAtlantic',
+ },
+ 'add_ie': ['BrightcoveLegacy'],
+ }
]
def report_following_redirect(self, new_url):
@@ -2081,6 +2097,11 @@ class GenericIE(InfoExtractor):
'uploader': video_uploader,
}
+ # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser
+ embed_url = self._twitter_search_player(webpage)
+ if embed_url:
+ return self.url_result(embed_url)
+
def check_video(vurl):
if YoutubeIE.suitable(vurl):
return True