From ef867e3759ef417c51adb156c3636b9ada51e48c Mon Sep 17 00:00:00 2001 From: James Taylor Date: Fri, 27 Aug 2021 22:16:36 -0700 Subject: watch: Fix using_pair_sources being a list due to short-circuiting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the case where pair_sources is empty due to a playability error, using_pair_sources will be assigned to pair_sources (empty list) because of short circuiting. Make it a bool Signed-off-by: Jesús --- youtube/watch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'youtube') diff --git a/youtube/watch.py b/youtube/watch.py index 5bb3341..32b6eef 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -578,7 +578,7 @@ def get_watch_page(video_id=None): 'quality') uni_quality = yt_data_extract.deep_get(uni_sources, uni_idx, 'quality') using_pair_sources = ( - pair_sources and (not uni_sources or pair_quality != uni_quality) + bool(pair_sources) and (not uni_sources or pair_quality != uni_quality) ) # 1 second per pixel, or the actual video width -- cgit v1.2.3