X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fplaytvak.py;h=1e8096a259ad5568d87b96bd566f646ae641862f;hb=9558dcec9c7806c811f4fe8e7758977eaa01a702;hp=4e5034dc61529a5a379bf7120d174175443f2676;hpb=d90e4bdb7403245f84985dc5ad5f281e3b060dfb;p=youtube-dl diff --git a/youtube_dl/extractor/playtvak.py b/youtube_dl/extractor/playtvak.py index 4e5034dc6..1e8096a25 100644 --- a/youtube_dl/extractor/playtvak.py +++ b/youtube_dl/extractor/playtvak.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_urlparse, - compat_urllib_parse, + compat_urllib_parse_urlencode, ) from ..utils import ( ExtractorError, @@ -71,6 +71,19 @@ class PlaytvakIE(InfoExtractor): 'upload_date': '20150808', 'is_live': False, } + }, { # metro.cz + 'url': 'http://www.metro.cz/video-pod-billboardem-se-na-vltavske-roztocil-kolotoc-deti-vozil-jen-par-hodin-1hx-/metro-extra.aspx?c=A141111_173251_metro-extra_row', + 'md5': '84fc1deedcac37b7d4a6ccae7c716668', + 'info_dict': { + 'id': 'A141111_173251_metro-extra_row', + 'ext': 'mp4', + 'title': 'Recesisté udělali z billboardu kolotoč', + 'description': 'md5:7369926049588c3989a66c9c1a043c4c', + 'thumbnail': 're:(?i)^https?://.*\.(?:jpg|png)$', + 'timestamp': 1415725500, + 'upload_date': '20141111', + 'is_live': False, + } }, { 'url': 'http://www.playtvak.cz/embed.aspx?idvideo=V150729_141549_play-porad_kuko', 'only_matching': True, @@ -93,7 +106,7 @@ class PlaytvakIE(InfoExtractor): }) info_url = compat_urlparse.urlunparse( - parsed_url._replace(query = compat_urllib_parse.urlencode(qs, True))) + parsed_url._replace(query=compat_urllib_parse_urlencode(qs, True))) json_info = self._download_json( info_url, video_id, @@ -107,7 +120,7 @@ class PlaytvakIE(InfoExtractor): if not item: raise ExtractorError('No suitable stream found') - quality = qualities(['low', 'middle', 'high']) + quality = qualities(('low', 'middle', 'high')) formats = [] for fmt in item['video']: @@ -119,7 +132,7 @@ class PlaytvakIE(InfoExtractor): format_id = '%s_%s' % (format_, fmt['quality']) preference = None - if format_ in ['mp4', 'webm']: + if format_ in ('mp4', 'webm'): ext = format_ elif format_ == 'rtmp': ext = 'flv' @@ -146,6 +159,8 @@ class PlaytvakIE(InfoExtractor): is_live = item['type'] == 'stream' if is_live: title = self._live_title(title) + description = self._og_search_description(webpage, default=None) or self._html_search_meta( + 'description', webpage, 'description') timestamp = None duration = None if not is_live: @@ -157,7 +172,7 @@ class PlaytvakIE(InfoExtractor): return { 'id': video_id, 'title': title, - 'description': self._og_search_description(webpage), + 'description': description, 'thumbnail': item.get('image'), 'duration': duration, 'timestamp': timestamp,