Skip to content

Commit

Permalink
Disable yt-dlp autoupdates for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Brainicism committed Aug 12, 2024
1 parent cc82aa7 commit 3c17d2f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
2 changes: 2 additions & 0 deletions docker/kmq/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ COPY sql/ sql/
COPY templates/ templates/

COPY bin/ bin/
# RUN mkdir bin
# RUN curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o bin/yt-dlp
RUN chmod u+x bin/yt-dlp

COPY src/ src/
Expand Down
43 changes: 22 additions & 21 deletions src/scripts/download-new-songs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,26 +277,27 @@ async function updateNotDownloaded(
}

async function getLatestYtDlpBinary(): Promise<void> {

Check warning on line 279 in src/scripts/download-new-songs.ts

View workflow job for this annotation

GitHub Actions / build

'getLatestYtDlpBinary' is defined but never used
// try {
// await fs.promises.access(ytDlpLocation, fs.constants.F_OK);
// } catch (_err) {
// logger.warn("yt-dlp binary doesn't exist, downloading...");
// try {
// await exec(
// `curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o ${ytDlpLocation}`,
// );
// await exec(`chmod u+x ${ytDlpLocation}`);
// } catch (err) {
// throw new Error(
// `Failed to fetch latest yt-dlp library. err = ${err}`,
// );
// }
// }
// try {
// await exec(`${ytDlpLocation} -U`);
// } catch (err) {
// throw new Error(`Failed to update yt-dlp library. err = ${err}`);
// }
try {
await fs.promises.access(ytDlpLocation, fs.constants.F_OK);
} catch (_err) {
logger.warn("yt-dlp binary doesn't exist, downloading...");
try {
await exec(
`curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o ${ytDlpLocation}`,
);
await exec(`chmod u+x ${ytDlpLocation}`);
} catch (err) {
throw new Error(
`Failed to fetch latest yt-dlp library. err = ${err}`,
);
}
}

try {
await exec(`${ytDlpLocation} -U`);
} catch (err) {
throw new Error(`Failed to update yt-dlp library. err = ${err}`);
}
}

const downloadNewSongs = async (
Expand Down Expand Up @@ -370,7 +371,7 @@ const downloadNewSongs = async (
logger.info(`Total songs to be downloaded: ${songsToDownload.length}`);

try {
await getLatestYtDlpBinary();
// await getLatestYtDlpBinary();
} catch (err) {
logger.warn(`Failed to get latest yt-dlp binary. err = ${err}`);
}
Expand Down

0 comments on commit 3c17d2f

Please sign in to comment.