Skip to content

Commit

Permalink
fix(jukebox): YT-DLP compatibility update
Browse files Browse the repository at this point in the history
  • Loading branch information
blueset committed Aug 13, 2024
1 parent d8b9b9a commit f209980
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/jukebox/src/graphql/DownloadResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,16 @@ export class DownloadResolver {
}
filename = swapExt(filename, "mp3");
const fullPath = Path.resolve(MUSIC_FILES_PATH, filename);
// const format = url.includes("nicovideo") ? "best" : "bestaudio";
const format = url.includes("nicovideo") ? "best" : "bestaudio";
const params = [
url,
"--extract-audio",
"--audio-format",
"mp3",
"--audio-quality",
"128K",
// "-f",
// format,
"-f",
format,
"--embed-thumbnail",
"--add-metadata",
"-o",
Expand Down Expand Up @@ -444,7 +444,8 @@ export class DownloadResolver {
@Query((returns) => GraphQLJSONObject)
public async youtubeDlGetInfo(@Arg("url") url: string): Promise<object> {
const ytdlpWrap = new YTDlpWrap(YTDLP_PATH);
const info = await ytdlpWrap.getVideoInfo(url);
const format = url.includes("nicovideo") ? "best" : "bestaudio";
const info = await ytdlpWrap.getVideoInfo(["-f", format, url]);
// console.log("yt-dlp info", info);
if (Array.isArray(info))
throw new Error("Playlist download is not supported yet");
Expand Down

0 comments on commit f209980

Please sign in to comment.