• 1
  • 20
  • 21
  • 22(current)
  • 23
  • 24
  • 49
SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac)
Hi There
I am currently getting this error message

DBM : : Deep: Wrong file version found - 4 - expected 3 at sorttv.pl line 139

How would I solve this pleaseHuh?
Reply
timgray Wrote:So any tips on how to disable the "season" subfolders?

If you want to hack at the code to remove season directories:

Line ~1062 of sorttv.pl looks something like this:
Code:
foreach my $season (bsd_glob($show.'/*')) {
                if(-d $season.'/' && $season =~ /(?:Season|Series|$seasontitle)?\s?0*(\d+)$/i && $1 == $series) {

That is the part that looks for a matching season directory.

You could try replacing those lines with some code that just sets the $season variable to $show (or just uses $show instead) so that it just puts episodes in the show directory rather than a season directory.

So you could try something like:
remove:
Code:
        if(fixtitle(filename($show)) =~ /^\Q$showname\E$/i || fixtitle(escape_myfilename(filename($show))) =~ /^\Q$subshowname\E$/i) {
            out("verbose", "INFO: found a matching show:\n\t$show\n");
            my $s = $show.'/*';
            my @g=bsd_glob($show);
            foreach my $season (bsd_glob($show.'/*')) {
                if(-d $season.'/' && $season =~ /(?:Season|Series|$seasontitle)?\s?0*(\d+)$/i && $1 == $series) {
                    out("verbose", "INFO: found a matching season:\n\t$season\n");
                    move_an_ep($file, $season, $show, $series, $episode);
                    # next FILE;
                    return 0;
                }
            }
            # didn't find a matching season, make DIR
            out("std", "INFO: making season directory: $show/$seasontitle$series\n");
            my $newpath = "$show/$seasontitle$series";
            if(mkdir($newpath, 0777)) {
                fetchseasonimages(resolve_show_name($pureshowname), $show, $series, $newpath) if $fetchimages ne "FALSE";
                redo SHOW; # try again now that the dir exists
            } else {
                out("warn", "WARN: Could not create season dir: $!\n");
                # next FILE;
                return 0;
            }
        }
And use this instead:
Code:
move_an_ep($file, $show, $show, $series, $episode);
return 0;

Keep in mind that this is just a quick hack, and I haven’t tested this suggestion. A better solution would be to make this a configurable option, in case others are interested in this feature. Feel free to send me a patch!
Reply
Holdengts Wrote:Hi There
I am currently getting this error message

DBM : : Deep: Wrong file version found - 4 - expected 3 at sorttv.pl line 139

How would I solve this pleaseHuh?

Please try deleting the ".cache" subdirectory in the sorttv directory.
Reply
freaktm Wrote:+1 on that - with that option, sorting music would be a lot easier! Big Grin

Regarding the MOVE-AND-LEAVE-SYMLINK-BEHIND problem I had earlier, I think it was because uTorrent was using the files, too.. Just started using COPY instead, and getting no problems Smile

Glad to hear you sorted that out.

Only episodes are moved into "Show/Season x/" directories, so it won't affect sorting of music. Check out the new feature for sorting music, described in an earlier post.
Reply
Happy to see SortTV now handles extraction. I have a question about it though.

How I am running right now: finished downloads go into a /new folder where they are sorted from. I am using copy-and-leave-symlink so that files can continue to seed. This works fine for non-archived files.

For archives I had a problem where the .r## (but not .rar) were being copied/symlinked also. I added a blacklist entry for *.r(0-9)* (a separate entry for each digit), so now all the rar files remain untouched and seed just fine. The extracted video file is sorted fine and the extraction folder and symlink is left behind even though I never use it (this is fine, they just get delete once seeding is complete and take up no space).

The problem: Every time sorttv runs, it appears to re-extract the file since all the archives are still there. I cannot tell if it is actually extracting the file or not though, all that is in the extracted directory is a symlink so it looks like the actual extraction is skipped, but still displayed in the log. I know sorttv is smart enough to not re-copy files that are already sorted (dont move/copy if the destination file already exists) but does it do the same with extraction?

Here is sample log output if my point is not clear:

Code:
Sorting:
    From /media/munin-900/new/
    TV episodes into /media/munin-700/TV/
10:45:3, 26-3-2011
RAR: extracting /media/munin-900/new/Fringe.S03E20.HDTV.XviD-LOL/fringe.320.hdtv-lol.rar into //media/munin-900/new/Fringe.S03E20.HDTV.XviD-LOL/fringe.320.hdtv-lol.rar (extracted by SortTV)
SKIP: Matches blacklist: fringe.320.hdtv-lol.r00
SKIP: Matches blacklist: fringe.320.hdtv-lol.r01
SKIP: Matches blacklist: fringe.320.hdtv-lol.r02
SKIP: Matches blacklist: fringe.320.hdtv-lol.r03
SKIP: Matches blacklist: fringe.320.hdtv-lol.r04
SKIP: Matches blacklist: fringe.320.hdtv-lol.r05
SKIP: Matches blacklist: fringe.320.hdtv-lol.r06
SKIP: Matches blacklist: fringe.320.hdtv-lol.r07
SKIP: Matches blacklist: fringe.320.hdtv-lol.r08
SKIP: Matches blacklist: fringe.320.hdtv-lol.r09
SKIP: Matches blacklist: fringe.320.hdtv-lol.r10
SKIP: Matches blacklist: fringe.320.hdtv-lol.r11
SKIP: Matches blacklist: fringe.320.hdtv-lol.r12
SKIP: Matches blacklist: fringe.320.hdtv-lol.r13
SKIP: Matches blacklist: fringe.320.hdtv-lol.r14
SKIP: Matches blacklist: fringe.320.hdtv-lol.r15
SKIP: Matches blacklist: fringe.320.hdtv-lol.r16
SKIP: Matches blacklist: fringe.320.hdtv-lol.r17
SKIP: Matches blacklist: fringe.320.hdtv-lol.r18
SKIP: Matches blacklist: fringe.320.hdtv-lol.r19
SKIP: Matches blacklist: fringe.320.hdtv-lol.r20
SKIP: Matches blacklist: fringe.320.hdtv-lol.r21
SKIP: Matches blacklist: fringe.320.hdtv-lol.r22
SKIP: Matches blacklist: fringe.320.hdtv-lol.r23
SKIP: Matches blacklist: fringe.320.hdtv-lol.rar
Sorting:
    From /media/munin-900/new/
    TV episodes into /media/munin-700/TV/
11:0:1, 26-3-2011
RAR: extracting /media/munin-900/new/Fringe.S03E20.HDTV.XviD-LOL/fringe.320.hdtv-lol.rar into //media/munin-900/new/Fringe.S03E20.HDTV.XviD-LOL/fringe.320.hdtv-lol.rar (extracted by SortTV)
SKIP: Matches blacklist: fringe.320.hdtv-lol.r00
SKIP: Matches blacklist: fringe.320.hdtv-lol.r01
SKIP: Matches blacklist: fringe.320.hdtv-lol.r02
SKIP: Matches blacklist: fringe.320.hdtv-lol.r03
SKIP: Matches blacklist: fringe.320.hdtv-lol.r04
SKIP: Matches blacklist: fringe.320.hdtv-lol.r05
SKIP: Matches blacklist: fringe.320.hdtv-lol.r06
SKIP: Matches blacklist: fringe.320.hdtv-lol.r07
SKIP: Matches blacklist: fringe.320.hdtv-lol.r08
SKIP: Matches blacklist: fringe.320.hdtv-lol.r09
SKIP: Matches blacklist: fringe.320.hdtv-lol.r10
SKIP: Matches blacklist: fringe.320.hdtv-lol.r11
SKIP: Matches blacklist: fringe.320.hdtv-lol.r12
SKIP: Matches blacklist: fringe.320.hdtv-lol.r13
SKIP: Matches blacklist: fringe.320.hdtv-lol.r14
SKIP: Matches blacklist: fringe.320.hdtv-lol.r15
SKIP: Matches blacklist: fringe.320.hdtv-lol.r16
SKIP: Matches blacklist: fringe.320.hdtv-lol.r17
SKIP: Matches blacklist: fringe.320.hdtv-lol.r18
SKIP: Matches blacklist: fringe.320.hdtv-lol.r19
SKIP: Matches blacklist: fringe.320.hdtv-lol.r20
SKIP: Matches blacklist: fringe.320.hdtv-lol.r21
SKIP: Matches blacklist: fringe.320.hdtv-lol.r22
SKIP: Matches blacklist: fringe.320.hdtv-lol.r23
SKIP: Matches blacklist: fringe.320.hdtv-lol.rar
SKIP: Matches blacklist: fringe.320.hdtv-lol.sfv
Antec Fusion
Intel E2160 (1.8GHz)
4GB Patriot DDR2 800
Auztech X-Mystique Sound Card
300GB + 500GB + 750GB + 1TB
Ubuntu 9.10
Reply
v1.27

This is just a minor update, changing the way that archives are handled.

http://sourceforge.net/projects/sorttv

As always, donations are appreciated!

sh0stak Wrote:Happy to see SortTV now handles extraction. I have a question about it though.

How I am running right now: finished downloads go into a /new folder where they are sorted from. I am using copy-and-leave-symlink so that files can continue to seed. This works fine for non-archived files.

For archives I had a problem where the .r## (but not .rar) were being copied/symlinked also. I added a blacklist entry for *.r(0-9)* (a separate entry for each digit), so now all the rar files remain untouched and seed just fine. The extracted video file is sorted fine and the extraction folder and symlink is left behind even though I never use it (this is fine, they just get delete once seeding is complete and take up no space).

The problem: Every time sorttv runs, it appears to re-extract the file since all the archives are still there. I cannot tell if it is actually extracting the file or not though, all that is in the extracted directory is a symlink so it looks like the actual extraction is skipped, but still displayed in the log. I know sorttv is smart enough to not re-copy files that are already sorted (dont move/copy if the destination file already exists) but does it do the same with extraction?

With this update, if the file has already been extracted (and the extracted folder is still there) then extraction is skipped. I also added those file names you mentioned to the blacklist.

Thanks.
Reply
Hi, I really miss the library update when sorting is done. How would i setup this with pre eden xbmc? i guess i should conf the new xbmc communication setting, but how does it work when you have a username and password and it's running on another box? I would appreciate some better examples in the conf for this. Other then that, great work updating and including new and good features for this script. Smile Can't wait to see an official Add-on for this.

Edit:
Looked at the script, and i guess this protocol only needs ip, and judging by my xbmc.log it is hosting at 9090. But i don't get any library updates when it has new episodes, so how could i debug this? Smile
Samsung ES7005 55" led tv - Denon AVR-3313 - NAD C275BEE - B&W DM683 - B&W HTM61 - B&W 686
Intel NUC D34010WYK - 128GB Crucial ssd, Built in IR Receiver
And a Logitech Harmony Touch to control it all. https://libreelec.tv
Retired: Asus EB1501P ION2 - OCZ Vertex 2 64gb ssd - Built in IR Receiver
Reply
Also i would like to do a feature request, i would like to extract compressed files after sorting. So i don't mess up what I'm copying from. Rolleyes

Edit: i tried "extract-compressed-before-sorting=TRUE" with "sort-by=COPY", but it does not seem to unpack the content, and there is no error about it in the log, extracting is not even mentioned. I have made sure unrar is installed too. So I'm not able to see if my feature request is needed or not, as i cant get it to work.
Samsung ES7005 55" led tv - Denon AVR-3313 - NAD C275BEE - B&W DM683 - B&W HTM61 - B&W 686
Intel NUC D34010WYK - 128GB Crucial ssd, Built in IR Receiver
And a Logitech Harmony Touch to control it all. https://libreelec.tv
Retired: Asus EB1501P ION2 - OCZ Vertex 2 64gb ssd - Built in IR Receiver
Reply
newphreak Wrote:Hi, I really miss the library update when sorting is done. How would i setup this with pre eden xbmc? i guess i should conf the new xbmc communication setting, but how does it work when you have a username and password and it's running on another box? I would appreciate some better examples in the conf for this. Other then that, great work updating and including new and good features for this script. Smile Can't wait to see an official Add-on for this.

Edit:
Looked at the script, and i guess this protocol only needs ip, and judging by my xbmc.log it is hosting at 9090. But i don't get any library updates when it has new episodes, so how could i debug this? Smile

Yesterday I updated to a newer version of xbmc on my HTPC and I have started seeing the same thing. On my dev box the library update works fine during testing, but on the HTPC it is receiving and displaying the notifications but not looking for new content.

I have both the old and new command interface setup in my SortTV configuration.

My first guess is that the interface for RPC commands has changed yet again. I don't have time to investigate this right away, but if someone else has the time to get to the bottom of this it would help a lot of users Smile
Reply
newphreak Wrote:Also i would like to do a feature request, i would like to extract compressed files after sorting. So i don't mess up what I'm copying from. Rolleyes

Edit: i tried "extract-compressed-before-sorting=TRUE" with "sort-by=COPY", but it does not seem to unpack the content, and there is no error about it in the log, extracting is not even mentioned. I have made sure unrar is installed too. So I'm not able to see if my feature request is needed or not, as i cant get it to work.

If extraction is enabled and it can't find a program to do the extraction it should say so. Perhaps try creating some more .zip/.rar files and putting them in the directory you are sorting to see what happens.
Reply
I just got the daily shows working in xbmc with sorttv! You should promote this functionality a bit more e.g. in the feature list!

I manage to miss it and only found out when I tried to review the code to do it myself. (pretty tricky code btw).

It is more or less impossible to get to work in xbmc without a rename to the s99e99 format due to the limitations in thetvdb (well, or due to limititations in the scrapers)

My conf was correct to do this already, the issue was name format (did not work with liberal matching for some reason)
Best fixed by defining the shows in the conf

E.g.
Code:
tvdb-id-substitute:Brothers and Sisters-->79506
tvdb-id-substitute:Greys Anatomy-->73762
tvdb-id-substitute:David Letterman-->75088
tvdb-id-substitute:The Daily Show-->71256
On a (un-)related note I also have

Code:
show-name-substitute:House MD-->House
show-name-substitute:House M.D.-->House

Perhaps you want to add these to the templete or else someone might want to copy it.
Reply
vikjon0 Wrote:I just got the daily shows working in xbmc with sorttv! You should promote this functionality a bit more e.g. in the feature list!

I manage to miss it and only found out when I tried to review the code to do it myself. (pretty tricky code btw).

It is more or less impossible to get to work in xbmc without a rename to the s99e99 format due to the limitations in thetvdb (well, or due to limititations in the scrapers)

My conf was correct to do this already, the issue was name format (did not work with liberal matching for some reason)
Best fixed by defining the shows in the conf

E.g.
Code:
tvdb-id-substitute:Brothers and Sisters-->79506
tvdb-id-substitute:Greys Anatomy-->73762
tvdb-id-substitute:David Letterman-->75088
tvdb-id-substitute:The Daily Show-->71256
On a (un-)related note I also have

Code:
show-name-substitute:House MD-->House
show-name-substitute:House M.D.-->House

Perhaps you want to add these to the templete or else someone might want to copy it.

Glad you found the daily show name matching feature helpful. Credit to CoinTos for contributing the code.

If liberal matching is enabled, it basically pulls any numbers out of the filename for the season and episode numbers. Handy for filenames such as "Show Ser 1 Epi 2.avi", but I don't have it enabled on my system and havn't needed it. As you found out, it tries liberal matching before it tries dates.

Thanks for the config lines, I will add them to the next version.

Since you have already had a look at the code, remember I am always happy to receive patches, so if you can think of any other features or want to have a crack at one of the features we have discussed (movie sorting, multi-episode files, the xbmc interface), then please go for it!
Reply
Turns out the place where i procure the shows is not too bothered with the naming of daily shows. All (so far) have to be identified.

tvdb-id-substitute:Conan-->194751
(assumimg we only download current conan)
tvdb-id-substitute:Jay Leno-->70336
(assuming we only down curremt Jay)
Reply
Quote:Since you have already had a look at the code,
Well, so far my conclusion is that it looks tricky. Wink I don't know perl and I never figured out regex. Not knowing a language have never stopped me from reading code before, but perhaps it is time to read up on regex.

Do you have a feature request list?

The music folder is a great addition (altough I have to pretend it says audio since I am an audiobook addict)
I think more folders would be useful.

Of course separating movies from other non-episodes would be great. Sorting the movies would be even greater.
I assume a full solution is a lot of work but one fix would be to handle it like music, if non-ep then check if video and move to video folder ("non-ep video").

An "assumed to be crap if found togther with media files" folder would also be nice.
.txt, .nfo etc is moved to this folder if found together with e.g. a tv serie
This folder can then be checked and emptied and the files will not be mixed with non episodes or non sorted material.

An alternative to the last thing would be another blacklist, instead of the existing ignore-list the new list will send matches to a another folder.
Reply
vikjon0 Wrote:Well, so far my conclusion is that it looks tricky. Wink I don't know perl and I never figured out regex. Not knowing a language have never stopped me from reading code before, but perhaps it is time to read up on regex.

Do you have a feature request list?

Not formally. Feel free to mention any ideas here. The ones I mentioned are the main outstanding ones.

vikjon0 Wrote:The music folder is a great addition (altough I have to pretend it says audio since I am an audiobook addict)
I think more folders would be useful.

Of course separating movies from other non-episodes would be great. Sorting the movies would be even greater.
I assume a full solution is a lot of work but one fix would be to handle it like music, if non-ep then check if video and move to video folder ("non-ep video").

An "assumed to be crap if found togther with media files" folder would also be nice.
.txt, .nfo etc is moved to this folder if found together with e.g. a tv serie
This folder can then be checked and emptied and the files will not be mixed with non episodes or non sorted material.

An alternative to the last thing would be another blacklist, instead of the existing ignore-list the new list will send matches to a another folder.

I think the best way to do movie sorting would be to look it up on the moviedb: for example, using a perl module.

If there is a match, then rename using the movie title (and year?) and move it to a movie directory. Optionally in a subdirectory for the movie.

As I mentioned in a previous post this module looks promising, but for some reason is not available in Strawberry Perl CPAN:
http://search.cpan.org/~pjobson/WWW-TheM.../Search.pm
I haven't looked into it any further, but it would be great if someone could look into why Perl and Strawberry Perl have separate modules available via CPAN.
Reply
  • 1
  • 20
  • 21
  • 22(current)
  • 23
  • 24
  • 49

Logout Mark Read Team Forum Stats Members Help
SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac)8