From daeee039faa43002ecb8657dea21f284656b37e4 Mon Sep 17 00:00:00 2001 From: DasPoschi Date: Sun, 4 Jan 2026 14:20:38 +0100 Subject: [PATCH 1/2] Update proxy sources for socks lists --- jd-webgui/app.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jd-webgui/app.py b/jd-webgui/app.py index e4f2761..951bcc4 100644 --- a/jd-webgui/app.py +++ b/jd-webgui/app.py @@ -388,7 +388,10 @@ def fetch_proxy_list(url: str) -> str: req = urllib.request.Request(url) log_connection(f"HTTP GET {url} (no-proxy)") with NO_PROXY_OPENER.open(req, timeout=20) as resp: - return resp.read().decode("utf-8", "replace") + text = resp.read().decode("utf-8", "replace") + if "\n" not in text and re.search(r"\s", text): + return re.sub(r"\s+", "\n", text.strip()) + return text def build_jdproxies_payload(text: str) -> Dict[str, Any]: if not text.strip(): @@ -1139,8 +1142,12 @@ def cancel(jobid: str): @app.get("/proxies", response_class=HTMLResponse) def proxies_get(): try: - socks5_in = fetch_proxy_list("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks5.txt") - socks4_in = fetch_proxy_list("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks4.txt") + socks5_in = fetch_proxy_list( + "https://api.proxyscrape.com/v4/free-proxy-list/get?request=displayproxies&protocol=socks5&timeout=10000&country=all&ssl=yes&anonymity=elite&skip=0&limit=2000" + ) + socks4_in = fetch_proxy_list( + "https://api.proxyscrape.com/v4/free-proxy-list/get?request=displayproxies&protocol=socks4&timeout=10000&country=all&ssl=yes&anonymity=elite&skip=0&limit=2000" + ) http_in = fetch_proxy_list("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt") s5 = format_proxy_lines(socks5_in, "socks5") From 194b16e09c31154bc2eacca480f7eeb7fe49538d Mon Sep 17 00:00:00 2001 From: DasPoschi Date: Sun, 4 Jan 2026 14:26:36 +0100 Subject: [PATCH 2/2] Remove HTTP proxies from UI --- jd-webgui/app.py | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/jd-webgui/app.py b/jd-webgui/app.py index e4f2761..f364494 100644 --- a/jd-webgui/app.py +++ b/jd-webgui/app.py @@ -388,7 +388,10 @@ def fetch_proxy_list(url: str) -> str: req = urllib.request.Request(url) log_connection(f"HTTP GET {url} (no-proxy)") with NO_PROXY_OPENER.open(req, timeout=20) as resp: - return resp.read().decode("utf-8", "replace") + text = resp.read().decode("utf-8", "replace") + if "\n" not in text and re.search(r"\s", text): + return re.sub(r"\s+", "\n", text.strip()) + return text def build_jdproxies_payload(text: str) -> Dict[str, Any]: if not text.strip(): @@ -1016,7 +1019,6 @@ def render_proxies_page( message: str = "", socks5_in: str = "", socks4_in: str = "", - http_in: str = "", out_text: str = "", export_path: str = "", ) -> str: @@ -1046,16 +1048,11 @@ def render_proxies_page( -
-
- -
-

JDownloader Import-Liste

-

Format: socks5://IP:PORT, socks4://IP:PORT, http://IP:PORT. Keine Prüfung/Validierung.

+

Format: socks5://IP:PORT, socks4://IP:PORT. Keine Prüfung/Validierung.

@@ -1069,7 +1066,6 @@ def render_proxies_page(
-
@@ -1139,18 +1135,19 @@ def cancel(jobid: str): @app.get("/proxies", response_class=HTMLResponse) def proxies_get(): try: - socks5_in = fetch_proxy_list("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks5.txt") - socks4_in = fetch_proxy_list("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks4.txt") - http_in = fetch_proxy_list("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt") + socks5_in = fetch_proxy_list( + "https://api.proxyscrape.com/v4/free-proxy-list/get?request=displayproxies&protocol=socks5&timeout=10000&country=all&ssl=yes&anonymity=elite&skip=0&limit=2000" + ) + socks4_in = fetch_proxy_list( + "https://api.proxyscrape.com/v4/free-proxy-list/get?request=displayproxies&protocol=socks4&timeout=10000&country=all&ssl=yes&anonymity=elite&skip=0&limit=2000" + ) s5 = format_proxy_lines(socks5_in, "socks5") s4 = format_proxy_lines(socks4_in, "socks4") - hp = format_proxy_lines(http_in, "http") - combined = "\n".join([x for x in [s5, s4, hp] if x.strip()]) + combined = "\n".join([x for x in [s5, s4] if x.strip()]) return HTMLResponse(render_proxies_page( socks5_in=socks5_in, socks4_in=socks4_in, - http_in=http_in, out_text=combined, export_path=PROXY_EXPORT_PATH, )) @@ -1161,18 +1158,15 @@ def proxies_get(): def proxies_post( socks5_in: str = Form(""), socks4_in: str = Form(""), - http_in: str = Form(""), ): try: s5 = format_proxy_lines(socks5_in, "socks5") s4 = format_proxy_lines(socks4_in, "socks4") - hp = format_proxy_lines(http_in, "http") - combined = "\n".join([x for x in [s5, s4, hp] if x.strip()]) + combined = "\n".join([x for x in [s5, s4] if x.strip()]) return HTMLResponse(render_proxies_page( socks5_in=socks5_in, socks4_in=socks4_in, - http_in=http_in, out_text=combined, export_path=PROXY_EXPORT_PATH, )) @@ -1181,7 +1175,6 @@ def proxies_post( error=str(e), socks5_in=socks5_in, socks4_in=socks4_in, - http_in=http_in, out_text="", export_path=PROXY_EXPORT_PATH, ), status_code=400) @@ -1190,19 +1183,16 @@ def proxies_post( def proxies_save( socks5_in: str = Form(""), socks4_in: str = Form(""), - http_in: str = Form(""), ): try: s5 = format_proxy_lines(socks5_in, "socks5") s4 = format_proxy_lines(socks4_in, "socks4") - hp = format_proxy_lines(http_in, "http") - combined = "\n".join([x for x in [s5, s4, hp] if x.strip()]) + combined = "\n".join([x for x in [s5, s4] if x.strip()]) export_path = save_proxy_export(combined) return HTMLResponse(render_proxies_page( message=f"Proxy-Liste gespeichert: {export_path}", socks5_in=socks5_in, socks4_in=socks4_in, - http_in=http_in, out_text=combined, export_path=export_path, )) @@ -1211,7 +1201,6 @@ def proxies_save( error=str(e), socks5_in=socks5_in, socks4_in=socks4_in, - http_in=http_in, out_text="", export_path=PROXY_EXPORT_PATH, ), status_code=400)