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