-
-
Save 5andr0/43db9eb2c8f0574687f6588dab415775 to your computer and use it in GitHub Desktop.
Scan script for nzbget.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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