XBMC Community Forum
SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for XBMC (/forumdisplay.php?fid=116)
+--- Thread: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) (/showthread.php?tid=75949)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44


RE: SortTV - cliffe - 2013-09-05 23:09

(2013-09-03 10:03)staticxsoil71 Wrote:  I have been working on incorporating TechLife's json modifications, handling of part.rar files, and updating to using WWW::TheMovieDB. The only thing im not %100 shure is working is image download from the imdb. Where can i send a patch file to?

Fantastic! Send it my way (email, PM, or post it here). I have started work on incorporating the new TheMovieDB module, but it sounds like you are ahead of me, so please do send. Smile


New version of SortTV - cliffe - 2013-09-06 01:23

Version 1.35 of SortTV is now available.

Special thanks to Paul for going to the effort of updating his TheMovieDB CPAN module, in preparation for the upcoming API changes.

This release incorporates the new module, and fixes the online version check to be compatible with the new Sourceforge interface.

Thanks again to everyone who submitted suggestions. Sorry I have not incorporated all of the code spinets, please send me patch files Smile. In any case, hopefully the next version can pull all those other great additions in.

You can get the new version here:
https://sourceforge.net/projects/sorttv/files/

You will have to run this command to install these additional modules:
Code:
sudo cpan WWW::TheMovieDB JSON::Parse
(without the "sudo" on Windows)


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - TechLife - 2013-09-06 05:32

Thanks for the update Cliffe! Trying it out now.

Here is my pop-up notification patch. (.diff file for v1.35)


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - SASDOE - 2013-09-25 18:40

Hi everyone,

First of all, thanks for the script, it is awesome.

I only have one problem, it seems it has a lot of trouble with movies containing the string x264 (which has become very popular), since it always sends them the to "Other" folder, and not the Movie folder. Can anyone confirm they are having the same problems as I am?

Does anyone have a quick fix ?


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - TechLife - 2013-09-28 18:02

If you modify the file name first, removing ONLY the x264 leaving everything else exactly the same, does it work then?


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Ballistic - 2013-09-29 11:10

This looks really awesome! Thanks for creating this.

However, i am unable to run it on Freebsd.

Code:
vod# perl sorttv.pl
Can't locate WWW/TheMovieDB.pm in @INC (@INC contains: /usr/local/lib/perl5/5.12.4/BSDPAN /usr/local/lib/perl5/site_perl/5.12.4/mach /usr/local/lib/perl5/site_perl/5.12.4 /usr/local/lib/perl5/5.12.4/mach /usr/local/lib/perl5/5.12.4 .) at sorttv.pl line 55.
BEGIN failed--compilation aborted at sorttv.pl line 55.

Code:
vod# cpan WWW::TheMovieDB::Search
Going to read '/root/.cpan/Metadata'
  Database was generated on Sun, 29 Sep 2013 07:17:02 GMT
WWW::TheMovieDB::Search is up to date (0.04).

Any idea?


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Ballistic - 2013-09-29 11:22

Managed to get it running on FreeBSD with;

Code:
cd /usr/local/lib/perl5/site_perl/5.12.4/WWW
wget http://cpansearch.perl.org/src/PJOBSON/WWW-TheMovieDB-0.03/lib/WWW/TheMovieDB.pm
cpan JSON::Any
cpan JSON::Parse



Bug - Fox - 2013-10-02 15:00

Hi Cliffe,

I found a small bug that I think has been around for quite some time (I remember talking to a guy in here a long time ago with similar experience).
When the script is sorting out the show name it cuts after the first S in the filename i.e The.Blacklist.S01E01.mkv turns into The Blackli

To try it out set your season-title in the config file to "S" (single S, no space after).
It will mess up the regex code below from the sub fixpurename
Code:
$title =~ s/(?:Season.([0-9]{1,3}).|Series.([0-9]{1,3}).|\Q$seasontitle\E.*)//ig;
I guess any letter or shorter word used in the season-title have the potential to create this problem.

Removing the \Q$seasontitle\E.* part or commenting out the whole row will make it run, not such a great solution but better then nothing for those running into the problem.


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc - mybrain87 - 2013-10-06 10:53

Somehow sorttv suddenly decided not to work on Movies anymore.
It does nothing to them. It doesn't even tell me why. Log shows nothing.

It just says:

Code:
SortTV
~~~~~~
Sorting:
    From /MyFiles/Media_9/finished/Movies/
    Movies into /MyFiles/Media_9/Movies/
10:52:8, 6-9-2013

Anybody know what the problem is?


RE: Problems with finding matches - InSipiD - 2013-10-06 12:00

Hi!
I have a recent problem with finding matches on movies:

