SOCKS proxy via GenericProxyConfig fails with Missing dependencies for SOCKS support

Author: luarssCreated May 30, 2026Updated Aug 29, 2026

To Reproduce

Steps to reproduce the behavior:

What code / cli command are you executing?

python
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.

Source: jdepoix/youtube-transcript-api