最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - AudioProviderError: YT-DLP download error - - Stack Overflow

programmeradmin2浏览0评论

I'm using spotdl in my nestJs project. and i get this error when trying to use it. error : AudioProviderError: YT-DLP download error - implemented it like this :

const spotDl = spawn('spotdl', [
        'download',
        url,
        '--output',
        `${songDir}/%(title)s.%(output-ext)s`,
      ]);
spotDl.on('close', (code) => {
        setTimeout(() => {
          if (code === 0) {
            // get all mp3 files in the song directory
            const files: string[] = readdirSync(songDir)
              .filter((f): boolean => f.endsWith('.mp3'))
              .map((file): string => path.join(songDir, file));
            // resolve the promise
            resolve({
              filePaths: files.length ? files : undefined,
              error: undefined,
            });
          } else {
            // resolve the promise with error message
            console.log(
              'error in spotify service on spawn close',
              errorMessage,
            );
            resolve({
              filePaths: undefined,
              error: errorMessage || 'Unknown error occurred',
            });
          }
        }, 500);
      });

i expect it to download the file from the link i give to it but it response with this error everytime.

发布评论

评论列表(0)

  1. 暂无评论