From 378b1c46356629fee91608328f3dafe57516227f Mon Sep 17 00:00:00 2001 From: lkho Date: Mon, 12 Oct 2020 00:37:30 +0800 Subject: [PATCH] [viu:ott] substitute duration from api data --- youtube_dl/extractor/viu.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/viu.py b/youtube_dl/extractor/viu.py index 2bea6b719..b809d3d00 100644 --- a/youtube_dl/extractor/viu.py +++ b/youtube_dl/extractor/viu.py @@ -320,7 +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)) - query.update({'duration': '9999999', 'duration_start': '0'}) + query.update({ + 'duration': video_data.get('time_duration', '9999999'), + 'duration_start': '0' + }) stream_url = temp._replace(query=compat_urlparse.urlencode(query)).geturl() formats.append({