| 1 | export interface Video { |
| 2 | /** Survives a pasted URL resolving into a real video id. */ |
| 3 | key: string; |
| 4 | title: string; |
| 5 | channel: string; |
| 6 | /** YYYY-MM-DD; empty while resolving. */ |
| 7 | published: string; |
| 8 | /** Seconds. */ |
| 9 | duration: number | null; |
| 10 | thumb: string | null; |
| 11 | link: string; |
| 12 | resolving: boolean; |
| 13 | } |
| 14 | |
| 15 | export interface Show { |
| 16 | name: string; |
| 17 | seasons: { number: number; episodes: number }[]; |
| 18 | } |
| 19 | |
| 20 | export interface LibraryEntry { |
| 21 | type: "indie" | "independent"; |
| 22 | path: string; |
| 23 | context: string; |
| 24 | title: string; |
| 25 | link: string; |
| 26 | season: number | null; |
| 27 | episode: number | null; |
| 28 | } |
| 29 | |
| 30 | export type JobStatus = "queued" | "resolving" | "downloading" | "retrying" | "waiting" | "done" | "error"; |
| 31 | |
| 32 | export interface Job { |
| 33 | id: string; |
| 34 | title: string; |
| 35 | channel: string; |
| 36 | /** Where it lands, e.g. "Night Signals S02E07" or "Independent". */ |
| 37 | destination: string; |
| 38 | status: JobStatus; |
| 39 | /** The video on YouTube. */ |
| 40 | url: string; |
| 41 | /** Download folder in Files; null when unavailable. */ |
| 42 | folder: string | null; |
| 43 | /** 0–1 while downloading. */ |
| 44 | progress: number | null; |
| 45 | queuedAt: number; |
| 46 | } |
| 47 | |
| 48 | /** Downloads pause while YouTube bot-walls the IP and resume after a successful probe. */ |
| 49 | export interface Wall { |
| 50 | walled: boolean; |
| 51 | nextProbe: number | null; |
| 52 | } |
| 53 | |
| 54 | /** ytdl-sub's archive loop: a pass every 6h, or 24h after a pass that hit the bot wall. */ |
| 55 | export interface Archive { |
| 56 | started: number | null; |
| 57 | finished: number | null; |
| 58 | walled: boolean; |
| 59 | next: number; |
| 60 | } |
| 61 | |
| 62 | export interface Upscaler { |
| 63 | enabled: boolean; |
| 64 | running: boolean; |
| 65 | done: number; |
| 66 | total: number; |
| 67 | current: string; |
| 68 | errors: number; |
| 69 | } |
| 70 | |
| 71 | export type ConfigFile = { name: string; body: string }; |
| 72 | export type Ingest = {dest:"independent"}|{dest:"music"}|{dest:"indie";show:string;season:number;episode:number;title:string}; |
| 73 | export interface Rules {download_after?:string;title_include_keywords?:string[];title_exclude_keywords?:string[];description_include_keywords?:string[];description_exclude_keywords?:string[];} |
| 74 | export interface Channels {notify:{name:string;url:string}[];archive:{name:string;url:string;rules:Rules}[];} |