diff --git a/api/package.json b/api/package.json index 77cc278a..7b50b48f 100644 --- a/api/package.json +++ b/api/package.json @@ -1,7 +1,7 @@ { "name": "@imput/cobalt-api", "description": "save what you love", - "version": "10.9.3", + "version": "10.9.4", "author": "imput", "exports": "./src/cobalt.js", "type": "module", diff --git a/api/src/processing/match.js b/api/src/processing/match.js index d93e1caf..532c8f3d 100644 --- a/api/src/processing/match.js +++ b/api/src/processing/match.js @@ -161,12 +161,8 @@ export default async function({ host, patternMatch, params }) { isAudioOnly = true; isAudioMuted = false; r = await soundcloud({ - url, - author: patternMatch.author, - song: patternMatch.song, + ...patternMatch, format: params.audioFormat, - shortLink: patternMatch.shortLink || false, - accessKey: patternMatch.accessKey || false }); break; diff --git a/api/src/processing/services/soundcloud.js b/api/src/processing/services/soundcloud.js index ad535479..a5c30ff8 100644 --- a/api/src/processing/services/soundcloud.js +++ b/api/src/processing/services/soundcloud.js @@ -1,4 +1,5 @@ import { env } from "../../config.js"; +import { resolveRedirectingURL } from "../url.js"; const cachedID = { version: '', @@ -7,22 +8,25 @@ const cachedID = { async function findClientID() { try { - let sc = await fetch('https://soundcloud.com/').then(r => r.text()).catch(() => {}); - let scVersion = String(sc.match(/