Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-guides/TRaSH-Guides/blame/commit/69cd0b099f73d63b0031ea046cddedd4a56984c5/Downloaders/NZBGet/scripts/replace_for/replace_for.py You should set ROOT_URL correctly, otherwise the web may not work correctly.
TRaSH-Guides/Downloaders/NZBGet/scripts/replace_for/replace_for.py

40 lines
1.1 KiB

#!/usr/bin/env python3
#
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Replace underscore with dot.
#
# Author: miker
#
#
# Copy script to NZBGet's script folder.
# Run sudo chmod +x replace_for.py
#
#
# NOTE: This script requires Python to be installed on your system.
### NZBGET POST-PROCESSING SCRIPT ###
##############################################################################
from __future__ import print_function
import os, re, sys
# Exit codes used by NZBGet
POSTPROCESS_SUCCESS=93
POSTPROCESS_ERROR=94
POSTPROCESS_SKIP=95
directory = os.environ['NZBPP_DIRECTORY']
print('Directory used is: ',directory)
for path, currentDirectory, files in os.walk(directory):
for file in files:
if file.find("_") !=-1:
dst = file.replace('_', '.')
os.rename (os.path.join(path,file),os.path.join(path,dst) )
print('Result: ',file," renamed to ",dst)
sys.exit(POSTPROCESS_SUCCESS)