mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-12 13:17:45 +02:00
Merge branch 'current' into feat/twitch
This commit is contained in:
@ -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 });
|
||||
|
@ -44,7 +44,7 @@ export default async function(o) {
|
||||
if (Number(bestQuality._attributes.id) > Number(quality)) bestQuality = repr[quality];
|
||||
|
||||
url = js.player.params[0][`url${resolutionMatch[bestQuality._attributes[resolutionPick]]}`];
|
||||
filename = `${bestQuality._attributes.width}x${bestQuality._attributes.height}.mp4`
|
||||
filename += `${bestQuality._attributes.width}x${bestQuality._attributes.height}.mp4`
|
||||
|
||||
} else if (js.player.params[0]["url240"]) { // fallback for when video is too old
|
||||
url = js.player.params[0]["url240"];
|
||||
|
Reference in New Issue
Block a user