can you please help me to get a pre-queue script running on OS X?
I took the renaming script from Richard63 but it doesn't work and I can't reach him through pm.
https://forums.sabnzbd.org/viewtopic.php?f=9&t=21184
This is what I use from from Richards script. Is this right?
Code: Select all
#!/usr/bin/python
#
import sys
import os
import re
import urllib
import json
from urllib.request import urlopen
from urllib.request import Request
from urllib.parse import unquote
from urllib.parse import urlparse
#
try:
(full_path, job_name, PP, category, script_name, prio, dl_size, group_list, show_name, season_name, episode_nr, episode_name) = sys.argv
dl_size = int(dl_size)
except:
sys.exit(1) # exit with 1 causes SabNzbd to ignore this script.
# Determine new file name
#find_hd = re.search("\d\d\d\d\a", job_name).start() # doesnt work
find_year = re.search("\d\d\d\d", job_name).start() # position where year begins
movie_name = job_name[0:find_year-1].replace("."," ") # replace "dots" in job_name with "spaces"
movie_year = job_name[find_year:find_year+4] # find year in job_name
new_nzb_name = movie_name + " (" + movie_year + ")" # put Year in "(" and put name of movie in front of the year
#demo = new_nzb_name.replace(" ", "%20")
#print (demo)
# send results to SabNZBD
print ("1") # 0=Refuse, 1=Accept (correct me if i am wrong)
print (new_nzb_name)
print (PP)
print (category)
print (script_name)
print ("-100")
print (group_list)
sys.exit(0)
But when I upload a nzb nothing happens.
Any ideas? How can I test the script?
thanks