Skip to content

Commit 24e593b

Browse files
committed
fix: use HEAD instead of GET in songInfo.imageSrc validation step
Thanks to @daika7ana! Close #2766
1 parent 3f8ca60 commit 24e593b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/providers/song-info.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ const handleData = async (
142142
const thumbnails = videoDetails.thumbnail?.thumbnails;
143143
songInfo.imageSrc = thumbnails.at(-1)?.url.split('?')[0];
144144

145-
if (songInfo.imageSrc && !(await net.fetch(songInfo.imageSrc)).ok) {
145+
if (
146+
songInfo.imageSrc &&
147+
!(await net.fetch(songInfo.imageSrc, { method: 'HEAD' })).ok
148+
) {
146149
songInfo.imageSrc = thumbnails.at(-1)?.url;
147150
}
148151

0 commit comments

Comments
 (0)