pre-queue script input parameters

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
squareatom
Newbie
Newbie
Posts: 26
Joined: February 17th, 2011, 6:40 pm

pre-queue script input parameters

Post by squareatom »

What is meant by "The sorting info is passed independent on the actual Sorting settings. Only the SeasonSort method will be used for analysis." on http://wiki.sabnzbd.org/user-pre-queue-script?

Also, for input parameters 8-11 what are they supposed to be? They are just blank.

For example, these are values returned when NZB "Revolution.2012.S01E03.720p.HDTV.X264-DIMENSION.nzb"

Sample script:

Code: Select all

#!/bin/bash
f=~/tmp/pre-queue.out
echo " \$8: '$8'" >> $f
echo " \$9: '$9'" >> $f
echo "\$10: '${10}'" >> $f                                                                                                                                      
echo "\$11: '${11}'" >> $f
Output from script:

Code: Select all

 $8: ''
 $9: ''
$10: ''
$11: ''
If possible, I would like to access the Series Sorting variables in a pre-queue script and change them.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: pre-queue script input parameters

Post by shypike »

I means that the "TV Sort" algorithm is used to determine season and episode.
8 : Show name
9 : Season (1..99)
10 : Episode (1..99)
11: Episode name

Only it isn't working due to a bug that sneaked in somewhere in the 0.7.x series.
It will be fixed in 0.7.4
squareatom
Newbie
Newbie
Posts: 26
Joined: February 17th, 2011, 6:40 pm

Re: pre-queue script input parameters

Post by squareatom »

Thanks for the quick response. I'm on 0.7.4RC2 and the fields are blank. So I guess it's not fixed yet? Is there any other way to access "TV Sorting" values?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: pre-queue script input parameters

Post by shypike »

I said 0.7.4, not 0.7.4RC2 :)
Will be out soon.
squareatom
Newbie
Newbie
Posts: 26
Joined: February 17th, 2011, 6:40 pm

Re: pre-queue script input parameters

Post by squareatom »

Sounds good! Is there any other way to access "TV Sorting" values in the mean time? Like calling a python sabnzbd function?
Last edited by squareatom on October 2nd, 2012, 4:01 pm, edited 2 times in total.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: pre-queue script input parameters

Post by shypike »

Just wait until tomorrow :)
squareatom
Newbie
Newbie
Posts: 26
Joined: February 17th, 2011, 6:40 pm

Re: pre-queue script input parameters

Post by squareatom »

Oh you're quick with the replies :D

Sweet, didn't realize it would be so soon!

I think this is what I am looking for tho in lieu of the pre-queue.

Code: Select all

from sabnzbd.tvsort import SeriesSorter

def analyse_show(name):
    """ Do a quick SeasonSort check and return basic facts """
    job = SeriesSorter(name, None, None)                                                                                                                      
    if job.is_match():
        job.get_values()
    info = job.show_info
    return info.get('show_name', ''), \
           info.get('season_num', ''), \
           info.get('episode_num', ''), \
           info.get('ep_name', '')
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: pre-queue script input parameters

Post by shypike »

That's the code from SABnzbd.
It misses one line, which will be in 0.7.4

Code: Select all

from sabnzbd.tvsort import SeriesSorter

def analyse_show(name):
    """ Do a quick SeasonSort check and return basic facts """
    job = SeriesSorter(name, None, None)                                                                                                                     
    job.match(force=True)

    if job.is_match():
        job.get_values()
    info = job.show_info
    return info.get('show_name', ''), \
           info.get('season_num', ''), \
           info.get('episode_num', ''), \
           info.get('ep_name', '')
squareatom
Newbie
Newbie
Posts: 26
Joined: February 17th, 2011, 6:40 pm

Re: pre-queue script input parameters

Post by squareatom »

I added the line and still no input values 8-11. Guess there is more to the bug than just that function but thanks for the info. I'll just wait for 0.7.4
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: pre-queue script input parameters

Post by shypike »

Are you using that piece of code in your own script?
It won't work, because the underlying tvsort code requires
quite a few parameters to be set up.
squareatom
Newbie
Newbie
Posts: 26
Joined: February 17th, 2011, 6:40 pm

Re: pre-queue script input parameters

Post by squareatom »

Nah I changed it in newsunpack.py. I was going to try in my own script but you just saved me to trouble.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: pre-queue script input parameters

Post by shypike »

squareatom wrote:Nah I changed it in newsunpack.py. I was going to try in my own script but you just saved me to trouble.
You changed it in SABnzbd itself and it still doesn't work?
That would be bad news. It works for me.
BTW: the title should have the proper formatting, like "Show S01E04 name" or "Show 1x04 name".
Something like "Winter in 1995" will not give parameters.
squareatom
Newbie
Newbie
Posts: 26
Joined: February 17th, 2011, 6:40 pm

Re: pre-queue script input parameters

Post by squareatom »

Whoops. You're correct. It works. I just needed to restart Sabnzbd. Not sure why I didn't think of that before.

EDIT: So is the following still true? Or will values of output lines 8-11 be applied to TV Sorting?

Code: Select all

SABnzbd uses the first 7 lines of output, so they should only contain proper data (or be empty).
Anything after line 7 is ignored.
Post Reply