From c35602602583f63d2fef6251e0143d001ae447fd Mon Sep 17 00:00:00 2001 From: Crypto90 Date: Wed, 1 Jul 2020 12:23:31 +0200 Subject: [PATCH] Update common.py Added video duration variable to url_result() --- youtube_dl/extractor/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index a61753b17..96300036b 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -941,7 +941,7 @@ class InfoExtractor(object): # Methods for following #608 @staticmethod - def url_result(url, ie=None, video_id=None, video_title=None): + def url_result(url, ie=None, video_id=None, video_title=None, video_duration=None): """Returns a URL that points to a page that should be processed""" # TODO: ie should be the class used for getting the info video_info = {'_type': 'url', @@ -951,6 +951,8 @@ class InfoExtractor(object): video_info['id'] = video_id if video_title is not None: video_info['title'] = video_title + if video_duration is not None: + video_info['duration'] = video_duration return video_info def playlist_from_matches(self, matches, playlist_id=None, playlist_title=None, getter=None, ie=None):