To Reproduce
Steps to reproduce the behavior:
What code / cli command are you executing?
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.proxies import GenericProxyConfig
api = YouTubeTranscriptApi(
proxy_config=GenericProxyConfig(
http_url="socks5://127.0.0.1:1080",
https_url="socks5://127.0.0.1:1080",
)
)
api.fetch("dQw4w9WgXcQ")
Which Python version are you using?
Python 3.13
Which version of youtube-transcript-api are you using?
youtube-transcript-api 1.2.4
Expected behavior
The request should succeed (or at least attempt to connect) through the SOCKS proxy.
Actual behaviour
Instead I received the following error message:
requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support.
The library documents SOCKS proxy support in proxies.py (the docstring for GenericProxyConfig says it can set up "any generic HTTP/HTTPS/SOCKS proxy") and the README also mentions SOCKS proxies. But it doesn't work out of the box because PySocks is not listed as a dependency.
Root cause: requests (used internally in _api.py) delegates SOCKS proxying to urllib3.contrib.socks.SOCKSProxyManager, which requires PySocks. Without PySocks installed, requests raises InvalidSchema("Missing dependencies for SOCKS support.").
Workaround: pip install PySocks
Suggested fix: Either add PySocks as an optional dependency (e.g. youtube-transcript-api[socks]) or note in the docs that SOCKS proxies require installing PySocks separately.
To Reproduce
Steps to reproduce the behavior:
What code / cli command are you executing?
Which Python version are you using?
Python 3.13
Which version of youtube-transcript-api are you using?
youtube-transcript-api 1.2.4
Expected behavior
The request should succeed (or at least attempt to connect) through the SOCKS proxy.
Actual behaviour
Instead I received the following error message:
The library documents SOCKS proxy support in
proxies.py(the docstring forGenericProxyConfigsays it can set up "any generic HTTP/HTTPS/SOCKS proxy") and the README also mentions SOCKS proxies. But it doesn't work out of the box becausePySocksis not listed as a dependency.Root cause:
requests(used internally in_api.py) delegates SOCKS proxying tourllib3.contrib.socks.SOCKSProxyManager, which requiresPySocks. WithoutPySocksinstalled,requestsraisesInvalidSchema("Missing dependencies for SOCKS support.").Workaround:
pip install PySocksSuggested fix: Either add
PySocksas an optional dependency (e.g.youtube-transcript-api[socks]) or note in the docs that SOCKS proxies require installing PySocks separately.