diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py index f1a3145..0bc9e63 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py @@ -58,6 +58,11 @@ def _validate_get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id=None, player_url=None, **kwargs) -> str: self._logger.info('Generating POT via HTTP server') + if (proxy := select_proxy('https://jnn-pa.googleapis.com', self.proxies) + != select_proxy('https://youtube.com', self.proxies)): + self._logger.warning( + 'Proxies for https://youtube.com and https://jnn-pa.googleapis.com are different. ' + 'This is likely to cause subsequent errors.') try: response = ydl.urlopen(Request( @@ -65,7 +70,7 @@ def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id= 'client': client, 'visitor_data': visitor_data, 'data_sync_id': data_sync_id, - 'proxy': select_proxy('http://youtube.com', self.proxies), + 'proxy': proxy, }).encode(), headers={'Content-Type': 'application/json'}, extensions={'timeout': 12.5}, proxies={'all': None})) except Exception as e: diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py index 7fd6bce..7e616a1 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py @@ -58,7 +58,11 @@ def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id= self._logger.info( f'Generating POT via script: {self.script_path}') command_args = ['node', self.script_path] - if proxy := select_proxy('http://youtube.com', self.proxies): + if proxy := select_proxy('https://jnn-pa.googleapis.com', self.proxies): + if proxy != select_proxy('https://youtube.com', self.proxies): + self._logger.warning( + 'Proxies for https://youtube.com and https://jnn-pa.googleapis.com are different. ' + 'This is likely to cause subsequent errors.') command_args.extend(['-p', proxy]) if data_sync_id: command_args.extend(['-d', data_sync_id])