mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 20:52:06 +00:00
try to fix songInfo time&album (#1032)
This commit is contained in:
@ -76,7 +76,7 @@ module.exports = () => {
|
|||||||
apiEvent.detail.addEventListener('videodatachange', (name, _dataEvent) => {
|
apiEvent.detail.addEventListener('videodatachange', (name, _dataEvent) => {
|
||||||
if (name !== 'dataloaded') return;
|
if (name !== 'dataloaded') return;
|
||||||
video.dispatchEvent(srcChangedEvent);
|
video.dispatchEvent(srcChangedEvent);
|
||||||
sendSongInfo();
|
setTimeout(sendSongInfo());
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const status of ['playing', 'pause']) {
|
for (const status of ['playing', 'pause']) {
|
||||||
@ -95,7 +95,10 @@ module.exports = () => {
|
|||||||
|
|
||||||
data.videoDetails.album = $$(
|
data.videoDetails.album = $$(
|
||||||
".byline.ytmusic-player-bar > .yt-simple-endpoint"
|
".byline.ytmusic-player-bar > .yt-simple-endpoint"
|
||||||
).find(e => e.href?.includes("browse"))?.textContent;
|
).find(e =>
|
||||||
|
e.href?.includes("browse/FEmusic_library_privately_owned_release")
|
||||||
|
|| e.href?.includes("browse/MPREb")
|
||||||
|
)?.textContent;
|
||||||
|
|
||||||
data.videoDetails.elapsedSeconds = Math.floor(video.currentTime);
|
data.videoDetails.elapsedSeconds = Math.floor(video.currentTime);
|
||||||
data.videoDetails.isPaused = false;
|
data.videoDetails.isPaused = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user