Compare commits
3 Commits
codex/conf
...
codex/fetc
| Author | SHA1 | Date | |
|---|---|---|---|
| daeee039fa | |||
| 97a5afbee9 | |||
| a2de578087 |
@@ -388,7 +388,10 @@ def fetch_proxy_list(url: str) -> str:
|
|||||||
req = urllib.request.Request(url)
|
req = urllib.request.Request(url)
|
||||||
log_connection(f"HTTP GET {url} (no-proxy)")
|
log_connection(f"HTTP GET {url} (no-proxy)")
|
||||||
with NO_PROXY_OPENER.open(req, timeout=20) as resp:
|
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]:
|
def build_jdproxies_payload(text: str) -> Dict[str, Any]:
|
||||||
if not text.strip():
|
if not text.strip():
|
||||||
@@ -412,6 +415,7 @@ def build_jdproxies_payload(text: str) -> Dict[str, Any]:
|
|||||||
"*.jdownloader.org",
|
"*.jdownloader.org",
|
||||||
"",
|
"",
|
||||||
"*.your-server.de",
|
"*.your-server.de",
|
||||||
|
"88.99.115.46",
|
||||||
],
|
],
|
||||||
"type": "BLACKLIST",
|
"type": "BLACKLIST",
|
||||||
}
|
}
|
||||||
@@ -1138,8 +1142,12 @@ def cancel(jobid: str):
|
|||||||
@app.get("/proxies", response_class=HTMLResponse)
|
@app.get("/proxies", response_class=HTMLResponse)
|
||||||
def proxies_get():
|
def proxies_get():
|
||||||
try:
|
try:
|
||||||
socks5_in = fetch_proxy_list("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks5.txt")
|
socks5_in = fetch_proxy_list(
|
||||||
socks4_in = fetch_proxy_list("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks4.txt")
|
"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")
|
http_in = fetch_proxy_list("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt")
|
||||||
|
|
||||||
s5 = format_proxy_lines(socks5_in, "socks5")
|
s5 = format_proxy_lines(socks5_in, "socks5")
|
||||||
|
|||||||
Reference in New Issue
Block a user