ytb2mp3 / youtube-mp3-downloader

Extract music from YouTube videos
MIT License
377 stars 104 forks source link

How to stop the request on an error 410 #92

Closed ziad67-bytes closed 2 years ago

ziad67-bytes commented 2 years ago

When a video is submitted to the parental control an error 410 is raised. To remedy this I thought of putting a try catch but despite this the request still goes into the module and I get the following error:

var videoTitle = this.cleanFileName(info.videoDetails.title);
                                                 ^

TypeError: Cannot read properties of undefined (reading 'videoDetails')
    at YoutubeMp3Downloader.performDownload (C:\Users\zibalbz\Projets\Album Downloader\node_modules\youtube-mp3-downloader\lib\YoutubeMp3Downloader.js:90:50)

Is there a way to stop sending data to the modules when the program detects an error? I hope this is clear and that someone can help me