more linting

This commit is contained in:
Karl Hudgell 2023-06-13 19:41:37 +01:00
parent 6a854ce66c
commit c692eb700f
2 changed files with 5 additions and 4 deletions

View File

@ -134,8 +134,9 @@ export default async function jdownloaderProxyHandler(req, res) {
return res.status(400).json({ error: "Invalid proxy service type" }); return res.status(400).json({ error: "Invalid proxy service type" });
} }
logger.debug("Getting data from JDRss API"); logger.debug("Getting data from JDRss API");
const username = widget.username const {username} = widget
const password = widget.password const {password} = widget
const appKey = "homepage" const appKey = "homepage"
const loginSecret = sha256(`${username}${password}server`) const loginSecret = sha256(`${username}${password}server`)
const deviceSecret = sha256(`${username}${password}device`) const deviceSecret = sha256(`${username}${password}device`)

View File

@ -48,8 +48,8 @@ export function encrypt(data, ivKey) {
const stringIVKey = ivKey.toString('hex'); const stringIVKey = ivKey.toString('hex');
const stringIV = stringIVKey.substring(0, stringIVKey.length / 2); const stringIV = stringIVKey.substring(0, stringIVKey.length / 2);
const stringKey = stringIVKey.substring(stringIVKey.length / 2, stringIVKey.length); const stringKey = stringIVKey.substring(stringIVKey.length / 2, stringIVKey.length);
const iv = new Buffer(stringIV, 'hex'); const iv = Buffer.from(stringIV, 'hex');
const key = new Buffer(stringKey, 'hex'); const key = Buffer.from(stringKey, 'hex');
const cipher = crypto.createCipheriv('aes-128-cbc', key, iv); const cipher = crypto.createCipheriv('aes-128-cbc', key, iv);
return cipher.update(data, 'utf8', 'base64') + cipher.final('base64'); return cipher.update(data, 'utf8', 'base64') + cipher.final('base64');
} }