added an error if tiktok response is empty
This commit is contained in:
parent
5dacc93076
commit
488e3fd1be
1 changed files with 4 additions and 2 deletions
|
@ -20,7 +20,9 @@ function selector(j, h, id) {
|
||||||
let t = j["aweme_list"].filter((v) => {
|
let t = j["aweme_list"].filter((v) => {
|
||||||
if (v["aweme_id"] == id) return true
|
if (v["aweme_id"] == id) return true
|
||||||
})
|
})
|
||||||
|
if (t.length > 0) {
|
||||||
return t[0]
|
return t[0]
|
||||||
|
} else return false
|
||||||
case "douyin":
|
case "douyin":
|
||||||
return j['item_list'][0]
|
return j['item_list'][0]
|
||||||
}
|
}
|
||||||
|
@ -50,7 +52,7 @@ export default async function(obj) {
|
||||||
} else throw new Error()
|
} else throw new Error()
|
||||||
} else throw new Error()
|
} else throw new Error()
|
||||||
}
|
}
|
||||||
|
if (!detail) return { error: loc(obj.lang, 'ErrorEmptyDownload') };
|
||||||
let video, videoFilename, audioFilename, isMp3, audio,
|
let video, videoFilename, audioFilename, isMp3, audio,
|
||||||
images = detail["image_post_info"] ? detail["image_post_info"]["images"] : false,
|
images = detail["image_post_info"] ? detail["image_post_info"]["images"] : false,
|
||||||
filenameBase = `${obj.host}_${obj.postId}`;
|
filenameBase = `${obj.host}_${obj.postId}`;
|
||||||
|
|
Loading…
Reference in a new issue