mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-13 05:37:44 +02:00
api/soundcloud: return isHLS flag when appropriate
This commit is contained in:
@ -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'),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user