Repository navigation
feat(ytdlp): add proxy failover setting - #259
Merged
Merged
Conversation
Add ytdlp.proxies, an ordered list of HTTP, HTTPS and SOCKS proxies for yt-dlp. The global and Telegram proxies do not reach the yt-dlp process, and --proxy is rejected in custom flags, so yt-dlp had no way to use a proxy. yt-dlp accepts one proxy, so downloads and media metadata lookups try each configured proxy in turn until one succeeds. Blank and duplicate entries are skipped, cancellation stops the rotation, passwords are redacted in logs and task errors, and partial files left by a failed attempt are not uploaded. Proxy URLs are validated when the yt-dlp settings are saved, and the list is editable in the web settings and imported from a v0 config. Signed-off-by: Ilham Syahid S <ilhamsyahids@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In v1, yt-dlp has no way to use a proxy.
--proxyis rejected in custom flags, and the global proxy and the Telegram proxy only affect Go's HTTP client and the MTProto connection, never the yt-dlp process. Deployments where destinations block the server's IP have no way around it.Change
Adds
ytdlp.proxies, an ordered list of proxy URLs for yt-dlp. Supported schemes:http,https,socks4,socks4a,socks5,socks5h.yt-dlp accepts only one proxy, so the bot rotates for it. Each proxy gets one full yt-dlp run, in the order listed, and the first success is used.
.part,.ytdl,.temp) left by a failed attempt are not uploaded.Settings:
[ytdlp] proxiesentry is imported on first start, as an array or a comma-separated string.Custom flags are unchanged:
--proxystays forbidden there.Docs: a new Proxies section in
docs/content/{en,zh}/usage/ytdlp.md, and the forbidden-flags list there now names--proxy,--cookiesand--netrc.Notes
parser.proxy. The settings masking only handles single text values, not lists. Only the admin can see this response.