Append the nfo to the email status

Want something added? Ask for it here.
Post Reply
MageMinds
Release Testers
Release Testers
Posts: 73
Joined: August 14th, 2008, 6:37 am

Append the nfo to the email status

Post by MageMinds »

I wish I would receive the content of the nfo or have the nfo attached to the email when a job is successfully completed...

Thanks
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Append the nfo to the email status

Post by shypike »

Write a user script which just contains:

Code: Select all

@echo off
type "%1\*.nfo"
That way your NFO will be listed in the body of the email.
MageMinds
Release Testers
Release Testers
Posts: 73
Joined: August 14th, 2008, 6:37 am

Re: Append the nfo to the email status

Post by MageMinds »

You're right, that's clever... Thanks!
Karyudo
Newbie
Newbie
Posts: 10
Joined: July 26th, 2008, 11:28 pm

Re: Append the nfo to the email status

Post by Karyudo »

This sounds cool, but I'm a huge dummy. Could you give me juuust a little more info on how to set this up? I don't see anywhere obvious. (I'm running 4.12 rather than a 5.x alpha/beta -- does that make a difference?)
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Append the nfo to the email status

Post by shypike »

0.4.12 supports it too.
See: http://sabnzbd.wikidot.com/user-scripts
Use notepad to create a text file containing the lines.
Save in a separate folder as file type-nfo.cmd.
Fill in the full path to the folder in the "script" field in Config->Folders (click Save).
In Config->Switches, pick the right script in the "Default Script" selection box.
Eejit
Sr. Member
Sr. Member
Posts: 267
Joined: September 10th, 2008, 5:46 pm

Re: Append the nfo to the email status

Post by Eejit »

That's brilliant.!!
Took me a while to get it sorted because under Win7, it would appear that the quotes have to be removed, which
is different from:- http://sabnzbd.wikidot.com/user-scripts

A Microsoft undocumented change?  :-\
Eejit - The name say's it all !!
Image
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Append the nfo to the email status

Post by shypike »

No, the example I gave is incorrect, the Wiki page is true.
I sometimes forget, because it's so counter-intuitive.
We'd prefer that a Windows script would receive parameters without quotes.
BTW: this is not Microsoft's fault, but that of the designers of the Python runtime library.
Eejit
Sr. Member
Sr. Member
Posts: 267
Joined: September 10th, 2008, 5:46 pm

Re: Append the nfo to the email status

Post by Eejit »

Here's what confused me. From the Wiki
http://sabnzbd.wikidot.com/user-scripts wrote:Please note that in Windows the parameters will be enclosed in double quotes ("my name").
This is what I used under Win7

Code: Select all

echo off
type %1\*.nfo
Unless I've totaly mis-understood it, which wouldn't be the first time  ;)
Eejit - The name say's it all !!
Image
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Append the nfo to the email status

Post by shypike »

There is no contradiction.
Normally when you get parameters that may contain spaces, you need to add quotes.
So normally you would write this:

Code: Select all

@echo off
type "%1\*.nfo"
This is the proper way to do it in Windows.
However, since the Python runtime always includes the quotes, you cannot add them again in your script.
So you must write:

Code: Select all

@echo off
type %1\*.nfo
Combining SABnzbd and the first script would result in this:

Code: Select all

@echo off
type ""c:\mypath\myfolder\hello.nfo""
This, Windows doesn't understand.
Karyudo
Newbie
Newbie
Posts: 10
Joined: July 26th, 2008, 11:28 pm

Re: Append the nfo to the email status

Post by Karyudo »

shypike wrote: 0.4.12 supports it too.
See: http://sabnzbd.wikidot.com/user-scripts
Use notepad to create a text file containing the lines.
Save in a separate folder as file type-nfo.cmd.
Fill in the full path to the folder in the "script" field in Config->Folders (click Save).
In Config->Switches, pick the right script in the "Default Script" selection box.
I got it working! And then I broke it, by tinkering. I modified to script to read:

Code: Select all

@echo off
type %1\*.nfo
echo
echo Path to files: %1
echo NZB Filename: %2
echo Newzbin Report: %4
echo Category: %5
echo Usenet Group: %6
In the .log file, I'm getting the .nfo files for every episode I've already downloaded, which isn't exactly what I'd expected, but makes sense given the "\*.nfo" part.

Also, I'm getting sabnzbd hanging on the "Running Script..." portion. It just never completes.

Any ideas??
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Append the nfo to the email status

Post by shypike »

Are you using TV sorting so that files are dumped in a single folder?
(So that you have all nfo's in a single folder).

I don't know about the "hangup".
It may help if you end the script with:

Code: Select all

exit 0
Karyudo
Newbie
Newbie
Posts: 10
Joined: July 26th, 2008, 11:28 pm

Re: Append the nfo to the email status

Post by Karyudo »

Yeah, I've got all the eps from any given show in one folder, so all the .nfos get appended. Hmm...

My installation also hangs when unRARing sometimes; I might just need to troubleshoot some larger issue. But I'll try the "exit 0" line and see...

Thanks!
Post Reply