From af5c1c553e0147fad5f386f42058186e1952ee4e Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Fri, 4 Feb 2022 10:25:38 +1300 Subject: [PATCH] [youtube] Fix search extractor Regression introduced in https://github.com/yt-dlp/yt-dlp/commit/16aa9ea41dd0a575c6c2d6945d3f8fe3bb42b327. Closes #2628 Authored-by: coletdjnz --- yt_dlp/extractor/youtube.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index cd9a1b7744..3c2d3347f3 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -4273,7 +4273,7 @@ def _extract_tab_endpoint(self, url, item_id, ytcfg=None, fatal=True, default_cl _SEARCH_PARAMS = None - def _search_results(self, query, params=NO_DEFAULT, client=None): + def _search_results(self, query, params=NO_DEFAULT, default_client='web'): data = {'query': query} if params is NO_DEFAULT: params = self._SEARCH_PARAMS @@ -4294,7 +4294,7 @@ def _search_results(self, query, params=NO_DEFAULT, client=None): data.update(continuation_list[0] or {}) search = self._extract_response( item_id='query "%s" page %s' % (query, page_num), ep='search', query=data, - default_client=client, check_get_keys=check_get_keys) + default_client=default_client, check_get_keys=check_get_keys) slr_contents = traverse_obj(search, *content_keys) yield from self._extract_entries({'contents': list(variadic(slr_contents))}, continuation_list) if not continuation_list[0]: @@ -5402,7 +5402,7 @@ def _real_extract(self, url): if not params: section = None title = join_nonempty(query, section, delim=' - ') - return self.playlist_result(self._search_results(query, params, client='web_music'), title, title) + return self.playlist_result(self._search_results(query, params, default_client='web_music'), title, title) class YoutubeFeedsInfoExtractor(InfoExtractor):