From 9960d740397f67ee85b8ebb8d5c19114d4a529a1 Mon Sep 17 00:00:00 2001 From: lkho Date: Sun, 18 Oct 2020 23:01:36 +0800 Subject: [PATCH] [viu:ott] fix duration substitution --- youtube_dl/extractor/viu.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/viu.py b/youtube_dl/extractor/viu.py index b809d3d00..5e70ff128 100644 --- a/youtube_dl/extractor/viu.py +++ b/youtube_dl/extractor/viu.py @@ -320,9 +320,10 @@ class ViuOTTIE(InfoExtractor): if duration_limit: temp = compat_urlparse.urlparse(stream_url) query = dict(compat_urlparse.parse_qsl(temp.query, keep_blank_values=True)) + time_duration = int_or_none(video_data.get('time_duration')) query.update({ - 'duration': video_data.get('time_duration', '9999999'), - 'duration_start': '0' + 'duration': time_duration if time_duration > 0 else '9999999', + 'duration_start': '0', }) stream_url = temp._replace(query=compat_urlparse.urlencode(query)).geturl()