[Abandoned] Media Processing + XBMC updater

Come up with a useful post-processing script? Share it here!
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

[Abandoned] Media Processing + XBMC updater

Post by tret »

Update (3/09/2009): I have abandoned this script in favor of the python version found here:
http://forums.sabnzbd.org/index.php?topic=1847.0

tret
Last edited by tret on March 22nd, 2009, 7:17 pm, edited 1 time in total.
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Windows] Media Processing + XBMC updater

Post by tret »

I made a mistake with the archive I uploaded, I gave the autoit code and not the executable.... I have corrected this now. Go ahead and download from the link in the first post to get the correct archive with the executable app.

- tret
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Windows] Media Processing + XBMC updater

Post by tret »

version 1.2 (Use the link in the first post)

changes:

- added the ability to disable categories (In case you have no need for 4 categories)
- added comments to the media_process.ini file to assist configuration
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Windows] Media Processing + XBMC updater

Post by tret »

version 1.3 (Use the link in the first post)

changes:

- renamed the settings file to settings.ini
- moved the category settings to the categories.ini file
- removed the 4 category hard code, users can now delete the extra categories in the categories.ini file or add as many additional categories as they like (each category must follow the same pattern, there are 5 required settings per category)
tbird2340
Newbie
Newbie
Posts: 20
Joined: December 19th, 2008, 3:10 pm

Re: [Windows] Media Processing + XBMC updater

Post by tbird2340 »

Woh! This sounds awesome and just what I need.. Giving it a whirl now...

Thanks!

EDIT: So I just adjust the settings in the ini files, place all these files in my Sabnzbd scripts directory, and then call the EXE as my post processing script?
Last edited by tbird2340 on February 18th, 2009, 8:50 am, edited 1 time in total.
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Windows] Media Processing + XBMC updater

Post by tret »

tbird2340 wrote: Woh! This sounds awesome and just what I need.. Giving it a whirl now...

Thanks!

EDIT: So I just adjust the settings in the ini files, place all these files in my Sabnzbd scripts directory, and then call the EXE as my post processing script?
Exactly right! Give it a go and if you don't mind let me know how it goes.

tret
tbird2340
Newbie
Newbie
Posts: 20
Joined: December 19th, 2008, 3:10 pm

Re: [Windows] Media Processing + XBMC updater

Post by tbird2340 »

Ok. Here's what I got thus far..

I downloaded a TV ep and it did run the exe after completing.. It appears I had a failed download in the past (not the test download that I just did).. It moved the entire folder that failed download was in and all of it's contents (including files that were downloaded fine) into my failed directory.


IE:

F:\DLOADS\TV\24\Season 7 had the following folder in it: "_FAILED_24 - 7x08 - Day 7- 3-00 P.M.-4-00 P.M"

Your script moved that entire folder (24\Season 7\*.*) to the F:\DLOADS\_FAILED directory.

It also processed and moved all the past music that I had in my "download" music directory and put them into my unsorted "music" directory.

Actually, it stopped processing after moving the failed ep to the failed directory and didn't prcoess the new TV show I downloaded.. The last entry in the log was

"Processing New Media (TV): 24
------------------------------------------------------------------------

Failed Download Detected, Moving 24 to F:DLOADS\_Failed"

24 wasn't even the show I downloaded..

Hope that helps.
tbird2340
Newbie
Newbie
Posts: 20
Joined: December 19th, 2008, 3:10 pm

Re: [Windows] Media Processing + XBMC updater

Post by tbird2340 »

Downloaded another show and it looks like the script stops when it finds a failed download..

Also, if I run it manually, does it create a log file and if so where does it put it?

Thanks!
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Windows] Media Processing + XBMC updater

Post by tret »

tbird2340 wrote: Downloaded another show and it looks like the script stops when it finds a failed download..

Also, if I run it manually, does it create a log file and if so where does it put it?

Thanks!
Hi tbird, thanks for the feedback.

First, The script will take a look at the download folders that match what you defined in categories.ini. It will process anything in these folders whether that is 1 download, 2 downloads or 100 downloads. It will give you a sabnzbd script output log and detail what it did with each download it found.

Secondly, when sabnzbd fails to properly handle a download it tags the folder with "_FAILED_".  I feel that it is fair to say that whatever is included in this folder should be moved to a failed directory and the user can manually decide if anything left in there is salvageable. Personally I usually just select another post and let it re-download (Most of the time the archive is worthless if Sab considers it to be failed)

As far as the script exiting when a failed download is detected, that is a design flaw that I plan to fix. The script will process as many new downloads as it finds and I am going to make sure that the script just moves on to the next item after processing a failed download.

