Update GetMetadata.py

This commit is contained in:
afkarxyz
2025-01-09 19:53:50 +07:00
committed by GitHub
parent 9011335181
commit 360ba44dd5
+3 -3
View File
@@ -14,9 +14,9 @@ async def get_metadata(page, headless=True):
const [url, config] = args;
if (url.includes('/api/load?url=%2Fapi%2Ffetch%2Fstream%2Fv2')) {
const payload = JSON.parse(config.body);
const title = document.querySelector('h1.svelte-6pt9ji').textContent;
const title = document.querySelector('h1.svelte-6pt9ji').textContent.trim();
const artists = Array.from(document.querySelectorAll('h2.svelte-6pt9ji a.normal'))
.map(a => a.textContent)
.map(a => a.textContent.trim())
.join(', ');
const cover = document.querySelector('.svelte-6pt9ji .meta.svelte-6pt9ji a').href;
@@ -96,4 +96,4 @@ async def main(headless=True):
await browser.stop()
if __name__ == "__main__":
asyncio.run(main())
asyncio.run(main())