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
+2
View File
@@ -1,3 +1,4 @@
import { initMediaDomains } from './utils/downloads';
import { useEffect, useRef, useState } from "react";
import { Sidebar, SidebarFilter } from "./components/Sidebar";
import { DownloadTable } from "./components/DownloadTable";
@@ -57,6 +58,7 @@ function App() {
};
useEffect(() => {
initMediaDomains();
window.localStorage.setItem('firelink-sidebar-width', String(sidebarWidth));
}, [sidebarWidth]);
+14 -1
View File
@@ -1,7 +1,9 @@
import type { DownloadCategory } from '../bindings/DownloadCategory';
export type { DownloadCategory } from '../bindings/DownloadCategory';
const MEDIA_DOMAINS = [
import { invoke } from '@tauri-apps/api/core';
let MEDIA_DOMAINS = [
'youtube.com',
'youtu.be',
'twitter.com',
@@ -17,6 +19,17 @@ const MEDIA_DOMAINS = [
'fb.watch'
];
export const initMediaDomains = async () => {
try {
const domains = await invoke<string[]>('get_supported_media_domains');
if (domains && domains.length > 0) {
MEDIA_DOMAINS = domains;
}
} catch (e) {
console.error('Failed to init media domains:', e);
}
};
export const categoryForFileName = (fileName: string): DownloadCategory => {
const ext = fileName.split('.').pop()?.toLowerCase() || '';
if (['mp4', 'mkv', 'avi', 'mov', 'wmv', 'flv', 'webm', 'm4v', 'mpeg', 'mpg', '3gp', 'ts', 'vob'].includes(ext)) return 'Movies';