mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-27 17:08:28 +00:00
api/soundcloud: return isHLS flag when appropriate
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service functionality (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service functionality (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
This commit is contained in:
parent
a52dde7654
commit
ed18008493
@ -108,7 +108,7 @@ export default async function(obj) {
|
|||||||
fileUrl.searchParams.set("track_authorization", json.track_authorization);
|
fileUrl.searchParams.set("track_authorization", json.track_authorization);
|
||||||
|
|
||||||
const file = await fetch(fileUrl)
|
const file = await fetch(fileUrl)
|
||||||
.then(async r => (await r.json()).url)
|
.then(async r => new URL((await r.json()).url))
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|
||||||
if (!file) return { error: "fetch.empty" };
|
if (!file) return { error: "fetch.empty" };
|
||||||
@ -119,13 +119,14 @@ export default async function(obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
urls: file,
|
urls: file.toString(),
|
||||||
filenameAttributes: {
|
filenameAttributes: {
|
||||||
service: "soundcloud",
|
service: "soundcloud",
|
||||||
id: json.id,
|
id: json.id,
|
||||||
...fileMetadata
|
...fileMetadata
|
||||||
},
|
},
|
||||||
bestAudio,
|
bestAudio,
|
||||||
fileMetadata
|
fileMetadata,
|
||||||
|
isHLS: file.pathname.endsWith('.m3u8'),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user