mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-13 04:35:28 +01:00
fix download audio button in picker
This commit is contained in:
parent
f4b486a236
commit
789acbc99b
2 changed files with 4 additions and 12 deletions
|
@ -395,17 +395,9 @@ async function download(url) {
|
||||||
break;
|
break;
|
||||||
case "picker":
|
case "picker":
|
||||||
if (j.audio && j.picker) {
|
if (j.audio && j.picker) {
|
||||||
changeDownloadButton(2, '?..')
|
changeDownloadButton(2, '>>>');
|
||||||
fetch(`${j.audio}&p=1`).then(async (res) => {
|
popup('picker', 1, { audio: j.audio, arr: j.picker, type: j.pickerType });
|
||||||
let jp = await res.json();
|
setTimeout(() => { changeButton(1) }, 2500);
|
||||||
if (jp.status === "continue") {
|
|
||||||
changeDownloadButton(2, '>>>');
|
|
||||||
popup('picker', 1, { audio: j.audio, arr: j.picker, type: j.pickerType });
|
|
||||||
setTimeout(() => { changeButton(1) }, 2500);
|
|
||||||
} else {
|
|
||||||
changeButton(0, jp.text);
|
|
||||||
}
|
|
||||||
}).catch((error) => internetError());
|
|
||||||
} else if (j.picker) {
|
} else if (j.picker) {
|
||||||
changeDownloadButton(2, '>>>');
|
changeDownloadButton(2, '>>>');
|
||||||
popup('picker', 1, { arr: j.picker, type: j.pickerType });
|
popup('picker', 1, { arr: j.picker, type: j.pickerType });
|
||||||
|
|
|
@ -27,7 +27,7 @@ export function apiJSON(type, obj) {
|
||||||
switch (obj.service) {
|
switch (obj.service) {
|
||||||
case "douyin":
|
case "douyin":
|
||||||
case "tiktok":
|
case "tiktok":
|
||||||
audio = createStream(obj)
|
audio = obj.u
|
||||||
pickerType = "images"
|
pickerType = "images"
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue