fix: use HEAD instead of GET in songInfo.imageSrc validation step

Thanks to @daika7ana!
Close #2766
This commit is contained in:
JellyBrick
2024-12-25 09:49:30 +09:00
parent 3f8ca6002e
commit 24e593b22f

View File

@ -142,7 +142,10 @@ const handleData = async (
const thumbnails = videoDetails.thumbnail?.thumbnails;
songInfo.imageSrc = thumbnails.at(-1)?.url.split('?')[0];
if (songInfo.imageSrc && !(await net.fetch(songInfo.imageSrc)).ok) {
if (
songInfo.imageSrc &&
!(await net.fetch(songInfo.imageSrc, { method: 'HEAD' })).ok
) {
songInfo.imageSrc = thumbnails.at(-1)?.url;
}