aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-05-27 23:41:43 +0600
committerSergey M․ <dstftw@gmail.com>2015-05-27 23:41:43 +0600
commit9b254aa177d58b7b4c4f44dce8c38fa7978c7df6 (patch)
tree1d19c608c2ab943ded7ff290808a91f2a2e04fdf /youtube_dl
parentd9446c73199d917712e1555fbf662c7542510d0e (diff)
[nowtv] Add non-free video check
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/nowtv.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/youtube_dl/extractor/nowtv.py b/youtube_dl/extractor/nowtv.py
index 5c91acec6..295168432 100644
--- a/youtube_dl/extractor/nowtv.py
+++ b/youtube_dl/extractor/nowtv.py
@@ -120,10 +120,15 @@ class NowTVIE(InfoExtractor):
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 +143,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)