diff --git a/src/sources/index.ts b/src/sources/index.ts index 680030e..04f20c1 100644 --- a/src/sources/index.ts +++ b/src/sources/index.ts @@ -1,5 +1,6 @@ import type { Readable } from "node:stream"; import { config } from "../config.js"; +import { logger } from "../logger.js"; import { UserFacingError, type Requester, type SearchResult, type Track } from "../types.js"; import * as direct from "./direct.js"; import * as local from "./local.js"; @@ -9,6 +10,8 @@ import * as ytdlp from "./ytdlp.js"; export { checkAvailable as checkYtDlp, checkCookies, checkProxy, describeProxy } from "./ytdlp.js"; export { isEnabled as isLocalLibraryEnabled, listFiles as listLocalFiles } from "./local.js"; +const log = logger.child({ mod: "sources" }); + const YOUTUBE_HOSTS = ["youtube.com", "youtu.be", "music.youtube.com", "m.youtube.com"]; const SOUNDCLOUD_HOSTS = ["soundcloud.com", "on.soundcloud.com", "m.soundcloud.com"]; @@ -209,6 +212,19 @@ export async function openPlayback(track: Track, seekSeconds = 0): Promise pipeline.kill(), + video: { stream: pipeline.video, width: pipeline.width, height: pipeline.height }, + }; + } + // Everything goes through yt-dlp: YouTube stalls direct CDN URLs fetched by // anything else, and ffmpeg would bypass a SOCKS proxy anyway. Seeking // therefore costs a decode up to the offset instead of an HTTP range request.