mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-09-08 21:45:05 +00:00
[nowtv] Add non-free video check
This commit is contained in:
parent
d9446c7319
commit
9b254aa177
|
@ -120,10 +120,15 @@ class NowTVIE(InfoExtractor):
|
||||||
|
|
||||||
video_id = compat_str(info['id'])
|
video_id = compat_str(info['id'])
|
||||||
|
|
||||||
if info.get('geoblocked'):
|
files = info['files']
|
||||||
raise ExtractorError(
|
if not files:
|
||||||
'Video %s is not available from your location due to geo restriction' % video_id,
|
if info.get('geoblocked', False):
|
||||||
expected=True)
|
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', {})
|
f = info.get('format', {})
|
||||||
station = f.get('station') or station
|
station = f.get('station') or station
|
||||||
|
@ -138,7 +143,7 @@ class NowTVIE(InfoExtractor):
|
||||||
}
|
}
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for item in info['files']['items']:
|
for item in files['items']:
|
||||||
item_path = remove_start(item['path'], '/')
|
item_path = remove_start(item['path'], '/')
|
||||||
tbr = int_or_none(item['bitrate'])
|
tbr = int_or_none(item['bitrate'])
|
||||||
m3u8_url = 'http://hls.fra.%s.de/hls-vod-enc/%s.m3u8' % (STATIONS[station], item_path)
|
m3u8_url = 'http://hls.fra.%s.de/hls-vod-enc/%s.m3u8' % (STATIONS[station], item_path)
|
||||||
|
|
Loading…
Reference in a new issue