From 28f98dd747eb8bd642582747ad8971b95bc9cca1 Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 4 Sep 2022 11:40:40 +0600 Subject: [PATCH] Update twitter.js --- src/modules/services/twitter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/services/twitter.js b/src/modules/services/twitter.js index ff98f493..a0a9741b 100644 --- a/src/modules/services/twitter.js +++ b/src/modules/services/twitter.js @@ -23,7 +23,7 @@ export default async function(obj) { return { error: loc(obj.lang, 'ErrorCantConnectToServiceAPI', 'twitter') } }) let parsbod = JSON.parse(req_status.body); - if (parsbod.hasOwnProperty("extended_entities") && parsbod["extended_entities"].hasOwnProperty("media")) { + if (parsbod["extended_entities"] && parsbod["extended_entities"]["media"]) { let media = parsbod["extended_entities"]["media"][0] if (media["type"] === "video" || media["type"] === "animated_gif") { return { urls: media["video_info"]["variants"].filter((v) => { if (v["content_type"] == "video/mp4") return true; }).sort((a, b) => Number(b.bitrate) - Number(a.bitrate))[0]["url"].split('?')[0], audioFilename: `twitter_${obj.id}_audio` }