Merge branch 'benphelps:main' into main

This commit is contained in:
Karl0ss 2023-06-16 09:03:32 +01:00 committed by GitHub
commit a2dcc68111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 139 additions and 91 deletions

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -648,6 +648,7 @@
"jdownloader": { "jdownloader": {
"downloadSpeed": "Download Speed", "downloadSpeed": "Download Speed",
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -648,6 +648,7 @@
"jdownloader": { "jdownloader": {
"downloadSpeed": "Download Speed", "downloadSpeed": "Download Speed",
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -655,8 +655,9 @@
"updates": "Updates" "updates": "Updates"
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue",
"downloadQueueSize": "Queue Size", "downloadBytesRemaining": "Remaining",
"downloadSpeed": "Download Speed" "downloadTotalBytes": "Size",
"downloadSpeed": "Speed"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Recuento de las colas", "downloadCount": "Recuento de las colas",
"downloadQueueSize": "Tamaño de la cola", "downloadSpeed": "Velocidad de Descarga",
"downloadSpeed": "Velocidad de Descarga" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Total en attente", "downloadCount": "Total en attente",
"downloadQueueSize": "Volume en attente", "downloadSpeed": "Vitesse de téléchargement",
"downloadSpeed": "Vitesse de téléchargement" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -648,6 +648,7 @@
"jdownloader": { "jdownloader": {
"downloadSpeed": "Download Speed", "downloadSpeed": "Download Speed",
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size" "downloadTotalBytes": "Size",
"downloadBytesRemaining": "Remaining"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -656,7 +656,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Всього в черзі", "downloadCount": "Всього в черзі",
"downloadQueueSize": "Розмір черги", "downloadSpeed": "Швидкість завантаження",
"downloadSpeed": "Швидкість завантаження" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -647,7 +647,8 @@
}, },
"jdownloader": { "jdownloader": {
"downloadCount": "Queue Count", "downloadCount": "Queue Count",
"downloadQueueSize": "Queue Size", "downloadSpeed": "Download Speed",
"downloadSpeed": "Download Speed" "downloadBytesRemaining": "Remaining",
"downloadTotalBytes": "Size"
} }
} }

View File

@ -21,7 +21,8 @@ export default function Component({ service }) {
return ( return (
<Container service={service}> <Container service={service}>
<Block label="jdownloader.downloadCount" /> <Block label="jdownloader.downloadCount" />
<Block label="jdownloader.downloadQueueSize" /> <Block label="jdownloader.downloadTotalBytes" />
<Block label="jdownloader.downloadBytesRemaining" />
<Block label="jdownloader.downloadSpeed" /> <Block label="jdownloader.downloadSpeed" />
</Container> </Container>
); );
@ -30,7 +31,8 @@ export default function Component({ service }) {
return ( return (
<Container service={service}> <Container service={service}>
<Block label="jdownloader.downloadCount" value={t("common.number", { value: jdownloaderData.downloadCount })} /> <Block label="jdownloader.downloadCount" value={t("common.number", { value: jdownloaderData.downloadCount })} />
<Block label="jdownloader.downloadQueueSize" value={t("common.bytes", { value: jdownloaderData.totalBytes })} /> <Block label="jdownloader.downloadTotalBytes" value={t("common.bytes", { value: jdownloaderData.totalBytes })} />
<Block label="jdownloader.downloadBytesRemaining" value={t("common.bytes", { value: jdownloaderData.bytesRemaining })} />
<Block label="jdownloader.downloadSpeed" value={t("common.byterate", { value: jdownloaderData.totalSpeed })} /> <Block label="jdownloader.downloadSpeed" value={t("common.byterate", { value: jdownloaderData.totalSpeed })} />
</Container> </Container>
); );

View File

@ -28,8 +28,8 @@ async function getWidget(req) {
async function login(loginSecret, deviceSecret, params) { async function login(loginSecret, deviceSecret, params) {
const rid = uniqueRid(); const rid = uniqueRid();
const path = `/my/connect?${querystring.stringify({...params, rid})}`; const path = `/my/connect?${querystring.stringify({ ...params, rid })}`;
const signature = crypto const signature = crypto
.createHmac('sha256', loginSecret) .createHmac('sha256', loginSecret)
.update(path) .update(path)
@ -64,7 +64,7 @@ async function login(loginSecret, deviceSecret, params) {
async function getDevice(serverEncryptionToken, deviceName, params) { async function getDevice(serverEncryptionToken, deviceName, params) {
const rid = uniqueRid(); const rid = uniqueRid();
const path = `/my/listdevices?${querystring.stringify({...params, rid})}`; const path = `/my/listdevices?${querystring.stringify({ ...params, rid })}`;
const signature = crypto const signature = crypto
.createHmac('sha256', serverEncryptionToken) .createHmac('sha256', serverEncryptionToken)
.update(path) .update(path)
@ -100,7 +100,7 @@ function createBody(rid, query, params) {
rid, rid,
url: query url: query
}; };
return params ? {...baseBody, params: [JSON.stringify(params)] } : baseBody; return params ? { ...baseBody, params: [JSON.stringify(params)] } : baseBody;
} }
async function queryPackages(deviceEncryptionToken, deviceId, sessionToken, params) { async function queryPackages(deviceEncryptionToken, deviceId, sessionToken, params) {
@ -135,9 +135,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 const { username } = widget
const {password} = widget 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`)
@ -171,17 +171,22 @@ export default async function jdownloaderProxyHandler(req, res) {
} }
) )
let bytesRemaining = 0;
let totalBytes = 0; let totalBytes = 0;
let totalSpeed = 0; let totalSpeed = 0;
packageStatus.forEach(file => { packageStatus.forEach(file => {
totalBytes += file.bytesTotal; totalBytes += file.bytesTotal;
if (file.speed) { if (file.finished !== true) {
totalSpeed += file.speed; bytesRemaining += file.bytesTotal;
if (file.speed) {
totalSpeed += file.speed;
}
} }
}); });
const data = { const data = {
downloadCount: packageStatus.length, downloadCount: packageStatus.length,
bytesRemaining,
totalBytes, totalBytes,
totalSpeed totalSpeed
}; };