From c6f1184e55d7963e976f265c5ce02b9cf790dbf5 Mon Sep 17 00:00:00 2001 From: wukko Date: Thu, 16 May 2024 21:28:42 +0600 Subject: [PATCH] services: clean up functions and improve readability --- src/modules/processing/services/bilibili.js | 2 +- src/modules/processing/services/ok.js | 18 ++++++--- src/modules/processing/services/pinterest.js | 8 ++-- src/modules/processing/services/reddit.js | 6 +-- src/modules/processing/services/rutube.js | 2 +- src/modules/processing/services/soundcloud.js | 21 +++++----- src/modules/processing/services/streamable.js | 5 ++- src/modules/processing/services/twitch.js | 10 +++-- src/modules/processing/services/vimeo.js | 40 ++++++++++++------- src/modules/processing/services/vine.js | 5 ++- src/modules/processing/services/vk.js | 5 ++- src/modules/processing/services/youtube.js | 2 +- 12 files changed, 78 insertions(+), 46 deletions(-) diff --git a/src/modules/processing/services/bilibili.js b/src/modules/processing/services/bilibili.js index 0475a44c..c562406a 100644 --- a/src/modules/processing/services/bilibili.js +++ b/src/modules/processing/services/bilibili.js @@ -31,7 +31,7 @@ function extractBestQuality(dashData) { async function com_download(id) { let html = await fetch(`https://bilibili.com/video/${id}`, { headers: { "user-agent": genericUserAgent } - }).then((r) => { return r.text() }).catch(() => { return false }); + }).then(r => r.text()).catch(() => {}); if (!html) return { error: 'ErrorCouldntFetch' }; if (!(html.includes('