aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-02-28 20:05:58 +0600
committerSergey M․ <dstftw@gmail.com>2016-02-28 20:05:58 +0600
commit6c10dbeae948b491b538f70481ee5b348a636067 (patch)
tree18d50c083ebf837192d88b55fd069cfcd056131e /youtube_dl
parent9173202b84ea303c83c30b7305a1dcec5ccbe9e6 (diff)
[screenwavemedia] Improve formats extraction
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/screenwavemedia.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/youtube_dl/extractor/screenwavemedia.py b/youtube_dl/extractor/screenwavemedia.py
index 2cf210e0d..d2af26c1c 100644
--- a/youtube_dl/extractor/screenwavemedia.py
+++ b/youtube_dl/extractor/screenwavemedia.py
@@ -70,19 +70,19 @@ class ScreenwaveMediaIE(InfoExtractor):
formats = []
for source in sources:
- if source['type'] == 'hls':
- formats.extend(self._extract_m3u8_formats(source['file'], video_id, ext='mp4'))
+ file_ = source.get('file')
+ if not file_:
+ continue
+ if source.get('type') == 'hls':
+ formats.extend(self._extract_m3u8_formats(file_, video_id, ext='mp4'))
else:
- file_ = source.get('file')
- if not file_:
- continue
format_label = source.get('label')
format_id = self._search_regex(
r'_(.+?)\.[^.]+$', file_, 'format id', default=None)
height = int_or_none(self._search_regex(
r'^(\d+)[pP]', format_label, 'height', default=None))
formats.append({
- 'url': source['file'],
+ 'url': file_,
'format_id': format_id,
'format': format_label,
'ext': source.get('type'),