Code:
INFO: Currently checking file: The.Colony.2013.1080p.BluRay.x264-PSYCHD
INFO: Looking for movie matching The.Colony.2013.p..-PSYCHD using the movie db
INFO: No movies matching The.Colony.2013.p..-PSYCHD found
INFO: Currently checking file: The.East.2013.LIMITED.720p.BluRay.x264-GECKOS
INFO: Looking for movie matching The.East.2013.LIMITED.p..-GECKOS using the movie db
INFO: No movies matching The.East.2013.LIMITED.p..-GECKOS found
INFO: Currently checking file: The.Frozen.Ground.2013.LIMITED.720p.BluRay.x264-GECKOS
INFO: Looking for movie matching The.Frozen.Ground.2013.LIMITED.p..-GECKOS using the movie db
INFO: No movies matching The.Frozen.Ground.2013.LIMITED.p..-GECKOS found
INFO: Currently checking file: The.Hangover.III.2013.1080p.BluRay.x264-SPARKS
INFO: Looking for movie matching The.Hangover.III.2013.p..-SPARKS using the movie db
INFO: No movies matching The.Hangover.III.2013.p..-SPARKS found
INFO: Currently checking file: The.Iceman.2012.LIMITED.1080p.BluRay.x264-GECKOS
INFO: Looking for movie matching The.Iceman.2012.LIMITED.p..-GECKOS using the movie db
INFO: No movies matching The.Iceman.2012.LIMITED.p..-GECKOS found
INFO: Currently checking file: The.Purge.2013.1080p.BluRay.x264-SPARKS
INFO: Looking for movie matching The.Purge.2013.p..-SPARKS using the movie db
INFO: No movies matching The.Purge.2013.p..-SPARKS found
INFO: Currently checking file: The.Seasoning.House.2012.720p.BluRay.X264-TRiPS
INFO: Looking for movie matching The.Seasoning.House.2012.p..-TRiPS using the movie db
INFO: No movies matching The.Seasoning.House.2012.p..-TRiPS found
INFO: Currently checking file: This.is.the.End.2013.1080p.BluRay.x264-SPARKS
INFO: Looking for movie matching This.is.the.End.2013.p..-SPARKS using the movie db
INFO: No movies matching This.is.the.End.2013.p..-SPARKS found

This worked fine earlier?
Is it possible to get some debug output to make sure that it actually connects to the movie db?

It works fine with series, and used to work with movies as well.


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - benjy - 2013-10-07 11:42

I have the same problem, I think the script is working fine however I think the moviedb is no longer providing matches unless the title is exactly correct.

If you rename the movies first and then run the script, all works as expected. Would be great if we could fix the title up before we query the db?


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - benjy - 2013-10-07 14:50

I tracked this down a little further and the problem seems to be the dots in the filename rather than spaces, eg "The.Lone.Ranger" doesn't work but "The Lone Ranger" does.

Quick fix which i'm sure could be improved on by the maintainer.

Line 1955 right above the "eval {" add the following
Code:
$title =~ s/\./ /g;



RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - InSipiD - 2013-10-07 17:34

(2013-10-07 14:50)benjy Wrote:  I tracked this down a little further and the problem seems to be the dots in the filename rather than spaces, eg "The.Lone.Ranger" doesn't work but "The Lone Ranger" does.

Quick fix which i'm sure could be improved on by the maintainer.

Line 1955 right above the "eval {" add the following
Code:
$title =~ s/\./ /g;

Yes, that works for some directory names.
However, if the name is "Disconnect.2012.LIMITED.720p.BluRay.x264-ALLiANCE"
$title will be "Disconnect 2012 LIMITED p -ALLiANCE" which gives you about 371 hits.

EDIT:
These lines (~row 511) are the ones extracting the title (before your code replaces it with spaces instead of dots:
Code:
if($filename =~ /(.*?)\s*-?\s*\(?\[?([12][0-9]{3})\)?\]?(?:BDRip|\[Eng]|DVDRip|DVD|Bluray|XVID|DIVX|720|1080|HQ|x264|R5)*.*?(\.\w*$)/i
                || $filename =~ /(.*?)(?:[[\]{}()]|\[Eng]|BDRip|DVDRip|DVD|Bluray|XVID|DIVX|720|1080|HQ|x264|R5)+.*?()(\.\w*$)/i
                || $filename =~ /(.*?)()(\.\w*$)/i || $filename =~ /(.*)()()/) {
                        my $title = $1;
                        my $year = $2;
                        my $ext = $3;
                        $title =~ s/(?:\[Eng]|BDRip|DVDRip|DVD|Bluray|XVID|DIVX|720|1080|HQ|x264|R5|[[\]{}()])//ig;
                        # at this point if it is not a known movie it is an "other"
                        if(match_and_sort_movie($title, $year, $ext, $file) eq "TRUE") {

But I'm no expert at regex so I don't know how to fix it for titles like "Disconnect.2012.LIMITED.720p.BluRay.x264-ALLiANCE" or "Iron.Man.3.2013.720p.BluRay.x264-SPARKS"


Can't locate TVDB/API.pm in @INC - AlxAlxV - 2013-10-08 23:48

Hi,

I'm trying to launch the pl script but I got this error :

Quote: Can't locate TVDB/API.pm in @INC

I try to make

Quote:sudo cpan TVDB::API

But it's failed....

Anyone has an idea??
Thanks


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - benjy - 2013-10-10 12:50

@InSipiD

I think the regex should have reduced your title to "Disconnect.2012.LIMITED" and then my code replaces the dots with spaces. https://www.debuggex.com/r/ivi7LEfUTi-qBZiu

I've no idea how you got <code>Disconnect 2012 LIMITED p -ALLiANCE</code>