diff --git a/.gitignore b/.gitignore index bee8a64..e0e8c99 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__ +.DS_Store diff --git a/README.md b/README.md index 16d6576..b86c630 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ If you need support for Python 2.x versions then you can get legacy version v1.1 ## NZBGet Versions -- stable v23+ [v3.1](https://github.com/nzbgetcom/Extension-Completion/releases/tag/v3.1) +- stable v23+ [v3.2](https://github.com/nzbgetcom/Extension-Completion/releases/tag/v3.2) - legacy v22 [v2.0](https://github.com/nzbgetcom/Extension-Completion/releases/tag/v2.0) # Completion diff --git a/main.py b/main.py index 67818b1..e826f8c 100644 --- a/main.py +++ b/main.py @@ -37,6 +37,7 @@ # Defining constants +CERT_STORE = os.environ.get("NZBOP_CertStore", None) AGE_LIMIT = int(os.environ.get("NZBPO_AgeLimit", 4)) AGE_LIMIT_SEC = 3600 * AGE_LIMIT AGE_SORT_LIMIT = int(os.environ.get("NZBPO_AgeSortLimit", 48)) @@ -822,13 +823,15 @@ def get_nzb_data(fname): all_msg_ids = [] # list of message ids for NNTP server group = None groups = None + subject = "" + par = 0 for line in lines: low_line = line.lower() if "")[1].split("<")[0] ok = -1 # = no check / failed; 1,2,.. ok for server num all_msg_ids.append([subject, par, groups, message_id, ok]) - elif "")[0] if ".par2" in low_line: par = 1 # found a par file, next msg_ids of par2s @@ -1130,6 +1133,22 @@ def create_sockets(server, articles_to_check): if encryption: context = ssl.create_default_context() + if CERT_STORE and os.path.exists(CERT_STORE): + if VERBOSE: + print(f"[V] Loading CertStore from: {CERT_STORE}") + try: + if os.path.isfile(CERT_STORE): + context.load_verify_locations(cafile=CERT_STORE) + else: + context.load_verify_locations(capath=CERT_STORE) + except Exception as e: + print(f"[WARNING] Failed to load CertStore: {e}") + context.check_hostname = False + context.verify_mode = ssl.CERT_NONE + else: + context.check_hostname = False + context.verify_mode = ssl.CERT_NONE + for i in range(start_sock, end_sock): s = socket.socket(af, socket.SOCK_STREAM) try: diff --git a/manifest.json b/manifest.json index f0f19ac..3f65eca 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "homepage": "https://github.com/nzbgetcom/Extension-Completion", "kind": "SCAN/QUEUE/SCHEDULER", "displayName": "Completion", - "version": "3.1", + "version": "3.2", "nzbgetMinVersion": "23.0", "author": "kloaknet", "license": "GPLv3",