diff --git a/public/locales/de/common.json b/public/locales/de/common.json
index ec3b6e39..f13cd028 100644
--- a/public/locales/de/common.json
+++ b/public/locales/de/common.json
@@ -292,5 +292,11 @@
"containers_scanned": "Scanned",
"containers_updated": "Updated",
"containers_failed": "Failed"
+ },
+ "pyload": {
+ "speed": "Geschwindigkeit",
+ "active": "Aktiv",
+ "queue": "Warteschlange",
+ "total": "Gesamt"
}
}
diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index dd00ff86..913a3d9b 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -303,5 +303,11 @@
"rejectedPushes": "Rejected",
"filters": "Filters",
"indexers": "Indexers"
+ },
+ "pyload": {
+ "speed": "Speed",
+ "active": "Active",
+ "queue": "Queue",
+ "total": "Total"
}
}
diff --git a/src/widgets/components.js b/src/widgets/components.js
index c2b50189..ce5aa41a 100644
--- a/src/widgets/components.js
+++ b/src/widgets/components.js
@@ -25,6 +25,7 @@ const components = {
portainer: dynamic(() => import("./portainer/component")),
prowlarr: dynamic(() => import("./prowlarr/component")),
proxmox: dynamic(() => import("./proxmox/component")),
+ pyload: dynamic(() => import("./pyload/component")),
qbittorrent: dynamic(() => import("./qbittorrent/component")),
radarr: dynamic(() => import("./radarr/component")),
readarr: dynamic(() => import("./readarr/component")),
diff --git a/src/widgets/pyload/component.jsx b/src/widgets/pyload/component.jsx
new file mode 100644
index 00000000..a15aab4c
--- /dev/null
+++ b/src/widgets/pyload/component.jsx
@@ -0,0 +1,27 @@
+import { useTranslation } from 'next-i18next'
+
+import Container from 'components/services/widget/container'
+import Block from 'components/services/widget/block'
+import useWidgetAPI from 'utils/proxy/use-widget-api'
+
+export default function Component({ service }) {
+ const { t } = useTranslation()
+ const { widget } = service
+ const { data: pyloadData, error: pyloadError } = useWidgetAPI(
+ widget,
+ 'statusServer',
+ )
+
+ if (pyloadError || !pyloadData) {
+ return
+ }
+
+ return (
+
+
+
+
+
+
+ )
+}
diff --git a/src/widgets/pyload/proxy.js b/src/widgets/pyload/proxy.js
new file mode 100644
index 00000000..35fb7bec
--- /dev/null
+++ b/src/widgets/pyload/proxy.js
@@ -0,0 +1,38 @@
+import getServiceWidget from "utils/config/service-helpers";
+import { formatApiCall } from "utils/proxy/api-helpers";
+import widgets from "widgets/widgets";
+
+export default async function pyloadProxyHandler(req, res) {
+ const { group, service, endpoint } = req.query;
+
+ if (group && service) {
+ const widget = await getServiceWidget(group, service);
+
+ if (widget) {
+ const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget }));
+ const loginUrl = `${widget.url}/api/login`;
+
+ // Pyload api does not support argument passing as JSON.
+ const sessionId = await fetch(loginUrl, {
+ method: "POST",
+ // Empty passwords are supported.
+ body: `username=${widget.username}&password=${widget.password ?? ''}`,
+ headers: {
+ "Content-Type": "application/x-www-form-urlencoded",
+ },
+ }).then((response) => response.json());
+
+ const apiResponse = await fetch(url, {
+ method: "POST",
+ body: `session=${sessionId}`,
+ headers: {
+ "Content-Type": "application/x-www-form-urlencoded",
+ },
+ }).then((response) => response.json());
+
+ return res.send(apiResponse);
+ }
+ }
+
+ return res.status(400).json({ error: "Invalid proxy service type" });
+}
diff --git a/src/widgets/pyload/widget.js b/src/widgets/pyload/widget.js
new file mode 100644
index 00000000..3d2f2958
--- /dev/null
+++ b/src/widgets/pyload/widget.js
@@ -0,0 +1,8 @@
+import pyloadProxyHandler from "./proxy";
+
+const widget = {
+ api: "{url}/api/{endpoint}",
+ proxyHandler: pyloadProxyHandler,
+};
+
+export default widget;
diff --git a/src/widgets/widgets.js b/src/widgets/widgets.js
index 74f426b3..eb5bec48 100644
--- a/src/widgets/widgets.js
+++ b/src/widgets/widgets.js
@@ -20,6 +20,7 @@ import plex from "./plex/widget";
import portainer from "./portainer/widget";
import prowlarr from "./prowlarr/widget";
import proxmox from "./proxmox/widget";
+import pyload from "./pyload/widget";
import qbittorrent from "./qbittorrent/widget";
import radarr from "./radarr/widget";
import readarr from "./readarr/widget";
@@ -58,6 +59,7 @@ const widgets = {
portainer,
prowlarr,
proxmox,
+ pyload,
qbittorrent,
radarr,
readarr,