From 9c7e93ecf8768f9c6b310f89a5e8bc69aba555e3 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Mon, 6 Sep 2021 12:58:27 -0700 Subject: Redo av codec settings & selections to accomodate webm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows for ranked preferences for h264, av1, and vp9 codecs in settings, along with equal preferences which are tiebroken using smaller file size. For each quality, gives av-merge a list of video sources and audio sources sorted based on preference & file size. It will pick the first one that the browser supports. Closes #84 Signed-off-by: Jesús --- youtube/yt_data_extract/watch_extraction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'youtube/yt_data_extract/watch_extraction.py') diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py index e0af28e..c73033c 100644 --- a/youtube/yt_data_extract/watch_extraction.py +++ b/youtube/yt_data_extract/watch_extraction.py @@ -420,7 +420,7 @@ def _extract_formats(info, player_response): fmt['vcodec'] = None fmt['width'] = yt_fmt.get('width') fmt['height'] = yt_fmt.get('height') - fmt['file_size'] = yt_fmt.get('contentLength') + fmt['file_size'] = extract_int(yt_fmt.get('contentLength')) fmt['audio_sample_rate'] = extract_int(yt_fmt.get('audioSampleRate')) fmt['duration_ms'] = yt_fmt.get('approxDurationMs') fmt['fps'] = yt_fmt.get('fps') -- cgit v1.2.3