mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-22 10:46:19 +01:00
api/tikok: catch an age restriction error
This commit is contained in:
parent
1559ed13af
commit
a1fa79f2f5
1 changed files with 11 additions and 2 deletions
|
@ -51,13 +51,22 @@ export default async function(obj) {
|
|||
return { error: "fetch.fail" };
|
||||
}
|
||||
|
||||
if (detail.isContentClassified) {
|
||||
return { error: "content.post.age" };
|
||||
}
|
||||
|
||||
if (!detail.author) {
|
||||
return { error: "fetch.empty" };
|
||||
}
|
||||
|
||||
let video, videoFilename, audioFilename, audio, images,
|
||||
filenameBase = `tiktok_${detail.author.uniqueId}_${postId}`,
|
||||
filenameBase = `tiktok_${detail.author?.uniqueId}_${postId}`,
|
||||
bestAudio; // will get defaulted to m4a later on in match-action
|
||||
|
||||
images = detail.imagePost?.images;
|
||||
|
||||
let playAddr = detail.video.playAddr;
|
||||
let playAddr = detail.video?.playAddr;
|
||||
|
||||
if (obj.h265) {
|
||||
const h265PlayAddr = detail?.video?.bitrateInfo?.find(b => b.CodecType.includes("h265"))?.PlayAddr.UrlList[0]
|
||||
playAddr = h265PlayAddr || playAddr
|
||||
|
|
Loading…
Reference in a new issue