X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fsrf.py;h=77eec0bc737885e22c77fd8fd3f97bb57ff31ec8;hb=dc455a5f88d6bb9bd5a44352e2b67ef7dd5fd683;hp=2ac55dcd18545873480869dcc9b7ff0b122913e7;hpb=fbbb2194097afcc3d3fb4f28888279f1b970b253;p=youtube-dl diff --git a/youtube_dl/extractor/srf.py b/youtube_dl/extractor/srf.py index 2ac55dcd1..77eec0bc7 100644 --- a/youtube_dl/extractor/srf.py +++ b/youtube_dl/extractor/srf.py @@ -11,7 +11,7 @@ from ..utils import ( class SrfIE(InfoExtractor): - _VALID_URL = r'http://www\.srf\.ch/play(?:er)?/tv/[^/]+/video/(?P[^?]+)\?id=(?P[0-9a-f\-]{36})' + _VALID_URL = r'https?://(?:www\.srf\.ch/play(?:er)?/tv/[^/]+/video/(?P[^?]+)\?id=|tp\.srgssr\.ch/p/flash\?urn=urn:srf:ais:video:)(?P[0-9a-f\-]{36})' _TESTS = [{ 'url': 'http://www.srf.ch/play/tv/10vor10/video/snowden-beantragt-asyl-in-russland?id=28e1a57d-5b76-4399-8ab3-9097f071e6c5', 'md5': '4cd93523723beff51bb4bee974ee238d', @@ -26,31 +26,31 @@ class SrfIE(InfoExtractor): }, { # No Speichern (Save) button 'url': 'http://www.srf.ch/play/tv/top-gear/video/jaguar-xk120-shadow-und-tornado-dampflokomotive?id=677f5829-e473-4823-ac83-a1087fe97faa', + 'md5': 'd97e236e80d1d24729e5d0953d276a4f', 'info_dict': { 'id': '677f5829-e473-4823-ac83-a1087fe97faa', 'display_id': 'jaguar-xk120-shadow-und-tornado-dampflokomotive', - 'ext': 'mp4', + 'ext': 'flv', 'upload_date': '20130710', 'title': 'Jaguar XK120, Shadow und Tornado-Dampflokomotive', 'timestamp': 1373493600, }, - 'params': { - # Require ffmpeg/avconv - 'skip_download': True, - } }, { 'url': 'http://www.srf.ch/player/tv/10vor10/video/snowden-beantragt-asyl-in-russland?id=28e1a57d-5b76-4399-8ab3-9097f071e6c5', 'only_matching': True, + }, { + 'url': 'https://tp.srgssr.ch/p/flash?urn=urn:srf:ais:video:28e1a57d-5b76-4399-8ab3-9097f071e6c5', + 'only_matching': True, }] def _real_extract(self, url): video_id = self._match_id(url) + display_id = re.match(self._VALID_URL, url).group('display_id') or video_id video_data = self._download_xml( 'http://il.srgssr.ch/integrationlayer/1.0/ue/srf/video/play/%s.xml' % video_id, - video_id) + display_id) - display_id = re.match(self._VALID_URL, url).group('display_id') title = xpath_text( video_data, './AssetMetadatas/AssetMetadata/title', fatal=True) thumbnails = [{ @@ -68,10 +68,10 @@ class SrfIE(InfoExtractor): format_id = '%s-%s' % (quality, item.attrib['protocol']) if original_ext == 'f4m': formats.extend(self._extract_f4m_formats( - full_url + '?hdcore=3.4.0', video_id, f4m_id=format_id)) + full_url + '?hdcore=3.4.0', display_id, f4m_id=format_id)) elif original_ext == 'm3u8': formats.extend(self._extract_m3u8_formats( - full_url, video_id, 'mp4', m3u8_id=format_id)) + full_url, display_id, 'mp4', m3u8_id=format_id)) else: formats.append({ 'url': full_url,