mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
use native thumbnail without modifiers
This commit is contained in:
@ -98,6 +98,6 @@ function observeThumbnail() {
|
||||
function forceThumbnail(img) {
|
||||
const thumbnails = $('#movie_player').getPlayerResponse()?.videoDetails?.thumbnail?.thumbnails;
|
||||
if (thumbnails && thumbnails.length > 0) {
|
||||
img.src = thumbnails[thumbnails.length - 1].url;
|
||||
img.src = thumbnails[thumbnails.length - 1].url.split("?")[0];
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,8 +18,8 @@ module.exports = () => {
|
||||
// name = "dataloaded" and abit later "dataupdated"
|
||||
apiEvent.detail.addEventListener('videodatachange', (name, dataEvent) => {
|
||||
if (name !== 'dataloaded') return;
|
||||
ipcRenderer.send("song-info-request", JSON.stringify(dataEvent.playerResponse));
|
||||
video.dispatchEvent(srcChangedEvent);
|
||||
ipcRenderer.send("song-info-request", JSON.stringify(dataEvent.playerResponse));
|
||||
})
|
||||
|
||||
}, { once: true, passive: true });
|
||||
|
||||
@ -52,7 +52,7 @@ const handleData = async (responseText, win) => {
|
||||
songInfo.title = cleanupName(data?.videoDetails?.title);
|
||||
songInfo.artist =cleanupName(data?.videoDetails?.author);
|
||||
songInfo.views = data?.videoDetails?.viewCount;
|
||||
songInfo.imageSrc = data?.videoDetails?.thumbnail?.thumbnails?.pop()?.url;
|
||||
songInfo.imageSrc = data?.videoDetails?.thumbnail?.thumbnails?.pop()?.url.split("?")[0];
|
||||
songInfo.songDuration = data?.videoDetails?.lengthSeconds;
|
||||
songInfo.image = await getImage(songInfo.imageSrc);
|
||||
songInfo.uploadDate = data?.microformat?.microformatDataRenderer?.uploadDate;
|
||||
|
||||
Reference in New Issue
Block a user