mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 20:52:06 +00:00
Downloader: catch error when fetching playlist
This commit is contained in:
@ -36,10 +36,16 @@ module.exports = (win, options) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("trying to get playlist ID" +playlistID);
|
console.log(`trying to get playlist ID: '${playlistID}'`);
|
||||||
const playlist = await ytpl(playlistID,
|
let playlist;
|
||||||
{ limit: options.playlistMaxItems || Infinity }
|
try {
|
||||||
);
|
playlist = await ytpl(playlistID, {
|
||||||
|
limit: options.playlistMaxItems || Infinity,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
sendError(win, e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const playlistTitle = playlist.title;
|
const playlistTitle = playlist.title;
|
||||||
|
|
||||||
const folder = getFolder(options.downloadFolder);
|
const folder = getFolder(options.downloadFolder);
|
||||||
|
|||||||
Reference in New Issue
Block a user