tombulled / innertube

Python Client for Google's Private InnerTube API. Works with YouTube, YouTube Music and more!
https://pypi.org/project/innertube/
MIT License
298 stars 20 forks source link

:sparkles: Support Request Proxying #35

Closed tombulled closed 2 years ago

tombulled commented 2 years ago

This PR adds support for proxies

tombulled commented 2 years ago

Here's an example of proxying requests through the Tor network:

from innertube import InnerTube
from pprint import pprint

proxies = {
    "http://": "socks5://127.0.0.1:9050",
    "https://": "socks5://127.0.0.1:9050"
}

client = InnerTube("WEB", proxies=proxies)
>>> pprint(client.adaptor.session.get("https://check.torproject.org/api/ip").json())
{'IP': '1.2.3.4', 'IsTor': True}