From 360ba44dd5cf0500118f6d95cd4e23d23fb8a293 Mon Sep 17 00:00:00 2001 From: afkarxyz Date: Thu, 9 Jan 2025 19:53:50 +0700 Subject: [PATCH] Update GetMetadata.py --- GetMetadata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GetMetadata.py b/GetMetadata.py index 76661db..424da7c 100644 --- a/GetMetadata.py +++ b/GetMetadata.py @@ -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()) \ No newline at end of file + asyncio.run(main())