After the TV sorting script has done its post processing is it possible to get a full path of the video file (AVI, MKV) sent as a parameter to the post processing scripts. I'm writing a script which creates a shortcut to the video file and places it inside a "Recent" folder. This then lets me quickly see the newest TV shows which have been downloaded and I can just open them from there.
Thanks.
User script parameter request - Full path of TV file
Re: User script parameter request - Full path of TV file
I have not checked, but my scripts seem to work fine, and I am pretty sure they would choke if they DIDN'T get a full path. Are you sure they are passed a relative path?
Re: User script parameter request - Full path of TV file
What I'm looking for is the name of the AVI file after the TV processing script has finished renaming it. These are the current parameters I can get:
What I want is the name of the AVI. E.g: Weeds - 2x08.avi.
Thanks.
Code: Select all
%1 = C:\Storage\Usenet\Complete\TV-XVID\Weeds
%2 = Weeds.S02E08.DVDRip.XviD-TOPAZ.nzb
%3 = Weeds.S02E08.DVDRip.XviD-TOPAZ
Thanks.
Re: User script parameter request - Full path of TV file
Yeah, I see what you mean.
Unfortunately we already have a ridiculous amount of parameters.
I'll discuss it with the team.
Unfortunately we already have a ridiculous amount of parameters.
I'll discuss it with the team.
Re: User script parameter request - Full path of TV file
One of the advantages of passing just a folder, is that sabnzbd does not have to make any assumptions regarding which of the multiple files in the resulting directory is the one that you want passed as a parameter. Yes, if you are downloading a tv show, then it is usually the avi/mp4/m4v/mkv file you are really interested in. But is this really an assumption/choice we want some smarts in sabnzbd to decide for us?
What I do now, is my post processing scripts take $1 and search for any movie file extensions, and then performs the script on those. Unfortunately, if there is a sample file, that will get picked up as well, but I can live with that.
Only option I can see for sabnzbd to do this foolproof, would be to pass ALL the files in the resulting directory as parameters.
What I do now, is my post processing scripts take $1 and search for any movie file extensions, and then performs the script on those. Unfortunately, if there is a sample file, that will get picked up as well, but I can live with that.
Only option I can see for sabnzbd to do this foolproof, would be to pass ALL the files in the resulting directory as parameters.
Re: User script parameter request - Full path of TV file
This would be really helpful for doing conversion tasks on downloads. Even though you can concatenate the parameters passed to the user script, it falls apart as soon as you set up TV sorting to your liking. It would be nice for at least the final filename (after tv sorting) to be passed as a parameter. Having the clean version for the job name only helps if you don't rename with TV sorting.
Re: User script parameter request - Full path of TV file
I was going to request the same feature. I'd like to be able to have a script to do some conversion on the resulting renamed file. I dont need the full path, just the renamed file with or without the extension.
Re: User script parameter request - Full path of TV file
This can be done in a postscript already though, for instance with this "post processing script" on a Linux machine.
this finds all avi-files changed/created/moved less than 1 minute ago, except file names containing 'sample'
EDIT:
I didn't test this properly before answering, because this seem to only work with one episode pr folder. All files already in the destination folder get's the same changed time-stamp when a download is finished...
Code: Select all
#!/bin/bash
find "$1" -cmin -1 -name *.avi | grep -iv sample
EDIT:
I didn't test this properly before answering, because this seem to only work with one episode pr folder. All files already in the destination folder get's the same changed time-stamp when a download is finished...
Last edited by Laat on April 10th, 2009, 3:28 pm, edited 1 time in total.
Re: User script parameter request - Full path of TV file
On linux, the method perm_script() chmod's all files in the destination folder, marking all the files already in the destination folder as changed. This makes it impossible for me to distinguish newly downloaded episodes/files from other episodes in the same folder.
To solve this I changed the postproc.py to only chmod the files if it does not already have the correct right's.
The simple find in my previous post works, and something similar should work on windows.
To solve this I changed the postproc.py to only chmod the files if it does not already have the correct right's.
Code: Select all
--- a/sabnzbd/postproc.py
+++ b/sabnzbd/postproc.py
@@ -316,7 +316,9 @@ def perm_script(wdir, umask):
logging.error('[%s] Cannot change permissions of %s', __NAME__, root)
for name in files:
try:
- os.chmod(join(root, name), umask_file)
+ stat = os.stat(join(root, name))
+ if ((stat.st_mode & 0777) != umask_file):
+ os.chmod(join(root, name), umask_file)
except:
logging.error('[%s] Cannot change permissions of %s', __NAME__, join(root, name))
Last edited by Laat on April 12th, 2009, 3:31 pm, edited 1 time in total.
Re: User script parameter request - Full path of TV file
Request filed as https://trac2.assembla.com/SABnzbd/ticket/262dr0pknutz wrote: After the TV sorting script has done its post processing is it possible to get a full path of the video file (AVI, MKV) sent as a parameter to the post processing scripts. I'm writing a script which creates a shortcut to the video file and places it inside a "Recent" folder. This then lets me quickly see the newest TV shows which have been downloaded and I can just open them from there.
Thanks.
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: User script parameter request - Full path of TV file
I don't understand why you can't just search using your own script, like this -
Code: Select all
set dirname=%1
set dirname=%dirname:"=%
set name=%3
set name=%name:"=%
REM convert to iphone format
for /R "%dirname%" %%f in (*.mkv) do call :iphoneit %%~sf
for /R "%dirname%" %%f in (*.wmv) do call :iphoneit %%~sf
for /R "%dirname%" %%f in (*.avi) do call :iphoneit %%~sf
for /R "%dirname%" %%f in (*.mov) do call :iphoneit %%~sf
for /R "%dirname%" %%f in (*.mpg) do call :iphoneit %%~sf