From 0dcd36c16f0b248c9a803aa6c6aadc9dd3b0fd2c Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 25 Dec 2023 22:40:02 +0600 Subject: [PATCH] tumblr: formatting --- src/modules/processing/services/tumblr.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/processing/services/tumblr.js b/src/modules/processing/services/tumblr.js index 08b3a3e2..6b56ada0 100644 --- a/src/modules/processing/services/tumblr.js +++ b/src/modules/processing/services/tumblr.js @@ -3,10 +3,12 @@ import { genericUserAgent } from "../../config.js"; export default async function(obj) { let { subdomain } = psl.parse(obj.url.hostname); - if (subdomain?.includes('.')) + + if (subdomain?.includes('.')) { return { error: ['ErrorBrokenLink', 'tumblr'] } - else if (subdomain === 'www') - subdomain = undefined; + } else if (subdomain === 'www') { + subdomain = undefined + } let html = await fetch(`https://${subdomain ?? obj.user}.tumblr.com/post/${obj.id}`, { headers: { "user-agent": genericUserAgent } @@ -29,5 +31,5 @@ export default async function(obj) { } } else r = { error: 'ErrorEmptyDownload' }; - return r; + return r }