python3 main.py https://www.youtube.com/watch?v=Ay41fytSZQM -f bestaudio/worst --no-playlist --no-geo-bypass --cookies ../cookies/youtube/cookies.txt
yt-dlp-proxy Guide
yt-dlp-proxy is a script designed to help you avoid throttling and bans by automatically selecting the best proxy for yt-dlp.
Howto start with yt-dlp-proxy
yt-dlp-proxy update
This will also perform a speed test for each free proxy and select the best one available.
Download with yt-dlp-proxy
Use yt-dlp-proxy just like you would use yt-dlp! Pass all the arguments to yt-dlp-proxy instead. Example:
yt-dlp-proxy --format bv[vcodec^=avc!]+ba https://www.youtube.com/watch?v=bQB0_4BG-9F
If the proxy becomes slow over time, rerun the command from Step 1 to refresh the proxy selection.
Optional: Symlink and systemwide installation
Setting Up a Symlink for Easier Access
To make yt-dlp-proxy easier to access from anywhere, you can create a symlink in /usr/bin or another directory in your system’s PATH.
Option 1: Create a Symlink in /usr/bin
Open a terminal. Run the following command, replacing /path/to/yt-dlp-proxy with the actual path to the yt-dlp-proxy script:
sudo ln -s /path/to/yt-dlp-proxy /usr/bin/yt-dlp-proxy
Now you can use yt-dlp-proxy from any directory in the terminal.
Option 2: Install to /usr/bin
If you prefer, you can directly move the yt-dlp-proxy script to /usr/bin:
Open a terminal. Run the following command, again replacing /path/to/yt-dlp-proxy with the path to the script:
sudo install /path/to/yt-dlp-proxy /usr/bin/yt-dlp-proxy
This will copy yt-dlp-proxy to /usr/bin, making it globally accessible.
Now, you can simply type yt-dlp-proxy from any location in the terminal to use the script.
Creating custom proxy providers
First you need to create new py file in proxy_providers directory using this code template:
import requests
from proxy_provider import ProxyProvider
class SomeProxyProvider(ProxyProvider):
"""
Someproxy provider
"""
PROXIES_LIST_URL = "https://goodproxies.net/list.json"
def fetch_proxies(self):
"""Fetch proxies from goodproxies.net"""
response = requests.get(self.PROXIES_LIST_URL, timeout=5)
response.raise_for_status()
response_json = response.json()
return_list = []
for server in response_json["data"]["servers"]["10501"]["proxies"]:
return_list.append(
{
"city": "Unknown city",
"country": server["country"].upper(),
"host": server["proxy"].split(":")[0],
"port": server["proxy"].split(":")[1],
"username": response_json["data"]["servers"]["10501"]["credentials"]["username"],
"password": response_json["data"]["servers"]["10501"]["credentials"]["password"]
}
)
return return_list
As you can see, this script uses one json structure for all providers. In example code we've "converted" json response from server to python dictionary, compatible with yt-dlp-proxy. Here is basic example of json structure yt-dlp-proxy uses:
[
{
"city": "City1",
"country": "Country1",
"host": "0.0.0.0",
"password": "password123",
"port": "proxy_port",
"username": "squid_username"
}
]
Please note that all proxy providers are loaded automatically and you don't need to import them manually in main.py
Metadata
Release files for yt-dlp-proxy 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yt_dlp_proxy-1.0.7-py3-none-any.whl | Python 3 | none | any | Details for yt_dlp_proxy-1.0.7-py3-none-any.whl |
Release files / yt_dlp_proxy-1.0.7-py3-none-any.whl
| Download URL | yt_dlp_proxy-1.0.7-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ffaf829816703e1de018f56609b83bbe64950bbc79f4f862954f6ce2529a290
|
|
BLAKE2b-256 checksum How to use checksums |
28884188bd340e7ac67f2d5b77a6e655799ece11ab3769c1ebb409a8bc5aa96f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Security for yt-dlp-proxy 1.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.