mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 03:41:46 +00:00
use native thumbnail without modifiers
This commit is contained in:
@ -98,6 +98,6 @@ function observeThumbnail() {
|
|||||||
function forceThumbnail(img) {
|
function forceThumbnail(img) {
|
||||||
const thumbnails = $('#movie_player').getPlayerResponse()?.videoDetails?.thumbnail?.thumbnails;
|
const thumbnails = $('#movie_player').getPlayerResponse()?.videoDetails?.thumbnail?.thumbnails;
|
||||||
if (thumbnails && thumbnails.length > 0) {
|
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"
|
// name = "dataloaded" and abit later "dataupdated"
|
||||||
apiEvent.detail.addEventListener('videodatachange', (name, dataEvent) => {
|
apiEvent.detail.addEventListener('videodatachange', (name, dataEvent) => {
|
||||||
if (name !== 'dataloaded') return;
|
if (name !== 'dataloaded') return;
|
||||||
ipcRenderer.send("song-info-request", JSON.stringify(dataEvent.playerResponse));
|
|
||||||
video.dispatchEvent(srcChangedEvent);
|
video.dispatchEvent(srcChangedEvent);
|
||||||
|
ipcRenderer.send("song-info-request", JSON.stringify(dataEvent.playerResponse));
|
||||||
})
|
})
|
||||||
|
|
||||||
}, { once: true, passive: true });
|
}, { once: true, passive: true });
|
||||||
|
|||||||
@ -52,7 +52,7 @@ const handleData = async (responseText, win) => {
|
|||||||
songInfo.title = cleanupName(data?.videoDetails?.title);
|
songInfo.title = cleanupName(data?.videoDetails?.title);
|
||||||
songInfo.artist =cleanupName(data?.videoDetails?.author);
|
songInfo.artist =cleanupName(data?.videoDetails?.author);
|
||||||
songInfo.views = data?.videoDetails?.viewCount;
|
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.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