aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-07-23 03:05:16 +0600
committerSergey M․ <dstftw@gmail.com>2015-07-23 03:05:16 +0600
commit993df6bc228ca540bba45e0f5b6041ac9440d695 (patch)
tree0fb4b8170139e051bc76d26335c0355d9639158a /youtube_dl
parent61be92e26a16e24a702c9c65b46f15c375726345 (diff)
[prosiebensat1] Modernize
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/prosiebensat1.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/extractor/prosiebensat1.py b/youtube_dl/extractor/prosiebensat1.py
index 0739234c6..effcf1db3 100644
--- a/youtube_dl/extractor/prosiebensat1.py
+++ b/youtube_dl/extractor/prosiebensat1.py
@@ -11,6 +11,7 @@ from ..compat import (
from ..utils import (
ExtractorError,
determine_ext,
+ float_or_none,
int_or_none,
unified_strdate,
)
@@ -230,7 +231,7 @@ class ProSiebenSat1IE(InfoExtractor):
if video.get('is_protected') is True:
raise ExtractorError('This video is DRM protected.', expected=True)
- duration = float(video['duration'])
+ duration = float_or_none(video.get('duration'))
source_ids = [source['id'] for source in video['sources']]
source_ids_str = ','.join(map(str, source_ids))