Automatically create subfolders for subs and samples

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
johnsosius
Newbie
Newbie
Posts: 9
Joined: October 2nd, 2013, 5:14 am

Automatically create subfolders for subs and samples

Post by johnsosius »

Hi there,

I was wondering if it would be possible to automatically create sub folders for the subtitles and samples (if available) after downloading a scene release.
I couldn't find it on the board. Anyone can help me with this?

Thanks in advance!


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

Re: Automatically create subfolders for subs and samples

Post by shypike »

You would need your own post processing script for this.
More info: http://wiki.sabnzbd.org/user-scripts
johnsosius
Newbie
Newbie
Posts: 9
Joined: October 2nd, 2013, 5:14 am

Re: Automatically create subfolders for subs and samples

Post by johnsosius »

Okay thanks for pointing that out - I'll have a look!
johnsosius
Newbie
Newbie
Posts: 9
Joined: October 2nd, 2013, 5:14 am

Re: Automatically create subfolders for subs and samples

Post by johnsosius »

I saw this topic: http://forums.sabnzbd.org/viewtopic.php ... e&start=15 and that's where I found this script:

Code: Select all

echo off
cd /c "%1"
IF EXIST *sample* (mkdir Sample && move *sample* "Sample") ELSE exit
IF EXIST *subs* (mkdir Subs && move *subs* "Subs") ELSE exit
The script itself is working: when I put the .bat file in the folder I want to test it creates the 2 sub folders I want.
I am on Windows btw and my download directory is C:\Users\X\Documents\Downloads\complete.
However if I let sab run the post-script it returns with an error, this is what the log is showing:

Code: Select all

2013-10-03 17:01:26,148::INFO::[__init__:893] C:\Users\X\Documents\Downloads\incomplete\teevee 720p bad ink\__ADMIN__\SABnzbd_nzf_buc3bt removed
2013-10-03 17:01:26,148::INFO::[__init__:893] C:\Users\X\Documents\Downloads\incomplete\teevee 720p bad ink\__ADMIN__\SABnzbd_nzf_ou9uet removed
2013-10-03 17:01:26,150::INFO::[misc:1295] Cannot remove folder C:\Users\X\Documents\Downloads\incomplete\teevee 720p bad ink\__ADMIN__
2013-10-03 17:01:26,151::INFO::[misc:1295] Cannot remove folder C:\Users\X\Documents\Downloads\incomplete\teevee 720p bad ink\__ADMIN__
2013-10-03 17:01:26,151::INFO::[postproc:84] Saving postproc queue
2013-10-03 17:01:26,151::INFO::[__init__:904] Saving data for postproc1.sab in C:\Users\X\AppData\Local\sabnzbd\admin\postproc1.sab
2013-10-03 17:01:26,151::INFO::[downloader:246] Post-processing finished, resuming download
2013-10-03 17:01:26,210::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:26,309::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:26,410::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:26,509::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:26,609::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:26,710::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:26,809::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:26,910::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:27,009::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:27,109::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:27,210::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:27,309::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:27,410::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:27,509::INFO::[downloader:664] Thread [email protected]:563: forcing disconnect
2013-10-03 17:01:29,151::INFO::[nzbqueue:211] Saving queue
2013-10-03 17:01:29,201::INFO::[__init__:904] Saving data for queue9.sab in C:\Users\X\AppData\Local\sabnzbd\admin\queue9.sab
2013-10-03 17:01:29,203::INFO::[__init__:904] Saving data for totals9.sab in C:\Users\X\AppData\Local\sabnzbd\admin\totals9.sab
2013-10-03 17:01:29,203::INFO::[__init__:904] Saving data for rss_data.sab in C:\Users\X\AppData\Local\sabnzbd\admin\rss_data.sab
2013-10-03 17:01:29,203::INFO::[__init__:904] Saving data for bookmarks.sab in C:\Users\X\AppData\Local\sabnzbd\admin\bookmarks.sab
2013-10-03 17:01:29,204::INFO::[__init__:904] Saving data for watched_data.sab in C:\Users\X\AppData\Local\sabnzbd\admin\watched_data.sab
2013-10-03 17:01:29,206::INFO::[postproc:84] Saving postproc queue
2013-10-03 17:01:29,206::INFO::[__init__:904] Saving data for postproc1.sab in C:\Users\X\AppData\Local\sabnzbd\admin\postproc1.sab
2013-10-03 17:01:29,207::INFO::[postproc:651] Queue has finished, launching: None (None)
I am a complete noob when it comes to scripts, could anyone point out to me what I might do wrong?
The download it self is 100% complete though, but obviously the sub folders aren't created.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Automatically create subfolders for subs and samples

Post by shypike »

Doesn't look like the script runs.
Did you set one? Do you see it as one of the job attributes?
johnsosius
Newbie
Newbie
Posts: 9
Joined: October 2nd, 2013, 5:14 am

Re: Automatically create subfolders for subs and samples

Post by johnsosius »

Yes I see the script in sabnzbd's menu. Its reporting an post processing error (see log).
The only error I can see in the log however is this:

Code: Select all

2013-10-03 21:41:17,674::INFO::[postproc:490] Traceback: 
Traceback (most recent call last):
  File "sabnzbd\postproc.pyo", line 432, in process_job
  File "sabnzbd\newsunpack.pyo", line 140, in external_processing
  File "sabnzbd\newsunpack.pyo", line 1331, in build_command
error: (5, 'GetShortPathName', 'Access Denied.')
error: (5, 'GetShortPathName', 'Access Denied.') <-- what could be the reason of this error?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Automatically create subfolders for subs and samples

Post by shypike »

Check permissions of the file and the folder in which it resides.
johnsosius
Newbie
Newbie
Posts: 9
Joined: October 2nd, 2013, 5:14 am

Re: Automatically create subfolders for subs and samples

Post by johnsosius »

I checked the permissions, every directory is accessible.
This is the message sab gives after completing a download:

Code: Select all

Script
    Exit(1) There is already a sub folder or file Sample. (More) 

Code: Select all

(More)

C:\Program Files (x86)\SABnzbd>echo off 
The syntax of the file name, folder name or volume name is incorrect.
Sub folder or file Sample is already there.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Automatically create subfolders for subs and samples

Post by shypike »

So the script runs and what you see is the output of your own script.
The problem is this statement:
IF EXIST *sample* (mkdir Sample && move *sample* "Sample") ELSE exit
File names on Windows are not case-sensitive, so your ALSO trying to move the new folder Sample to the new folder Sample.
The same is true for the next line.
johnsosius
Newbie
Newbie
Posts: 9
Joined: October 2nd, 2013, 5:14 am

Re: Automatically create subfolders for subs and samples

Post by johnsosius »

Could you perhaps tell me how I should change these lines in order to get it working? Or is it just not do-able to have only a couple of - simple - lines of code because its Win?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Automatically create subfolders for subs and samples

Post by shypike »

You'll have to ask this question in the scripts sub-forum.
I've stopped writing other people's scripts.
Nothing personal, but I prefer to spend my time on SABnzbd itself.
johnsosius
Newbie
Newbie
Posts: 9
Joined: October 2nd, 2013, 5:14 am

Re: Automatically create subfolders for subs and samples

Post by johnsosius »

Ok thanks for your input shypike the last couple of weeks! You can close this topic my problem is solved.
Post Reply