Page 1 of 1

post processing on Linux with python script

Posted: March 3rd, 2010, 8:59 am
by landski
This python Prowl script I found on this forum.

Code: Select all

import sys,urllib

# Get clean NZB name
job_name = sys.argv[3]

# Prowl API settings - http://prowl.weks.net/api.php
# Set Prowl API
API = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Set Prowl priority. 0 - Normal, 2 - Emergency, -2 - Very Low
priority = "0"

# Set job title/event name
job_title = "Download%20Complete"

# Get current date/time and strip spaces
from time import gmtime, strftime
event_time = strftime("%d/%m/%y %H:%M")
event_time=event_time.replace(' ', '%20')

# URL encode chars from NZB name that cause issues
job_name=job_name.replace(' ', '%20')
job_name=job_name.replace('_', '%20')
job_name=job_name.replace('.', '%20')

# Send download complete notification to iPhone - swap 'job_title' for 'event_time' if completion time is required instead of 'Download Complete'
urllib.urlopen("https://prowl.weks.net/publicapi/add?apikey=" + API + "&priority=" + priority + "&application=SABnzbd&event=" + event_time + "&description=" + job_name)
I named it Prowl.py, and it runs fine under OSX, but when I try to run it as a post-processing script in Linux (actually on a QNAP TS-509) I get the error:
Exit(-1) Cannot run script
I have placed the script in accessible shares, and through a Web File Manager changed the file permissions for Prowl.py to 777, but to no avail.

Any suggestions for a linux noob?

Re: post processing on Linux with python script

Posted: March 7th, 2010, 3:48 pm
by konti
Try starting your script with: #! /usr/bin/python

Re: post processing on Linux with python script

Posted: March 12th, 2010, 7:45 am
by landski
Yep, that did the trick.

ThanksĀ  ;D

Re: post processing on Linux with python script

Posted: February 3rd, 2011, 12:24 am
by drewdatrip
what are the pre-req installs for this to work on your QNAP?

Drew