From a20b5525f07d8dcbf9e48c75713b9ea13501586b Mon Sep 17 00:00:00 2001 From: Username Date: Fri, 26 Dec 2025 19:34:22 +0100 Subject: [PATCH] ppf: handle confidence field in proxy tuples --- ppf.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ppf.py b/ppf.py index 2c9c3e3..dddb66e 100644 --- a/ppf.py +++ b/ppf.py @@ -12,7 +12,6 @@ from config import Config import fetch import sys from soup_parser import set_nobs -import re import threading import random @@ -153,8 +152,8 @@ class Leechered(threading.Thread): # Content changed or first fetch - reset stale_count, proceed with normal processing self.stale_count = 0 - # unique is list of (address, proto) tuples; filter by address, keep tuple - self.proxylist = [(addr, pr) for addr, pr in unique if not fetch.is_known_proxy(addr)] + # unique is list of (address, proto, confidence) tuples; filter by address, keep tuple + self.proxylist = [(addr, pr, conf) for addr, pr, conf in unique if not fetch.is_known_proxy(addr)] proxy_count = len(self.proxylist) if self.retrievals == 0: # new site @@ -267,10 +266,10 @@ def main(): for thread in threads: if thread.status == 'ok': url, proxylist, stale_count, error, retrievals, content_type, proxies_added, execute = thread.retrieve() - # proxylist is list of (address, proto) tuples - new = [(addr, pr) for addr, pr in proxylist if not fetch.is_known_proxy(addr)] + # proxylist is list of (address, proto, confidence) tuples + new = [(addr, pr, conf) for addr, pr, conf in proxylist if not fetch.is_known_proxy(addr)] if new: - fetch.add_known_proxies([addr for addr, pr in new]) + fetch.add_known_proxies([addr for addr, pr, conf in new]) # Update content_hash if we have a new one new_hash = thread.new_hash execute = (error, stale_count, int(time.time()), retrievals, proxies_added+len(new), content_type, new_hash, url)