distubejs / ytdl-core

YouTube video downloader in javascript.
MIT License
260 stars 47 forks source link

YouTube videos downloaded only 0 bytes #115

Open arcovoltaico opened 6 days ago

arcovoltaico commented 6 days ago

Describe the bug

My code has been working for months, but since recently, no YouTube video has been downloaded, and I am not even getting any error. I see that the file is created but remains 0 bytes. This has started happening recently in my 2 well-tested different systems, without changing any code, no matter what video you try.

I have tried this fix https://github.com/XM4ZE/ytdl-core , but it's not helping.

My code runs in the main.js Electron.

ytdl.getInfo(url).then((info: videoInfo) => { const formats = ytdl.filterFormats(info.formats, 'audioandvideo'); if (formats.length < 1) { notifyYoutubeDownloadError(id); }

    console.log("FORMATS: " + formats.length);
    const downloadOptions = {
        quality: 'highest', format: formats[0]
    };

    ytdl.downloadFromInfo(info, downloadOptions).pipe(file);
}).catch((error) => {
    notifyYoutubeDownloadError(id);
});

I have tried also the suggested code with the same result : const ytdl = require('@distube/ytdl-core');

  // Download a video
  ytdl('http://www.youtube.com/watch?v=aqz-KE-bpKQ').pipe(
    require('fs').createWriteStream('§.mp4'),
  );

Environment

arcovoltaico commented 5 days ago

solved by using "github:XM4ZE/ytdl-core" }

AmitDJagtap commented 5 days ago

yep same issue .

The error seems to start in video.getInfo function. when ytdl tries to access relatedVideoData etc

LucaFontanot commented 23 hours ago

Same issue. But on windows is working fine, with same IP and everything