Fill in the original function we will patch

This commit is contained in:
tcely authored and GitHub committed 2025-03-16 11:47:32 -04:00
1 parent 3d4d965880
commit 217c0898da
1 file changed
+18 -4
+18 -4
View File
@@ -3,9 +3,23 @@ from yt_dlp.extractor.youtube import YoutubeIE
class PatchedYoutubeIE(YoutubeIE):
def FUNC(self):
pass
def _download_player_responses(self, url, smuggled_data, video_id, webpage_url):
webpage = None
if 'webpage' not in self._configuration_arg('player_skip'):
query = {'bpctr': '9999999999', 'has_verified': '1'}
pp = self._configuration_arg('player_params', [None], casesense=True)[0]
if pp:
query['pp'] = pp
webpage = self._download_webpage_with_retries(webpage_url, video_id, query=query)
master_ytcfg = self.extract_ytcfg(video_id, webpage) or self._get_default_ytcfg()
player_responses, player_url = self._extract_player_responses(
self._get_requested_clients(url, smuggled_data),
video_id, webpage, master_ytcfg, smuggled_data)
return webpage, master_ytcfg, player_responses, player_url
#YoutubeIE.__unpatched__FUNC = YoutubeIE.FUNC
#YoutubeIE.FUNC = PatchedYoutubeIE.FUNC
YoutubeIE.__unpatched___download_player_responses = YoutubeIE._download_player_responses
YoutubeIE._download_player_responses = PatchedYoutubeIE._download_player_responses