Skip to content

Commit

Permalink
Revert to yt-dlp nightly builds (#2219)
Browse files Browse the repository at this point in the history
* Revert to yt-dlp nightly builds

* remove unused step

* Update po token syntax

* remove binary

* use web_creator client
  • Loading branch information
Brainicism authored Sep 14, 2024
1 parent eae04b0 commit 14dc1ee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Binary file removed bin/yt-dlp
Binary file not shown.
5 changes: 2 additions & 3 deletions docker/kmq/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ COPY sql_dumps/kmq-test-cached.sql sql_dumps/kmq-test-cached.sql
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 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
4 changes: 2 additions & 2 deletions src/helpers/kmq_song_downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ export default class KmqSongDownloader {
}

try {
let ytdlpCommand = `${YT_DLP_LOCATION} -f bestaudio -o "${outputFile}" --abort-on-unavailable-fragments --extractor-arg "youtube:player_client=web;po_token=${this.youtubeSessionTokens.po_token};visitor_data=${this.youtubeSessionTokens.visitor_data};player_skip=webpage,configs" -- '${id}';`;
let ytdlpCommand = `${YT_DLP_LOCATION} -f bestaudio -o "${outputFile}" --abort-on-unavailable-fragments --extractor-arg "youtube:player-client=web_creator;po_token=web_creator+${this.youtubeSessionTokens.po_token};visitor_data=${this.youtubeSessionTokens.visitor_data};player_skip=webpage,configs" -- '${id}';`;

if (KmqConfiguration.Instance.ytdlpDownloadWithCookie()) {
if (this.hasYtDlpSessionCookies) {
ytdlpCommand = `${YT_DLP_LOCATION} -f bestaudio -o "${outputFile}" --abort-on-unavailable-fragments --extractor-args "youtube:player-client=web,default;po_token=${this.youtubeSessionTokens.po_token}" --cookies ${YOUTUBE_SESSION_COOKIE_PATH} -- '${id}';`;
ytdlpCommand = `${YT_DLP_LOCATION} -f bestaudio -o "${outputFile}" --abort-on-unavailable-fragments --extractor-args "youtube:player-client=web_creator;po_token=web_creator+${this.youtubeSessionTokens.po_token}" --cookies ${YOUTUBE_SESSION_COOKIE_PATH} -- '${id}';`;
} else {
logger.warn(
"ytdlpDownloadWithCookie enabled but cookie file missing, falling back to non-cookie",
Expand Down
2 changes: 1 addition & 1 deletion src/kmq_configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class KmqConfiguration {
}

ytdlpUpdatesEnabled(): boolean {
return this.config["ytdlpUpdatesEnabled"] ?? false;
return this.config["ytdlpUpdatesEnabled"] ?? true;
}

ytdlpDownloadWithCookie(): boolean {
Expand Down

0 comments on commit 14dc1ee

Please sign in to comment.