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:
@@ -38,7 +38,7 @@
|
||||
"isomorphic-unfetch": "^4.0.2",
|
||||
"node-id3": "^0.2.9",
|
||||
"reflect-metadata": "^0.2.0",
|
||||
"rxjs": "^7.8.1",
|
||||
"rxjs": "7.8.0",
|
||||
"spotify-url-info": "^3.2.18",
|
||||
"sqlite3": "^5.1.7",
|
||||
"yt-search": "^2.12.1",
|
||||
|
||||
@@ -25,10 +25,7 @@ export class YoutubeService {
|
||||
return url;
|
||||
}
|
||||
|
||||
async downloadAndFormat(
|
||||
track: TrackEntity,
|
||||
output: string,
|
||||
): Promise<void> {
|
||||
async downloadAndFormat(track: TrackEntity, output: string): Promise<void> {
|
||||
this.logger.debug(
|
||||
`Downloading ${track.artist} - ${track.name} (${track.youtubeUrl}) from YT`,
|
||||
);
|
||||
@@ -37,16 +34,16 @@ export class YoutubeService {
|
||||
throw Error('youtubeUrl is null or undefined');
|
||||
}
|
||||
const ytdlp = new YtDlp();
|
||||
await ytdlp.downloadAsync(track.youtubeUrl, {
|
||||
format: {
|
||||
filter: 'audioonly',
|
||||
type: this.configService.get<'m4a'>(EnvironmentEnum.FORMAT),
|
||||
quality: 0,
|
||||
await ytdlp.downloadAudio(
|
||||
track.youtubeUrl,
|
||||
this.configService.get<'m4a'>(EnvironmentEnum.FORMAT),
|
||||
{
|
||||
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(
|
||||
`Downloaded ${track.artist} - ${track.name} to ${output}`,
|
||||
);
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
"@ngneat/elf-requests": "^1.9.2",
|
||||
"@ngneat/elf-state-history": "^1.4.0",
|
||||
"bulma": "^1.0.1",
|
||||
"ngx-socket-io": "^4.7.0",
|
||||
"rxjs": "~7.8.0",
|
||||
"ngx-socket-io": "4.8.1",
|
||||
"rxjs": "7.8.0",
|
||||
"tslib": "^2.3.0",
|
||||
"zone.js": "~0.15.0"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user