SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac)

  Thread Rating:
  • 6 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Gfei Offline
Junior Member
Posts: 3
Joined: Mar 2011
Reputation: 0
Post: #291
Everything is working now, I think one of my video files was causing a problem.

Just a thought: is there any way for SortTV to search the download location recursively at this time?
find quote
carmenm Offline
Senior Member
Posts: 168
Joined: Jul 2008
Reputation: 0
Post: #292
@foe83. I can help you. and would love to test the XBMC plugin Wink. Can you share the code?
find quote
newphreak Offline
Member+
Posts: 176
Joined: Oct 2010
Reputation: 0
Location: sofa @ Norway
Post: #293
Hmm, at the moment non-episodes are moved, this does not work well for me, as i use place-symlink. Would it be possible to throw symlinks to the non-episodes specified dir instead?

And, this line bugs me, even tho it doesn't seem to affect the script:
could not find ParserDetails.ini in /usr/local/share/perl/5.10.1/XML/SAX

How could i fix it? Smile

Samsung ES7005 55" led tv - Denon AVR-3313 - NAD C275BEE - B&W DM683 - B&W HTM61 - B&W 686
Asus EB1501P ION2 - OCZ Vertex 2 64gb ssd - Built in IR Receiver
And a Logitech Harmony Touch to control it all. http://www.OpenELEC.tv
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Smile  New version available Post: #294
Announcing SortTV version 1.25!

This is a pretty big update.
  • Compressed files are now extracted to a separate clearly marked directory.
  • Lots of improvements to the pattern matching. Including some bug fixes.
  • --music-directory=dir
    [INDENT]Where to sort music into
    If not specified, music is not moved[/INDENT]
  • Log file now has a default location (in preparation for an undo script), although the location can still be configured.
  • Option processing is now handled differently (thanks to code from farfromrefug). This means that command arguments are more flexible.
  • The arguments and config file now use "=" rather than ":" for assignments, although the old format still works.
  • Some of the option names have changed. For example: --tv-directory and --misc-directory, although the old names still work for now: --directory-to-sort-into and --non-episode-dir.
  • Files moved into the misc-directory sort as configured (for example, via move, copy or symlink), rather than just via move.
  • JSON-RPC for library updates for newer versions of XBMC. This is via the argument:
    --xbmc-remote-control=host
    [INDENT]host for the new xbmc communication, to automatically update library when new episodes arrive
    You probably want to set this to "localhost"[/INDENT]
    The old web interface is still available via:
    --xbmc-old-web-server=host:port
    [INDENT]host:port for the xbmc webserver on older versions of xbmc, to automatically update library when new episodes arrive
    Remember to enable the webserver within xbmc, and "set the content" of your TV directory in xbmc.
    If not specified, xbmc is not updated[/INDENT]
    The new interface does not yet support notifications, so that feature does not yet work with newer versions of xbmc.
  • --polling-time:{X}
    [INDENT]Tell the script to check for new files to sort every X seconds, minutes, hours, or days
    You could set the script to start on system startup with polling, rather than using scheduling to start the script.
    Valid values include "2secs", "2days", "1min", "3hrs", "30s" etc.
    If not specified, polling is disabled and the script will only sort the directory once.[/INDENT]
  • --check-for-updates=[TRUE|FALSE]
    [INDENT]Check for newer versions of SortTV
    If not specified, TRUE[/INDENT]

I recommend everyone updates to the new version.

You can download the new version from:
https://sourceforge.net/projects/sorttv/

A lot of time has gone into developing SortTV. Remember this is free open source software. I welcome and really appreciate donations.

Please consider a $5 paypal donation. Click for more information:
http://sourceforge.net/donate/index.php?group_id=330009

Thanks again to farfromrefug for the GetOpt code.

--

Justcop Wrote:My first go at using the script for a show called californication,
Unzipped folders were called Californication - Season 1 etc
For some reason this tried to match the show "Californication season" which obviously doesn't exist

This is fixed in the current version.

Justcop Wrote:1. This file did not match

How.I.Met.Your.Mother.S06E01.720p.HDTV.X264-DIMENSION.avi

Should "." other than the final one be ignored?

2. What happens to archive files after they have been unzipped, I would like them to be deleted as long as it has been successful.

Great script though, thank you for all the hard work and hopefully my feedback can help improve it.

This is also fixed.

Justcop Wrote:When a file is unzipped can it be added to a folder?

For example I just downloaded a couple of albums which were not recognised by the TV episode finder obviously so were moved to the place for other downloads.

Because they weren't in their own folders the 2 albums just got merged together as loose MP3s in the destination folder.

SortTV now includes a music directory, so that music is moved there. Also compressed archives are extracted to separate directories now.

Justcop Wrote:an MP3 named

11. 5-15.mp3

was left in the completed folder and not moved to where non sorted downloads go.

Shouldn't everything that is not recognised be moved there?

Music can now be sorted to a specific directory.

newphreak Wrote:Hmm, at the moment non-episodes are moved, this does not work well for me, as i use place-symlink. Would it be possible to throw symlinks to the non-episodes specified dir instead?

And, this line bugs me, even tho it doesn't seem to affect the script:
could not find ParserDetails.ini in /usr/local/share/perl/5.10.1/XML/SAX

How could i fix it? :)

Miscellaneous files are now sorted as configured (copy, symlink etc), rather than just moved.

--

Enjoy! :)
find quote
gardz Offline
Junior Member
Posts: 6
Joined: Feb 2011
Reputation: 0
Post: #295
First up, congrats on the new release!! Looking forward to testing some of the new features.

