Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__pycache__
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 20 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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 "<segment bytes" in low_line: # msg id
message_id = line.split(">")[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 "<file" in low_line: # look for par2 files
elif "<file" in low_line and "subject=" in low_line: # look for par2 files
subject = line.split("subject=")[1].split(">")[0]
if ".par2" in low_line:
par = 1 # found a par file, next msg_ids of par2s
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down