mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
Merge pull request #18419 from ivanostanin/fix-youtube-proxy-passing
fix: pass youtube_proxy as a `GenericProxyConfig` type object
This commit is contained in:
commit
680361a88c
1 changed files with 2 additions and 4 deletions
|
|
@ -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 = {
|
youtube_proxies = GenericProxyConfig(http_url=self.proxy_url, https_url=self.proxy_url)
|
||||||
"http": self.proxy_url,
|
|
||||||
"https": 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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue