youwee icon indicating copy to clipboard operation
youwee copied to clipboard

feat: add custom yt-dlp arguments setting

Open miguelAngelo1999 opened this issue 6 months ago • 3 comments

Adds a 'Custom yt-dlp Arguments' field in Settings > Download that appends extra flags to every yt-dlp command. This enables users to pass flags like --no-check-certificates to bypass SSL verification issues.

Changes:

  • Added customYtdlpArgs field to DownloadSettings, ItemDownloadSettings, ItemUniversalSettings
  • Added UI input in Settings > Download section
  • Pass custom args to all yt-dlp invocations: downloads, video info fetch, playlist expansion, transcript fetch
  • Added shell_split_args helper for proper quoted token parsing
  • i18n keys for en, vi, zh-CN

miguelAngelo1999 avatar May 25 '26 20:05 miguelAngelo1999

@miguelAngelo1999 CI fail please re-check and please create branch from master instead of develop. Thanks

vanloctech avatar May 26 '26 04:05 vanloctech

@codex review

vanloctech avatar Jun 06 '26 14:06 vanloctech

Thanks for adding this. Since Youwee is a local desktop app, this is not a direct remote-exploit issue by itself. However, unrestricted raw yt-dlp arguments are still risky because users may copy/paste unsafe flags, and options like --exec, custom downloaders, config files, cookies, paths, proxies, or headers can change filesystem, network, or command execution behavior outside what the app normally controls. I’d prefer we either add an allowlist for safe options or put this behind a clearly labeled advanced/danger mode with validation and warnings.

vanloctech avatar Jun 07 '26 04:06 vanloctech

@vanloctech Thanks for the feedback! I've implemented the safety measures you suggested:

Backend blocklist (Rust-level enforcement):

  • Added validate_custom_ytdlp_args() that rejects dangerous flags before they reach yt-dlp
  • Blocked: --exec, --exec-before-download, --config-location, --batch-file, --download-archive, --cookies, --cookies-from-browser, --load-info-json, --plugin-dirs
  • Returns clear error message to the user if a blocked flag is detected

Frontend warnings:

  • Amber warning banner in settings: "Advanced feature — use with caution"
  • Explains that dangerous flags are automatically blocked
  • Shows the full list of blocked flags below the input

This way users can still use safe flags like --no-check-certificates, --ignore-errors, --geo-bypass, etc., while flags that could execute commands or access sensitive data are blocked at the backend level.

Let me know if you'd like any changes to the blocklist or UI!

miguelAngelo1999 avatar Jun 19 '26 14:06 miguelAngelo1999

Added some safe args in v0.18.0

vanloctech avatar Jul 02 '26 02:07 vanloctech