See: https://bugs.gentoo.org/987698 --- a/youtubesearchpython/core/requests.py +++ b/youtubesearchpython/core/requests.py @@ -8,13 +8,13 @@ self.url = None self.data = None self.timeout = 2 - self.proxy = {} + self.proxy = None http_proxy = os.environ.get("HTTP_PROXY") if http_proxy: - self.proxy["http://"] = http_proxy + self.proxy = httpx.Proxy(http_proxy) https_proxy = os.environ.get("HTTPS_PROXY") if https_proxy: - self.proxy["https://"] = https_proxy + self.proxy = httpx.Proxy(https_proxy) def syncPostRequest(self) -> httpx.Response: return httpx.post( @@ -22,5 +22,5 @@ headers={"User-Agent": userAgent}, json=self.data, timeout=self.timeout, - proxies=self.proxy + proxy=self.proxy )