X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fextractor%2Fnowtv.py;h=173e46cd8b78dfa0dcdf33b6d3c280bf40a70681;hb=8084be78c50e0e921508f13e69fda34a907dc5f8;hp=5c91acec61f05af3c6feaa6a757b81266a762438;hpb=d9446c73199d917712e1555fbf662c7542510d0e;p=youtube-dl diff --git a/youtube_dl/extractor/nowtv.py b/youtube_dl/extractor/nowtv.py index 5c91acec6..173e46cd8 100644 --- a/youtube_dl/extractor/nowtv.py +++ b/youtube_dl/extractor/nowtv.py @@ -53,6 +53,24 @@ class NowTVIE(InfoExtractor): # m3u8 download 'skip_download': True, }, + }, { + # rtlnitro + 'url': 'http://www.nowtv.de/rtlnitro/alarm-fuer-cobra-11-die-autobahnpolizei/hals-und-beinbruch-2014-08-23-21-10-00/player', + 'info_dict': { + 'id': '165780', + 'display_id': 'alarm-fuer-cobra-11-die-autobahnpolizei/hals-und-beinbruch-2014-08-23-21-10-00', + 'ext': 'mp4', + 'title': 'Hals- und Beinbruch', + 'description': 'md5:b50d248efffe244e6f56737f0911ca57', + 'thumbnail': 're:^https?://.*\.jpg$', + 'timestamp': 1432415400, + 'upload_date': '20150523', + 'duration': 2742, + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, }, { # superrtl 'url': 'http://www.nowtv.de/superrtl/medicopter-117/angst/player', @@ -115,15 +133,20 @@ class NowTVIE(InfoExtractor): station = mobj.group('station') info = self._download_json( - 'https://api.nowtv.de/v3/movies/%s?fields=*,format,files,breakpoints,paymentPaytypes,trailers,pictures' % display_id, + 'https://api.nowtv.de/v3/movies/%s?fields=*,format,files' % display_id, display_id) video_id = compat_str(info['id']) - if info.get('geoblocked'): - raise ExtractorError( - 'Video %s is not available from your location due to geo restriction' % video_id, - expected=True) + files = info['files'] + if not files: + if info.get('geoblocked', False): + raise ExtractorError( + 'Video %s is not available from your location due to geo restriction' % video_id, + expected=True) + if not info.get('free', True): + raise ExtractorError( + 'Video %s is not available for free' % video_id, expected=True) f = info.get('format', {}) station = f.get('station') or station @@ -138,7 +161,7 @@ class NowTVIE(InfoExtractor): } formats = [] - for item in info['files']['items']: + for item in files['items']: item_path = remove_start(item['path'], '/') tbr = int_or_none(item['bitrate']) m3u8_url = 'http://hls.fra.%s.de/hls-vod-enc/%s.m3u8' % (STATIONS[station], item_path)