fix(downloadin): fix ejs runtime problem

fix ejs "No supported JavaScript runtime could be found." by updating nodejs to v20 and explicit
usage of `jsRuntime` param

fix #38
This commit is contained in:
Raiper34
2026-02-07 13:28:21 +00:00
parent 2b1fd9b905
commit eafd3340bd
5 changed files with 10030 additions and 4307 deletions
+1 -1
View File
@@ -1 +1 @@
v18.19.1 v20.20.0
+10016 -4290
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -38,7 +38,7 @@
"isomorphic-unfetch": "^4.0.2", "isomorphic-unfetch": "^4.0.2",
"node-id3": "^0.2.9", "node-id3": "^0.2.9",
"reflect-metadata": "^0.2.0", "reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1", "rxjs": "7.8.0",
"spotify-url-info": "^3.2.18", "spotify-url-info": "^3.2.18",
"sqlite3": "^5.1.7", "sqlite3": "^5.1.7",
"yt-search": "^2.12.1", "yt-search": "^2.12.1",
+10 -13
View File
@@ -25,10 +25,7 @@ export class YoutubeService {
return url; return url;
} }
async downloadAndFormat( async downloadAndFormat(track: TrackEntity, output: string): Promise<void> {
track: TrackEntity,
output: string,
): Promise<void> {
this.logger.debug( this.logger.debug(
`Downloading ${track.artist} - ${track.name} (${track.youtubeUrl}) from YT`, `Downloading ${track.artist} - ${track.name} (${track.youtubeUrl}) from YT`,
); );
@@ -37,16 +34,16 @@ export class YoutubeService {
throw Error('youtubeUrl is null or undefined'); throw Error('youtubeUrl is null or undefined');
} }
const ytdlp = new YtDlp(); const ytdlp = new YtDlp();
await ytdlp.downloadAsync(track.youtubeUrl, { await ytdlp.downloadAudio(
format: { track.youtubeUrl,
filter: 'audioonly', this.configService.get<'m4a'>(EnvironmentEnum.FORMAT),
type: this.configService.get<'m4a'>(EnvironmentEnum.FORMAT), {
quality: 0, output,
cookiesFromBrowser: this.configService.get<string>('YT_COOKIES'),
headers: HEADERS,
jsRuntime: 'node',
}, },
output, );
cookiesFromBrowser: this.configService.get<string>('YT_COOKIES'),
headers: HEADERS,
});
this.logger.debug( this.logger.debug(
`Downloaded ${track.artist} - ${track.name} to ${output}`, `Downloaded ${track.artist} - ${track.name} to ${output}`,
); );
+2 -2
View File
@@ -30,8 +30,8 @@
"@ngneat/elf-requests": "^1.9.2", "@ngneat/elf-requests": "^1.9.2",
"@ngneat/elf-state-history": "^1.4.0", "@ngneat/elf-state-history": "^1.4.0",
"bulma": "^1.0.1", "bulma": "^1.0.1",
"ngx-socket-io": "^4.7.0", "ngx-socket-io": "4.8.1",
"rxjs": "~7.8.0", "rxjs": "7.8.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"zone.js": "~0.15.0" "zone.js": "~0.15.0"
}, },