diff --git a/websites/Y/YouTube/metadata.json b/websites/Y/YouTube/metadata.json index 2cdbefe45930..42222692727f 100644 --- a/websites/Y/YouTube/metadata.json +++ b/websites/Y/YouTube/metadata.json @@ -67,7 +67,7 @@ "www.youtube.com", "studio.youtube.com" ], - "version": "5.4.6", + "version": "5.4.7", "logo": "https://cdn.rcd.gg/PreMiD/websites/Y/YouTube/assets/logo.png", "thumbnail": "https://cdn.rcd.gg/PreMiD/websites/Y/YouTube/assets/thumbnail.jpg", "color": "#E40813", @@ -101,7 +101,7 @@ "title": "Video Details row1", "icon": "fas fa-comment-alt-edit", "value": "%title%", - "placeholder": "Use %title% or %uploader%" + "placeholder": "Use %title%, %uploader%, %playlistTitle%, %playlistQueue%" }, { "id": "vidState", @@ -111,7 +111,7 @@ "title": "Video Details row2", "icon": "fas fa-comment-alt-edit", "value": "%uploader%", - "placeholder": "Use %title%, %uploader% or {0} to delete the row completely" + "placeholder": "same like row1 or use {0} to delete the row completely" }, { "id": "channelPic", diff --git a/websites/Y/YouTube/presence.ts b/websites/Y/YouTube/presence.ts index 682c05f98af8..b25a918bcad7 100644 --- a/websites/Y/YouTube/presence.ts +++ b/websites/Y/YouTube/presence.ts @@ -290,6 +290,18 @@ presence.on("UpdateData", async () => { !title || title.textContent.replace(/\s+/g, "") === "" ? document.querySelector("div.ytp-title-text > a").textContent : title.textContent; + const finalPlaylistTitle = document.querySelector( + "#header-description > h3:nth-child(1) > yt-formatted-string > a" + ).textContent, + finalPlaylistQueue = `${ + document.querySelector( + "#publisher-container > div > yt-formatted-string > span:nth-child(1)" + ).textContent + } / ${ + document.querySelector( + "#publisher-container > div > yt-formatted-string > span:nth-child(3)" + ).textContent + }`; //* YouTube Movies if ( @@ -336,10 +348,14 @@ presence.on("UpdateData", async () => { presenceData: PresenceData = { details: vidDetail .replace("%title%", finalTitle.trim()) - .replace("%uploader%", finalUploader.trim()), + .replace("%uploader%", finalUploader.trim()) + .replace("%playlistTitle%", finalPlaylistTitle.trim()) + .replace("%playlistQueue%", finalPlaylistQueue.trim()), state: vidState .replace("%title%", finalTitle.trim()) - .replace("%uploader%", finalUploader.trim()), + .replace("%uploader%", finalUploader.trim()) + .replace("%playlistTitle%", finalPlaylistTitle.trim()) + .replace("%playlistQueue%", finalPlaylistQueue.trim()), largeImageKey: unlistedVideo || logo === 0 || pfp === "" ? Assets.Logo