refactor(yt-dlp): modernize bot evasion and progress parsing

- Fix config location typo to enable authentication
- Wire up bundled Deno to handle YouTube PoW challenges
- Implement iOS/TV player spoofing to bypass web blocks
- Replace fragile regex progress parsing with structured templates
- Add auto-reconnect logic to Aria2 WebSocket
- Deduplicate media domains and fetch dynamically on frontend
This commit is contained in:
NimBold
2026-06-15 19:02:12 +03:30
parent 44c089fadf
commit f4b74898fd
4 changed files with 86 additions and 48 deletions
+18 -12
View File
@@ -159,23 +159,29 @@ pub async fn create_category_directories(app_handle: tauri::AppHandle, paths: Ve
Ok(())
}
pub static SUPPORTED_DOMAINS: &[&str] = &[
"youtube.com", "youtu.be",
"twitter.com", "x.com",
"vimeo.com",
"twitch.tv",
"instagram.com",
"tiktok.com",
"facebook.com", "fb.watch",
"reddit.com", "v.redd.it",
"soundcloud.com",
];
#[tauri::command]
pub fn get_supported_media_domains() -> Vec<String> {
SUPPORTED_DOMAINS.iter().map(|s| s.to_string()).collect()
}
#[tauri::command]
pub fn is_supported_media(url: String) -> bool {
if let Ok(parsed_url) = reqwest::Url::parse(&url) {
if let Some(host) = parsed_url.host_str() {
let host_lower = host.to_lowercase();
let supported_domains = [
"youtube.com", "youtu.be",
"twitter.com", "x.com",
"vimeo.com",
"twitch.tv",
"instagram.com",
"tiktok.com",
"facebook.com", "fb.watch",
"reddit.com", "v.redd.it",
"soundcloud.com"
];
for domain in supported_domains.iter() {
for domain in SUPPORTED_DOMAINS.iter() {
if host_lower == *domain || host_lower.ends_with(&format!(".{}", domain)) {
return true;
}