mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 19:31:46 +00:00
fix: use HEAD instead of GET in songInfo.imageSrc validation step
Thanks to @daika7ana! Close #2766
This commit is contained in:
@ -142,7 +142,10 @@ const handleData = async (
|
|||||||
const thumbnails = videoDetails.thumbnail?.thumbnails;
|
const thumbnails = videoDetails.thumbnail?.thumbnails;
|
||||||
songInfo.imageSrc = thumbnails.at(-1)?.url.split('?')[0];
|
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;
|
songInfo.imageSrc = thumbnails.at(-1)?.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user