[Python] sabnma - Notify My Android PP script.

Come up with a useful post-processing script? Share it here!
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

[Python] sabnma - Notify My Android PP script.

Post by sweetie »

Hi.


https://github.com/dryes/sabnma


* sabnma is a SABnzbd+ post-processing script to notify with NMA (Notify My Android - https://www.notifymyandroid.com/).

## dependencies:

* Python2
* PyNMA - https://github.com/uskr/pynma/zipball/master

## usage:

* Download both sabnma.py and the PyNMA zip from above.
* Unzip PyNMA and place sabnma.py alongside test.py.
* Set API key at the base of the script. (https://www.notifymyandroid.com/account.jsp)
* Place files (pynma directory too) inside SABnzbd+ scripts path and set as post-processing script.

## notes:

* This can be called both directly by SAB, and also from a parent script - pass the 7 args returned by SAB to it.
Last edited by sweetie on June 6th, 2012, 2:23 pm, edited 1 time in total.
User avatar
sander
Release Testers
Release Testers
Posts: 9070
Joined: January 22nd, 2008, 2:22 pm

Re: [Python] sabnma [Notify My Android PP script.]

Post by sander »

I didn't know NMA / Notify My Android ... I checked on Google Play, and it costs € 3.15 *and* is only used by a few thousand users. And there is no free (trial / ad) version ... :-(

Do you find NMA worth the money?
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

Re: [Python] sabnma [Notify My Android PP script.]

Post by sweetie »

sander wrote:Do you find NMA worth the money?
If I were to reply honestly, I'd probably be breaking forum rules.

It is rather handy though, particularly for TV.
User avatar
centurion
Release Testers
Release Testers
Posts: 5
Joined: September 4th, 2010, 5:06 am

Re: [Python] sabnma - Notify My Android PP script.

Post by centurion »

I've been using it as a replacement for Notifo and so far I'm happy with it. When I first got the app it hadn't been updated in awhile, which concerned me because I have a Galaxy Nexus and wasn't sure how well it'd work with ICS. I went for it anyway and didn't have any problems. Recently the dev has been on a update streak, so there have been all sorts of great updates that have made it way better. I'm also playing with Pushover, which recently released an Android version of their app (they use to just support iOS), but I haven't found anything that they offer better over NMA. Though, I guess it just depends on how many people you're pushing updates to and what platforms they use. Thankfully I keep an Android household, so NMA works fine :-)

I'll be trying this script when I get some free time. Thanks for contributing to the community!
dirtymurt
Newbie
Newbie
Posts: 8
Joined: April 30th, 2009, 1:36 pm

Re: [Python] sabnma - Notify My Android PP script.

Post by dirtymurt »

I am stuggling to get this to work and would appreciate some help please?

in sab I get the message python' is not recognized as an internal or external command,
operable program or batch file.

i have set the path to python27

if i call it from within a command prompt i get this

Traceback (most recent call last):
File "C:\mrt\sabnma.py", line 42, in <module>
main(sys.argv, apikey)
File "C:\mrt\sabnma.py", line 22, in main
message = argv[3] + ' [' + argv[5] + ']'
IndexError: list index out of range

any idea what is wrong please?
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

Re: [Python] sabnma - Notify My Android PP script.

Post by sweetie »

dirtymurt wrote:I am stuggling to get this to work and would appreciate some help please?

in sab I get the message python' is not recognized as an internal or external command,
operable program or batch file.

i have set the path to python27

if i call it from within a command prompt i get this

Traceback (most recent call last):
File "C:\mrt\sabnma.py", line 42, in <module>
main(sys.argv, apikey)
File "C:\mrt\sabnma.py", line 22, in main
message = argv[3] + ' [' + argv[5] + ']'
IndexError: list index out of range

any idea what is wrong please?
You need to associate .py files with pythonw, apparantly. Then reboot.

The second error is because there were none of the expected parameters passed.
dirtymurt
Newbie
Newbie
Posts: 8
Joined: April 30th, 2009, 1:36 pm

Re: [Python] sabnma - Notify My Android PP script.

Post by dirtymurt »

still no go. i have associated .py files with pythonw but stil getting the same error
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

Re: [Python] sabnma - Notify My Android PP script.

Post by sweetie »

dirtymurt wrote:still no go. i have associated .py files with pythonw but stil getting the same error
Try: http://showmedo.com/videotutorials/vide ... riesID=96#
WTFox
Newbie
Newbie
Posts: 12
Joined: August 7th, 2012, 7:29 pm

Re: [Python] sabnma - Notify My Android PP script.

Post by WTFox »

Just dropping by to give a quick "Thanks!" :D I rewrote the message part slight so that I could integrate this into another script I've written that will grab the rating if it's a movie. So something downloads in the movie category, the notification will be "Due Date (2010) 55% [movie]."

Now that I'm aware of the PyNMA library, I'm looking for other things I need notifications for. :P
a8ree
Newbie
Newbie
Posts: 2
Joined: September 24th, 2012, 7:41 am

Re: [Python] sabnma - Notify My Android PP script.

Post by a8ree »

Sorry, i must be missing something....

Where do I need to insert the APIKEY? Should I be doing a search and replace for where APIKEY in the script? (I see it 3 times in the SABNMA file).

I tried doing just that and got

SABnzb\Scripts\sabnma.py", line 4
<!DOCTYPE html>
^
SyntaxError: invalid syntax

Any ideas?
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

Re: [Python] sabnma - Notify My Android PP script.

Post by sweetie »

a8ree wrote:Sorry, i must be missing something....

Where do I need to insert the APIKEY? Should I be doing a search and replace for where APIKEY in the script? (I see it 3 times in the SABNMA file).

I tried doing just that and got

SABnzb\Scripts\sabnma.py", line 4
<!DOCTYPE html>
^
SyntaxError: invalid syntax

Any ideas?

Don't know what you've got in there, but it's not python.

Paste this: https://github.com/dryes/sabnma/raw/master/sabnma.py into it and on the 41st (second from bottom) line, replace:
apikey = 'setme - retain quotes'
with:
apikey = 'yourapikeyfromsite'
a8ree
Newbie
Newbie
Posts: 2
Joined: September 24th, 2012, 7:41 am

Re: [Python] sabnma - Notify My Android PP script.

Post by a8ree »

Thanks!

Not sure where the hell I managed to get that file in retrospect!

All sorted and working now....Cheers
shepscrook
Newbie
Newbie
Posts: 11
Joined: October 29th, 2010, 12:37 pm

Re: [Python] sabnma - Notify My Android PP script.

Post by shepscrook »

I'm stuck with this at the moment. I've edited the file to have the API key, however I have no idea how I add this script to SAB or where to put these files. I was hoping there'd be more of a step by step for this for newbs. I'm not a newb to SAB, however I'm new to adding scripts.
canaan
Newbie
Newbie
Posts: 4
Joined: October 13th, 2012, 9:39 pm

Re: [Python] sabnma - Notify My Android PP script.

Post by canaan »

shepscrook: files should go wherever the SABnzbd scripts folder is. this can be found on the config page under 'Folders', then 'Post Processing Scripts Folder'. Then you would go to the Categories page in config and choose to run the PY file upon completion of your chosen file type.

sweetie: I can't seem to get the file to run. I get the following error when my download completes and SAB tries to run your script:
" ionice: can't execute '/sabnzbd/scripts/sabnma.py': No such file or directory"
Any idea why this may be?
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

Re: [Python] sabnma - Notify My Android PP script.

Post by sweetie »

canaan wrote:sweetie: I can't seem to get the file to run. I get the following error when my download completes and SAB tries to run your script:
" ionice: can't execute '/sabnzbd/scripts/sabnma.py': No such file or directory"
Any idea why this may be?
Looks like you've set the paths up wrongly unless you have a 'sabnzbd' directory in root - which is unlikely and probably not advised. Path should probably be:

Code: Select all

/home/username/.sabnzbd/scripts
It could also be something to do with ionice, don't use it myself though.
Post Reply