use native thumbnail without modifiers

This commit is contained in:
Araxeus
2021-11-12 17:46:40 +02:00
parent 08fdd07969
commit cfe719b6bd
3 changed files with 3 additions and 3 deletions

View File

@ -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];
}
}

View File

@ -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 });

View File

@ -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;