From 371ddb14fe651d4a1e5a8310d6d7c0e395cd92b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 16 Jul 2016 15:59:43 +0700 Subject: [PATCH] [extractor/generic] Change twitter:player embeds priority to lowest (Closes #10090) --- youtube_dl/extractor/generic.py | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index cddd1a817..6d346cb1c 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -1249,6 +1249,20 @@ class GenericIE(InfoExtractor): 'uploader': 'www.hudl.com', }, }, + # twitter:player:stream embed + { + 'url': 'http://www.rtl.be/info/video/589263.aspx?CategoryID=288', + 'info_dict': { + 'id': 'master', + 'ext': 'mp4', + 'title': 'Une nouvelle espèce de dinosaure découverte en Argentine', + 'uploader': 'www.rtl.be', + }, + 'params': { + # m3u8 downloads + 'skip_download': True, + }, + }, # twitter:player embed { 'url': 'http://www.theatlantic.com/video/index/484130/what-do-black-holes-sound-like/', @@ -2184,11 +2198,6 @@ class GenericIE(InfoExtractor): 'uploader': video_uploader, } - # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser - embed_url = self._html_search_meta('twitter:player', webpage, default=None) - if embed_url: - return self.url_result(embed_url) - # Looking for http://schema.org/VideoObject json_ld = self._search_json_ld( webpage, video_id, default=None, expected_type='VideoObject') @@ -2245,6 +2254,9 @@ class GenericIE(InfoExtractor): r"cinerama\.embedPlayer\(\s*\'[^']+\',\s*'([^']+)'", webpage) if not found: # Try to find twitter cards info + # twitter:player:stream should be checked before twitter:player since + # it is expected to contain a raw stream (see + # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser) found = filter_video(re.findall( r'