From 451e8c151930fd2c29bc2480b4eee77c99cc9477 Mon Sep 17 00:00:00 2001 From: Krateng Date: Sun, 5 May 2019 14:11:27 +0200 Subject: [PATCH] Scrobbler now supports YT Music multiple artists --- scrobblers/chromium-generic/sitescripts/ytmusic.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scrobblers/chromium-generic/sitescripts/ytmusic.js b/scrobblers/chromium-generic/sitescripts/ytmusic.js index d3bfc49..3ccb1c7 100644 --- a/scrobblers/chromium-generic/sitescripts/ytmusic.js +++ b/scrobblers/chromium-generic/sitescripts/ytmusic.js @@ -10,7 +10,14 @@ metadata = bar.querySelector("div[class*=middle-controls] > div[class*=content-i ctrl = bar.querySelector("div[class*=left-controls]") title = metadata.querySelector("yt-formatted-string[class*=title]").getAttribute("title") -artist = metadata.querySelector("span > span[class*=subtitle] > yt-formatted-string > a:nth-child(1)").innerHTML +artistlist = metadata.querySelector("span > span[class*=subtitle] > yt-formatted-string") +artistelements = artistlist.getElementsByTagName("a") +artists = [] +for (var i=0;i span[class*=subtitle] > yt-formatted-string > a:nth-child(1)").innerHTML +artist = artists.join(";"); duration = ctrl.querySelector("[class*=time-info]").innerHTML.split("/")[1] if (duration.split(":").length == 2) { durationSeconds = parseInt(duration.split(":")[0]) * 60 + parseInt(duration.split(":")[1])