Skip to content

Commit

Permalink
fix(YouTube Music): no href temp fix (PreMiD#7805)
Browse files Browse the repository at this point in the history
* fix(youtube music): no href temp fix

* chore: bump schema

* feat: `watchID` from url

* chore: requested change

Co-authored-by: Daniel Lau <[email protected]>
Signed-off-by: veryCrunchy <[email protected]>

* style: format

---------

Signed-off-by: veryCrunchy <[email protected]>
Co-authored-by: Daniel Lau <[email protected]>
  • Loading branch information
veryCrunchy and theusaf authored Dec 8, 2023
1 parent 40db90a commit 3582e1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion websites/Y/YouTube Music/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"vi_VN": "Một dịch vụ phát nhạc với các album, đĩa đơn, video, bản remix, và các tiết mục trực tiếp chính thức và hơn nữa cho Android, iOS và máy tính. Tất cả đều tại đây."
},
"url": "music.youtube.com",
"version": "3.0.9",
"version": "3.0.10",
"logo": "https://cdn.rcd.gg/PreMiD/websites/Y/YouTube%20Music/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/Y/YouTube%20Music/assets/thumbnail.png",
"color": "#E40813",
Expand Down
8 changes: 5 additions & 3 deletions websites/Y/YouTube Music/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ presence.on("UpdateData", async () => {
presence.getSetting<boolean>("privacy"),
]),
{ mediaSession } = navigator,
watchID = document
.querySelector<HTMLAnchorElement>("a.ytp-title-link.yt-uix-sessionlink")
.href.match(/v=([^&#]{5,})/)?.[1],
watchID =
href.match(/v=([^&#]{5,})/)?.[1] ??
document
.querySelector<HTMLAnchorElement>("a.ytp-title-link.yt-uix-sessionlink")
?.href.match(/v=([^&#]{5,})/)?.[1],
repeatMode = document
.querySelector('ytmusic-player-bar[slot="player-bar"]')
.getAttribute("repeat-Mode_"),
Expand Down

0 comments on commit 3582e1a

Please sign in to comment.