From baf599effa414fe927211a2b334365758d88c32b Mon Sep 17 00:00:00 2001 From: pukkandan Date: Wed, 19 Jan 2022 19:00:32 +0530 Subject: [PATCH] [pbs] de-prioritize AD formats Related: #2335 --- yt_dlp/extractor/pbs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/pbs.py b/yt_dlp/extractor/pbs.py index ffaa6bf92..e48a2b8e0 100644 --- a/yt_dlp/extractor/pbs.py +++ b/yt_dlp/extractor/pbs.py @@ -545,7 +545,7 @@ def _real_extract(self, url): for vid_id in video_id] return self.playlist_result(entries, display_id) - info = None + info = {} redirects = [] redirect_urls = set() @@ -660,6 +660,9 @@ def extract_redirect_urls(info): 'protocol': 'http', }) formats.append(f) + for f in formats: + if (f.get('format_note') or '').endswith(' AD'): # Audio description + f['language_preference'] = -10 self._sort_formats(formats) rating_str = info.get('rating')