Add generic-mode URL validation and UI

Introduce a "generic_mode" option to allow validating/downloading from non-YouTube sites and wire it through the UI, config, and validation logic. Key changes:

- Add generic_mode default to ConfigManager and persist setting from DownloadSettingsDialog (checkbox + help text).
- Extend validate_video_url to accept a generic_mode flag and allow any http/https URL with a domain when enabled; pass this flag from Analysis and Download flows.
- Update YTSageApp to load/save generic_mode, update URL placeholder and settings tooltip behavior, and refresh tooltip when settings change.
- Improve robustness in FormatTableMixin: handle None/incorrect types for format_note, abr, resolution, ext, and codec values to avoid type errors and ensure consistent display.
- Add localization entries for generic mode, placeholder, and related help text across multiple language files and update the in-app default localization strings.

These changes enable broader site support via yt-dlp while hardening UI format handling and keeping user settings persistent.
This commit is contained in:
oop7
2026-03-12 11:10:10 +02:00
parent a98dad0a33
commit 9afca46c5d
21 changed files with 152 additions and 30 deletions
+4
View File
@@ -262,6 +262,9 @@
"browse": "浏览...",
"speed_limit": "速度限制",
"speed_limit_placeholder": "无",
"generic_mode": "通用模式",
"enable_generic_mode": "启用通用模式(支持非 YouTube 网站)",
"generic_mode_help": "允许从 Dailymotion、CBC Gem 以及其他受 yt-dlp 支持的网站下载。",
"auto_update_ytdlp": "自动更新 yt-dlp",
"enable_auto_updates": "启用 yt-dlp 自动更新",
"update_frequency": "更新频率:",
@@ -325,6 +328,7 @@
},
"main_ui": {
"url_placeholder": "输入 YouTube 视频或播放列表网址",
"url_placeholder_generic": "输入任意受支持网站的视频或播放列表网址",
"merge_subtitles": "合并字幕",
"save_thumbnail": "保存缩略图",
"save_description": "保存描述",