mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 18:21:47 +00:00
fetch highest resolution image instead of lowest resolution
This commit is contained in:
@ -44,11 +44,11 @@ const songInfo = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleData = async (_event, responseText) => {
|
const handleData = async (_event, responseText) => {
|
||||||
data = JSON.parse(responseText);
|
let data = JSON.parse(responseText);
|
||||||
songInfo.title = data?.videoDetails?.title;
|
songInfo.title = data?.videoDetails?.title;
|
||||||
songInfo.artist = data?.videoDetails?.author;
|
songInfo.artist = data?.videoDetails?.author;
|
||||||
songInfo.views = data?.videoDetails?.viewCount;
|
songInfo.views = data?.videoDetails?.viewCount;
|
||||||
songInfo.imageSrc = data?.videoDetails?.thumbnail?.thumbnails?.[0]?.url;
|
songInfo.imageSrc = data?.videoDetails?.thumbnail?.thumbnails?.pop()?.url;
|
||||||
songInfo.songDuration = data?.videoDetails?.lengthSeconds;
|
songInfo.songDuration = data?.videoDetails?.lengthSeconds;
|
||||||
songInfo.image = await getImage(songInfo.imageSrc);
|
songInfo.image = await getImage(songInfo.imageSrc);
|
||||||
songInfo.uploadDate = data?.microformat?.microformatDataRenderer?.uploadDate;
|
songInfo.uploadDate = data?.microformat?.microformatDataRenderer?.uploadDate;
|
||||||
|
|||||||
Reference in New Issue
Block a user