Page 1 of 1

On finish script

Posted: November 27th, 2013, 9:40 pm
by elluce
Hello,

I have Sabnzbd 0.7.16 installed on Windows XP. I have created a script in bat file that acquires subs. Everything is fine when script is associated with category. Every job with given category ends with my script. Now, I don't want to run this script after each job. It would be better to run it once when queue is empty. So, I have chosen my script in "On finish" tab. Unfortunately nothing happens when queue becomes empty ;-(. Is "On finish" OK in this version of sabnzbd or I am doing something wrong? Thanks in advance ;-)

elluce

P.S.
It's not really a script. It is basic Windows batch. Name of the file is subs.cmd and it looks like this:

@echo on
cd "C:\Documents and Settings\elluce\Local Settings\Application Data\Sublight\App>"
c:
SublightCmd.exe batch "d:\grabit\downloads\seriale\\" "*.avi;*.mkv;*.mp4" "en" /recursive:true /smartdownload:true /skipRecentlySearched:false /username:"xxxxx" /password:"xxxxx"

Re: On finish script

Posted: November 28th, 2013, 1:37 pm
by jcfp
Start by checking the logs to see if the script gets executed; set logging level to 'debug' if necessary. And then there's part 2: does the script actually work. Some subtitle services went offline recently, most notably bierdopje.

Re: On finish script

Posted: November 28th, 2013, 3:36 pm
by elluce
Hello,

sadly, I know about bierdopje. That is the reason of dealing with this script. I am trying to get as close as possible to my previous solution auto-sub + bierdopje.
I have checked everything and it's like this:
When I add the job from RSS and manualy set script - everything works perfect.
Image
Image

When I assign script to the category - nothing happens.
Image
What is more, category of the download is recognized but script is not set ;-(.
Image

When I set script On finish - nothing happens either.
Image

On the other hand log says that script is called. Why it works only when manually set - that I don't know. If you are willing to help me I can send you my log.

Thanks
elluce

Re: On finish script

Posted: November 28th, 2013, 6:34 pm
by shypike
I think you're mixing up things.
There's a per-job script coupled to the category.
There's also an end-script that's only called when the last job in the queue is finished.
The one in the drop-down menu in your screenshot is the end-script.

Re: On finish script

Posted: November 29th, 2013, 10:08 am
by elluce
I have only one script. It works only when chosen per job. I want it to work "when the last job in the queue is finished". According to log it is called at the end of queue but I do not see the results. I can only see the results when chosen per job.

Re: On finish script

Posted: November 29th, 2013, 2:01 pm
by shypike
Be aware that the end-of-queue script gets different parameters than the end-of-job one.
In fact, the end-of-queue gets no parameters at all.

Re: On finish script

Posted: November 29th, 2013, 9:02 pm
by elluce
Could you elaborate, please? I have checked my "script" by attaching it to a job. It is working. So, I thought that it will work the same way when attached to an end of queue. Apparently that's not the case :-(.

Re: On finish script

Posted: November 30th, 2013, 4:45 am
by jcfp
See http://wiki.sabnzbd.org/user-scripts for the info passed on to post-processing scripts when called as part of a specific download job. Since all this info is different for every job, none of it can be supplied for a script called at end-of-queue. That means your script will only work at end-of-queue if it doesn't depend on sab for info, such as the place(s) to look for files.

Re: On finish script

Posted: December 2nd, 2013, 8:53 am
by elluce
I have been there. As far as I am concerned, it could be in Chinese ;-))). Thanks anyway. I will try to find someone who will write appropriate script for me.