Unfortunately there are no log files, it prints out the results to the sabnzbd script output logs.
Last edited by tret on February 19th, 2009, 2:17 am, edited 1 time in total.
tbird2340
Newbie
Newbie
Posts: 20
Joined: December 19th, 2008, 3:10 pm

Re: [Windows] Media Processing + XBMC updater

Post by tbird2340 »

tret wrote: Hi tbird, thanks for the feedback.

Secondly, when sabnzbd fails to properly handle a download it tags the folder with "_FAILED_".  I feel that it is fair to say that whatever is included in this folder should be moved to a failed directory and the user can manually decide if anything left in there is salvageable. Personally I usually just select another post and let it re-download (Most of the time the archive is worthless if Sab considers it to be failed)
Did you see my example though? It's not just moving the failed download and the contents of the failed folder but it's moving the contents of the folder that the failed download is in..

IE:

F:\DLOADS\TV\24\Season 7 contained:

24 - S07E01.avi
24 - S07E02.avi
24 - S07E03.avi
_FAILED 24 - S07E04\files  <---- This is a folder

So, instead of your program just moving _FAILED 24 - S07E04 and all it's files it moved all my good avi's as well..

Make sense?
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Windows] Media Processing + XBMC updater

Post by tret »

tbird2340 wrote:
tret wrote: Hi tbird, thanks for the feedback.

Secondly, when sabnzbd fails to properly handle a download it tags the folder with "_FAILED_".  I feel that it is fair to say that whatever is included in this folder should be moved to a failed directory and the user can manually decide if anything left in there is salvageable. Personally I usually just select another post and let it re-download (Most of the time the archive is worthless if Sab considers it to be failed)
Did you see my example though? It's not just moving the failed download and the contents of the failed folder but it's moving the contents of the folder that the failed download is in..

IE:

F:\DLOADS\TV\24\Season 7 contained:

24 - S07E01.avi
24 - S07E02.avi
24 - S07E03.avi
_FAILED 24 - S07E04\files  <---- This is a folder

So, instead of your program just moving _FAILED 24 - S07E04 and all it's files it moved all my good avi's as well..

Make sense?
Ok that makes sense. This situation will really only happen with TV shows due to the TV show sorting that SABnzbd does. Normally a download job will be found 1 level deep in a category folder.

example:
Downloads/Movies/The Dark Knight (2008)
Downloads/Movies/_FAILED_The Dark Knight (2008)

When dealing with TV show sorting within SAB, this is changed. The download job is not 1 level deep in the TV download folder.

example: Downloads/TV/24/Season 01/JOB_TITLE (JOB_TITLE being the newly downloaded file)
example: Downloads/TV/24/Season 01/_FAILED_JOB_TITLE


So basically I need to change the behavior of the failed download processing. Right now the app looks at each folder found 1 level deep in a given category as a download job that needs to be processed. If it finds any folders within a download job with _FAILED_ in the title, it moves the entire download job to the failed destination.

I'll change this to just move the folder tagged as _FAILED_. Also I need to make sure that it continues processing other download jobs even though it found a failed download. I'll post it as soon as I get a working solution.

Thanks again for your help! Keep the ideas/bugs coming as you find them :)

tret
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Windows] Media Processing + XBMC updater

Post by tret »

version 1.4 (Use the link in the first post)

changes:

- moving failed downloads will now only affect directories labeled "_FAILED_" along with their contents
- detected _FAILED_ and _UNPACK_ directories will no longer cause the script to stop processing (except for within these directories)
- added a check to make sure that empty (or nearly empty) download directories are removed if the cleaning processes have removed enough files/folders to lower the total file size within the download directories to below the minimum size limits for the category being processed (this usually happens with TV shows if an episode within the SHOW_NAME/EPISODE 01/ path was labeled _FAILED_ and moved)
tbird2340
Newbie
Newbie
Posts: 20
Joined: December 19th, 2008, 3:10 pm

Re: [Windows] Media Processing + XBMC updater

Post by tbird2340 »

Awesome! Thanks!!
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Windows] Media Processing + XBMC updater

Post by tret »

version 1.41 (Use the link in the first post)

changes:

- the app will now skip thetvdb.com scraping if the series being processed exists (and already has a tvshow.nfo file) in the destination location. This will give the user the opportunity to manually edit the tvshow.nfo file if the scraper is improperly identifying the series. Also the manually edited file won't be overwritten after each new episode downloaded.
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Windows] Media Processing + XBMC updater

Post by tret »

hey tbird, looks like there isn't much demand for this script (there have only been a few downloads) so I may not bother posting further updates. Let me know if you run across any new bugs or have any ideas for me to play around with and I'll keep you posted if I make any substantial improvements/feature additions.

tret
Post Reply