Fix html selector for spotify suggested tracks #202
This commit is contained in:
@@ -98,8 +98,8 @@
|
|||||||
//Parse tracklist
|
//Parse tracklist
|
||||||
await frame.waitForSelector("table")
|
await frame.waitForSelector("table")
|
||||||
tracks = [...await frame.evaluate(() => [...document.querySelectorAll("table tr")].map(tr => ({
|
tracks = [...await frame.evaluate(() => [...document.querySelectorAll("table tr")].map(tr => ({
|
||||||
name:tr.querySelector("td:nth-child(2) div:nth-child(1)").innerText,
|
name:tr.querySelector("td:nth-child(2) div div:nth-child(1)").innerText,
|
||||||
artist:tr.querySelector("td:nth-child(2) div:nth-child(2)").innerText,
|
artist:tr.querySelector("td:nth-child(2) div div:nth-child(2)").innerText,
|
||||||
//Spotify doesn't provide artworks so we fallback on playlist artwork instead
|
//Spotify doesn't provide artworks so we fallback on playlist artwork instead
|
||||||
artwork:window.getComputedStyle(document.querySelector("button[title=Play]").parentNode, null).backgroundImage.match(/^url\("(?<url>https:...+)"\)$/)?.groups?.url ?? null,
|
artwork:window.getComputedStyle(document.querySelector("button[title=Play]").parentNode, null).backgroundImage.match(/^url\("(?<url>https:...+)"\)$/)?.groups?.url ?? null,
|
||||||
})))]
|
})))]
|
||||||
|
|||||||
Reference in New Issue
Block a user