mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-02 15:39:37 +00:00
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:
@@ -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
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user