services/soundcloud: properly check script hostname

This commit is contained in:
dumbmoron 2024-07-06 08:33:02 +00:00
parent 0fefc4ac27
commit 4daeaa3107
No known key found for this signature in database

View file

@ -18,7 +18,9 @@ async function findClientID() {
for (let script of scripts) { for (let script of scripts) {
let url = script[1]; let url = script[1];
if (url && !url.startsWith('https://a-v2.sndcdn.com')) return; if (!url?.startsWith('https://a-v2.sndcdn.com/')) {
return;
}
let scrf = await fetch(url).then(r => r.text()).catch(() => {}); let scrf = await fetch(url).then(r => r.text()).catch(() => {});
let id = scrf.match(/\("client_id=[A-Za-z0-9]{32}"\)/); let id = scrf.match(/\("client_id=[A-Za-z0-9]{32}"\)/);