From 299b46e940bf98fd45ad5b0865dcf058f72cbc31 Mon Sep 17 00:00:00 2001 From: wukko Date: Fri, 29 Mar 2024 06:42:01 +0600 Subject: [PATCH] tiktok: replace filter with find --- src/modules/processing/services/tiktok.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/processing/services/tiktok.js b/src/modules/processing/services/tiktok.js index ef74c0b9..c7645211 100644 --- a/src/modules/processing/services/tiktok.js +++ b/src/modules/processing/services/tiktok.js @@ -39,7 +39,7 @@ export default async function(obj) { } }).then((r) => { return r.json() }).catch(() => { return false }); - detail = detail?.aweme_list?.filter(v => v.aweme_id === postId)[0]; + detail = detail?.aweme_list?.find(v => v.aweme_id === postId); if (!detail) return { error: 'ErrorCouldntFetch' }; let video, videoFilename, audioFilename, isMp3, audio, images,