fix: pass youtube_proxy as a GenericProxyConfig type object

This commit is contained in:
Ivan Ostanin 2025-10-19 02:01:27 +02:00
parent f97e73962a
commit 7d29991fa5
No known key found for this signature in database
GPG key ID: E5EA0CBA7E1EF0B9

View file

@ -83,6 +83,7 @@ class YoutubeLoader:
TranscriptsDisabled,
YouTubeTranscriptApi,
)
from youtube_transcript_api.proxies import (GenericProxyConfig)
except ImportError:
raise ImportError(
'Could not import "youtube_transcript_api" Python package. '
@ -90,10 +91,7 @@ class YoutubeLoader:
)
if self.proxy_url:
youtube_proxies = {
"http": self.proxy_url,
"https": self.proxy_url,
}
youtube_proxies = GenericProxyConfig(http_url=self.proxy_url, https_url=self.proxy_url)
log.debug(f"Using proxy URL: {self.proxy_url[:14]}...")
else:
youtube_proxies = None