Skip to content

Instantly share code, notes, and snippets.

@5andr0
Forked from t0phr/GetPw.py
Last active November 17, 2021 18:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5andr0/43db9eb2c8f0574687f6588dab415775 to your computer and use it in GitHub Desktop.
Save 5andr0/43db9eb2c8f0574687f6588dab415775 to your computer and use it in GitHub Desktop.
Scan script for nzbget.
#!/usr/bin/python3.8
##############################################################################
### NZBGET SCAN SCRIPT ###
#
# Scans filename of incoming NZBs for embedded passwords.
#
##############################################################################
### OPTIONS ###
# The RegEx to match the password in the filename.
#regex=(.*)\{\{(.*)\}\}.nzb
### NZBGET SCAN SCRIPT ###
##############################################################################
import re
import getopt
import sys
import os
nzbfile = os.environ.get('NZBNP_NZBNAME')
regex = os.environ.get('NZBPO_REGEX')
if nzbfile:
pattern = re.compile(regex)
match = pattern.search(nzbfile)
password = ""
name = nzbfile
if match:
name = match.group(1)
password = match.group(2)
print("[NZB] NZBNAME=" + name)
if password:
print("[NZB] NZBPR_*Unpack:Password=" + password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment