From a2e72122856850e5583232623bbdd4ab59a99b2d Mon Sep 17 00:00:00 2001 From: wukko Date: Tue, 16 May 2023 21:20:00 +0600 Subject: [PATCH] fixed the overlapping issue with short soundcloud links ids of some of new links overlap with old ones, so i decided to remove support for old shareable links. keeping support for soundcloud.app.goo.gl links makes no sense, you can't even get them from any of the apps anymore. --- src/modules/processing/services/soundcloud.js | 3 +-- src/test/tests.json | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/processing/services/soundcloud.js b/src/modules/processing/services/soundcloud.js index 0c9434d9..f285f56c 100644 --- a/src/modules/processing/services/soundcloud.js +++ b/src/modules/processing/services/soundcloud.js @@ -36,8 +36,7 @@ async function findClientID() { export default async function(obj) { let html; if (!obj.author && !obj.song && obj.shortLink) { - html = await fetch(`https://soundcloud.app.goo.gl/${obj.shortLink}/`).then((r) => { return r.status === 404 ? false : r.text() }).catch(() => { return false }); - if (!html) html = await fetch(`https://on.soundcloud.com/${obj.shortLink}/`).then((r) => { return r.status === 404 ? false : r.text() }).catch(() => { return false }) + html = await fetch(`https://on.soundcloud.com/${obj.shortLink}/`).then((r) => { return r.status === 404 ? false : r.text() }).catch(() => { return false }); } if (obj.author && obj.song) { html = await fetch(`https://soundcloud.com/${obj.author}/${obj.song}${obj.accessKey ? `/s-${obj.accessKey}` : ''}`).then((r) => { return r.text() }).catch(() => { return false }); diff --git a/src/test/tests.json b/src/test/tests.json index 158a0ea5..131e1614 100644 --- a/src/test/tests.json +++ b/src/test/tests.json @@ -280,6 +280,14 @@ "code": 200, "status": "stream" } + }, { + "name": "on.soundcloud link", + "url": "https://on.soundcloud.com/AG4c", + "params": {}, + "expected": { + "code": 200, + "status": "stream" + } }], "youtube": [{ "name": "4k video (h264, 1440)",