mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
fix PR review comments
This commit is contained in:
@ -85,6 +85,7 @@ module.exports = async (win_, options) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports.downloadSong = downloadSong;
|
module.exports.downloadSong = downloadSong;
|
||||||
|
module.exports.downloadPlaylist = downloadPlaylist;
|
||||||
|
|
||||||
async function downloadSong(
|
async function downloadSong(
|
||||||
url,
|
url,
|
||||||
@ -312,12 +313,10 @@ async function writeID3(buffer, metadata, sendFeedback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function downloadPlaylist(givenUrl) {
|
async function downloadPlaylist(givenUrl) {
|
||||||
if (givenUrl) {
|
try {
|
||||||
try {
|
givenUrl = new URL(givenUrl);
|
||||||
givenUrl = new URL(givenUrl);
|
} catch {
|
||||||
} catch {
|
givenUrl = undefined;
|
||||||
givenUrl = undefined;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const playlistId =
|
const playlistId =
|
||||||
getPlaylistID(givenUrl) ||
|
getPlaylistID(givenUrl) ||
|
||||||
@ -465,7 +464,7 @@ const getPlaylistID = (aURL) => {
|
|||||||
const result =
|
const result =
|
||||||
aURL?.searchParams.get('list') || aURL?.searchParams.get('playlist');
|
aURL?.searchParams.get('list') || aURL?.searchParams.get('playlist');
|
||||||
if (result?.startsWith(INVALID_PLAYLIST_MODIFIER)) {
|
if (result?.startsWith(INVALID_PLAYLIST_MODIFIER)) {
|
||||||
return result.slice(6);
|
return result.slice(INVALID_PLAYLIST_MODIFIER.length);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user