Chnapy / youtube-album-uploader-multiple

A node CLI to upload multiple mp3 files to youtube.
MIT License
2 stars 0 forks source link

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined #2

Open TheLickIn13Keys opened 3 years ago

TheLickIn13Keys commented 3 years ago
Creating video from goop1/ANGiE AK - Implant.mp3 to yaumExport/ANGiE AK - Implant.mp4 (this may take awhile)...
Delete file yaumExport/ANGiE AK - Implant.mp4
node:internal/validators:215
    throw new ERR_INVALID_CALLBACK(callback);
    ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at makeCallback (node:fs:182:3)
    at Object.unlink (node:fs:1267:14)
    at cleanUp (/usr/lib/node_modules/youtube-album-uploader-multiple/src/multiple.js:221:12)
    at /usr/lib/node_modules/youtube-album-uploader-multiple/src/multiple.js:178:33
    at FfmpegCommand.<anonymous> (/usr/lib/node_modules/youtube-album-uploader-multiple/src/convert.js:31:13)
    at FfmpegCommand.emit (node:events:365:28)
    at FfmpegCommand.emit (node:domain:470:12)
    at emitEnd (/usr/lib/node_modules/youtube-album-uploader-multiple/node_modules/fluent-ffmpeg/lib/processor.js:424:16)
    at endCB (/usr/lib/node_modules/youtube-album-uploader-multiple/node_modules/fluent-ffmpeg/lib/processor.js:544:13)
    at handleExit (/usr/lib/node_modules/youtube-album-uploader-multiple/node_modules/fluent-ffmpeg/lib/processor.js:170:11) {
  code: 'ERR_INVALID_CALLBACK'
}

Hi, I'm getting this error when I attempt to run the application with the command: yaum --albumPaths "goop1/ANGiE AK - Implant.mp3" --coverPaths "goop1/cover.jpg" --credentials "credentials.json"

Thanks, Bardia

TheLickIn13Keys commented 3 years ago

Ok so I changed fs.unlink(path) to fs.unlink(path, () => {}) on line 221 of multiple.js and that worked But now I'm getting this error:

Creating video from goop1/ANGiE AK - Implant.mp3 to yaumExport/ANGiE AK - Implant.mp4 (this may take awhile)...
Delete file yaumExport/ANGiE AK - Implant.mp4
Error: ffmpeg exited with code 1: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

    at ChildProcess.<anonymous> (/usr/lib/node_modules/youtube-album-uploader-multiple/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (node:events:365:28)
    at ChildProcess.emit (node:domain:470:12)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
End of the main process with failure.
TheLickIn13Keys commented 3 years ago

Ok so it seems like adding .size('1920x1080') to convert.js fixes the problem I will submit a PR tomorrow with all the fixes.