Page 1 of 1

Newbie Windows Post-processing script confusion

Posted: October 3rd, 2011, 4:06 pm
by JPW
I'm fairly ignorant working with all this and probably just brain dead when it comes to Linux eventhough I have managed to successfully build an unRAID server for my media. Ultimately, I even have SickBeard, CouchPotato, Sabnzbd, and YAMJ (with Eversion skin) all running just fine via a Windows HTPC. However, I do have one item that I hope to automate better.

At the moment I simply have my HTPC turn on during a portion of each day and via Task Scheduler YAMJ runs at intermittent times. The problem is something could have downloaded after YAMJ runs and I won't see it on my Popcorn Hour until the next day.

The information I've seen on the forum around scripting seems to be mostly for Linux. Can anyone help walk a newbie like myself on how to do this in Windows? Thanks for any help.

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 1:45 am
by shypike
You're not describing very accurately what you want, so don't expect many answers.
Also, please don't start posting this question in multiple boards.
The scripting crowd hangs out in the other board, so if you're not getting an answer there,
you won't get one here either.

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 7:23 am
by JPW
I apologize. I did delete the initial post after posting it here once I saw that the Scripting Forum seemed to center more around posting what others saw as successful scripts. In my case I was trying to understand more around how to accomplish running YAMJ, which I currently have running from Task Scheduler via a CMD file. After doing a bit more research I found for Windows you could indeed use a CMD file, BAT file, EXE, etc., so that helped me quite a bit. For some reason I was assuming it had to be in Python, which I'm not very familiar with.

Anyway, I haven't tested it yet, because SAB hasn't seen anything yet to download, but I'm hoping for my Movies category now it will indeed run YAMJ now that I have my YAMJ.CMD script listed along with the Movies category. If that does work, my only other question will be how do you execute more than one script? For example, like many, I'm using Sickbeard. The category I have for it is TV and in the drop-down box for scripts it has to reflect the SabtoSickbeard.exe. Could I simply add a duplicate TV category and list my YAMJ.CMD script as well?

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 12:08 pm
by shypike
You can only attach one script to a job.
However it is possible to make a wrapper script that calls two others scripts:

Code: Select all

@echo off
call first_script.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9
call second_script.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9
You probably need to specify a full path the called scripts.

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 12:13 pm
by JPW
I thought of that, but my main concern is around the Sabtosickbeard.exe script that people use often in Sabnzbd. I'm fairly certain data is passed between Sabnzbd and Sickbeard during the post-processing so I don't think it would work to simply execute Sabtosickbeard.exe within another script. Please someone tell me I'm wrong.

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 12:17 pm
by shypike
Makes no difference.
Just try it.
It's probably best to have the sickbeard script as the first one.
Yes that script may move the data away, but I assume your second script isn't really using the parameters.

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 12:21 pm
by JPW
Will do. I'll follow-up once I've tried a little testing and pass on the results.

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 2:30 pm
by JPW
It didn't work. I did place the Sabtosickbeard.exe first within the script which now contains both scripts. It resulted in, "No folder supplied - is this being called from SABnzbd?" YAMJ ran afterwards just fine. See the truncated script log below:

No folder supplied - is this being called from SABnzbd?
Yet Another Movie Jukebox 2.4-SNAPSHOT
~~~ ~~~~~~~ ~~~~~ ~~~~~~~ ~~~~~~~~~~~~
http://code.google.com/p/moviejukebox/
Copyright (c) 2004-2011 YAMJ Members

This software is licensed under a Creative Commons License
See this page: http://code.google.com/p/moviejukebox/wiki/License

Revision: r2236
Build Date: 2011-03-22 12:10:46

Processing started at Tue Oct 04 14:23:52 CDT 2011

Using properties file ./properties/moviejukebox-default.properties
Using properties file ./moviejukebox.properties
Using properties file ./skins/default/skin.properties
Using properties file ./skins/default/skin-user.properties
Using properties file ./properties/apikeys.properties
Found media library: Z:\
Using 1 processing threads and 1 downloading threads...

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 2:34 pm
by JPW
Also, in case this helps at all. Below is the CMD file I created for the script that basically contains the two scripts, Sabtosickbeard.exe and YAMJ:

@Echo OFF
C:
CD \Program Files\SickBeard-win32-alpha-build487\Scripts
sabToSickBeard.exe
CD \YamJ
My_YAMJ.cmd

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 2:57 pm
by shypike
Shouldn't you add %1 %2 %3 %4 %5 %6 %7 %8 %9 to the SickBeard call?
Doesn't it need the parameters?

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 3:01 pm
by JPW
Sorry, I'm really ignorant about the details of how all this works. I wasn't aware those were parameters that might need to be added. Let me add "%1 %2 %3 %4 %5 %6 %7 %8 %9" after the "sabToSickBeard.exe" command and see what happens. Thanks for your help with this. I do appreciate it.

Re: Newbie Windows Post-processing script confusion

Posted: October 4th, 2011, 8:17 pm
by JPW
It worked! Amazing! Thank you so much for your help. This really helps add a lot of functionality for me.