I found a bit of a bug in the new getopts portion which assumes floating point numbers are being passed in for the filesize-range values, when it should be a string since the format is 150MB-350MB, etc. As such the file size checks don't occur.

For reference to anybody who hits this issue in 1.25, if you enable the filesize-range checks you will hit an error such as this:

Code:
$ ./sorttv.pl
SortTV
~~~~~~
Value "170MB-400MB" invalid for option filesize-range (real number expected)
Value "1.05GB-1.15GB" invalid for option filesize-range (real number expected)
Value "697MB-700MB" invalid for option filesize-range (real number expected)


I've put a fix in my local copy as below. I'm not sure if this is the correct "getopt" way to do it, but it seems to work well:

Code:
$ diff -u default-files/sorttv.pl sorttv.pl
--- default-files/sorttv.pl     2011-03-21 04:23:03.000000000 +1100
+++ sorttv.pl   2011-03-21 14:43:07.120152341 +1100
@@ -149,11 +149,15 @@
        "match-files-based-on-tvdb-lookups|tlookup=s" => \$lookupseasonep,
        "season-title|st=s" => \$seasontitle,
        "verbose|v" => \$verbose,
-       "filesize-range|fsrange=f{2}" =>
+       "filesize-range|fsrange=s" =>
                sub {
                        # Extract the min & max values, can mix and match postfixes
-                       my $minfilesize = $_[1];
-                       my $maxfilesize = $_[2];
+                       if ($_[1] !~ /(.*)-(.*)/) {
+                               out ("warn", "WARN: invalid filesize range format. Must be 125MB-350MB, etc. Received: $_[1]");
+                       }
+
+                       my $minfilesize = $1;
+                       my $maxfilesize = $2;
                        $minfilesize =~ s/MB//;
                        $maxfilesize =~ s/MB//;
                        # Fix filesizes passed in to all MB
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Post: #296
gardz Wrote:First up, congrats on the new release!! Looking forward to testing some of the new features.

I found a bit of a bug in the new getopts portion which assumes floating point numbers are being passed in for the filesize-range values, when it should be a string since the format is 150MB-350MB, etc. As such the file size checks don't occur.

For reference to anybody who hits this issue in 1.25, if you enable the filesize-range checks you will hit an error such as this:

Thanks for noticing, reporting and fixing! Smile

Version 1.26 fixes this issue.
https://sourceforge.net/projects/sorttv/
find quote
foe83 Offline
Junior Member
Posts: 8
Joined: Mar 2011
Reputation: 0
Post: #297
Hi everyone!

We have an early preview version of the xbmc script up on github, and I need some people to test it and/or help with the development!

NOTE: this is a very early dev version, it will most probably hang your xbmc machine during run and it may delete your sorttv.conf file. Please use only if you know what you are doing and have backed up everything! I highly suggest to read the README-XBMC-Script file first. That said, I have tested on my machine and beside freezing my machine while trying to run the script, it has not caused any demage, and seems to be able to import/edit the configuration correctly.

Get it here: https://github.com/foe83/sorttv/tree/xbmc_frontend

Click on the big "download" button and save it as a .zip file. Then use the addon installer on xbmc to find the file and install it. If installation fails, try to extract the content and chuck it in a folder named "script.sorttv" in your addons forder.

Enjoy!
find quote
newphreak Offline
Member+
Posts: 176
Joined: Oct 2010
Reputation: 0
Location: sofa @ Norway
Post: #298
cliffe Wrote:Glad you got it working. I notice that you were trying to install modules that SortTV doesn’t use any more (capitalize). Check the README file for an up-to-date list.

ahem.
From the newest readme from .26:
Quote:sudo cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API Text::Capitalize

Samsung ES7005 55" led tv - Denon AVR-3313 - NAD C275BEE - B&W DM683 - B&W HTM61 - B&W 686
Asus EB1501P ION2 - OCZ Vertex 2 64gb ssd - Built in IR Receiver
And a Logitech Harmony Touch to control it all. http://www.OpenELEC.tv
find quote
compcentral Offline
Fan
Posts: 627
Joined: Apr 2010
Reputation: 2
Post: #299
Forgive my ignorance, but doesn't SickBeard already serve the same purpose as this app? I haven't had a chance to read all 30 pages yet, but I'm just curious how this compares to SickBeard.
find quote
cliffe Offline
Senior Member
Posts: 179
Joined: Jun 2010
Reputation: 7
Post: #300
compcentral Wrote:Forgive my ignorance, but doesn't SickBeard already serve the same purpose as this app? I haven't had a chance to read all 30 pages yet, but I'm just curious how this compares to SickBeard.

There is some overlap in features. SortTV has more options for sorting, and I suspect detects more naming schemes (more episode naming formats, music etc).

SortTV doesn't actually download anything, but can be used with any of the plethora of applications that does that. For example, it can be used with Vuze's built in subscriptions, or with torrent episode downloader (TED), or any of the downloaders and schedulers that others have mentioned in this thread. (You could even combine SortTV with Sick Beard, although that might be overkill.)

Once SortTV is setup you can just have any file transfer programs place new files in a directory SortTV sorts, and it will all happen automatically, the files will be moved/copied/symlinked and renamed into a very organised directory structure, images will be downloaded, and xbmc will be notified of the new files.

Development of SortTV has progressed by adding the features requested by its users. There is a lot of control available through the options to specify exactly how SortTV behaves. (Although, hopefully the default behaviour is perfect for most users.) Development of an xbmc front-end has started, which will make configuration easier.

Anyway, if you want lots of control over what happens to your files try out SortTV.
find quote
Post Reply