From c692eb700f280216069e32f7e28ad4155d64a4ac Mon Sep 17 00:00:00 2001 From: Karl Hudgell Date: Tue, 13 Jun 2023 19:41:37 +0100 Subject: [PATCH] more linting --- src/widgets/jdownloader/proxy.js | 5 +++-- src/widgets/jdownloader/tools.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widgets/jdownloader/proxy.js b/src/widgets/jdownloader/proxy.js index 445f1e2e..40dba1ad 100644 --- a/src/widgets/jdownloader/proxy.js +++ b/src/widgets/jdownloader/proxy.js @@ -134,8 +134,9 @@ export default async function jdownloaderProxyHandler(req, res) { return res.status(400).json({ error: "Invalid proxy service type" }); } logger.debug("Getting data from JDRss API"); - const username = widget.username - const password = widget.password + const {username} = widget + const {password} = widget + const appKey = "homepage" const loginSecret = sha256(`${username}${password}server`) const deviceSecret = sha256(`${username}${password}device`) diff --git a/src/widgets/jdownloader/tools.js b/src/widgets/jdownloader/tools.js index 08bcdf1a..d678b072 100644 --- a/src/widgets/jdownloader/tools.js +++ b/src/widgets/jdownloader/tools.js @@ -48,8 +48,8 @@ export function encrypt(data, ivKey) { const stringIVKey = ivKey.toString('hex'); const stringIV = stringIVKey.substring(0, stringIVKey.length / 2); const stringKey = stringIVKey.substring(stringIVKey.length / 2, stringIVKey.length); - const iv = new Buffer(stringIV, 'hex'); - const key = new Buffer(stringKey, 'hex'); + const iv = Buffer.from(stringIV, 'hex'); + const key = Buffer.from(stringKey, 'hex'); const cipher = crypto.createCipheriv('aes-128-cbc', key, iv); return cipher.update(data, 'utf8', 'base64') + cipher.final('base64'); } \ No newline at end of file