Traceback (most recent call last):
File "/Users/dasme/downloads/scripts/Prowl.py", line 5, in <module>
from prowlpy import Prowl
File "/Users/dasme/Downloads/scripts/prowlpy.py", line 12, in <module>
import httplib2
ImportError: No module named httplib2
yet if I run the script manually (eg ./Prowl.py 1 2 3)I get a Prowl notification ("3" completed), so I know that httplib2 is installed and working. I'm new to Python, not having used it before so I'm wondering if this is a simple fix? I'm on OSX btw
I'd like to have Prowl notifications from sabnzbd only if the download is incomplete/error message - if that's possible. If anyone has a script, I'd be more than happy
#!/usr/bin/env python
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 = "enter the prowl api key here "
# 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=" + job_title + "&description=" + job_name)
#!/usr/bin/env python
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 = "enter the prowl api key here "
# 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=" + job_title + "&description=" + job_name)
Nice, thanks, changed to Download%20Incomplete, it works like a charm. Thanks again
Originally, I created the script on my Windows machine, and used WinSCP to copy it to my linux box.
After making any changes to the script while troubleshooting, I would use the same method of editing it on my Windows machine and copying it back. Each time the script would fail with the same issue.
However, I found that if I edited the script using WinSCP directly on the linux box (instead of Notepad, and copying it back) - it seems to work. Code is exactly the same. Bizarre!
The bash shell gets confused when it reads a Windows text file,
because lines are terminated by a CR and an LF code (where Unix only uses LF).
The CR character is taken as part of the first line, so the "env" command looks for "python$",
where $ is the CR character.
The Python interpreter just ignores the extra characters.