[pbs] de-prioritize AD formats

Related: #2335
This commit is contained in:
pukkandan 2022-01-19 19:00:32 +05:30
parent 8bd1c00bf3
commit baf599effa
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698

View file

@ -545,7 +545,7 @@ def _real_extract(self, url):
for vid_id in video_id] for vid_id in video_id]
return self.playlist_result(entries, display_id) return self.playlist_result(entries, display_id)
info = None info = {}
redirects = [] redirects = []
redirect_urls = set() redirect_urls = set()
@ -660,6 +660,9 @@ def extract_redirect_urls(info):
'protocol': 'http', 'protocol': 'http',
}) })
formats.append(f) 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) self._sort_formats(formats)
rating_str = info.get('rating') rating_str = info.get('rating')