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 Kodi (/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 45


SortTV: Sort TV episodes, movies, music into directories - iamwudu - 2013-10-17 13:08

Here's a patch for the *.part001.rar bug. Now all but the first part are skipped.

Code:
--- sorttv.pl   2013-10-17 12:44:19.265528167 +0200
+++ new/sorttv.pl       2013-10-17 12:54:01.316720483 +0200
@@ -1306,6 +1306,10 @@
                        out("std", "SKIP: parts are still downloading: $arfile\n");
                        next;
                }
+                if(filename($arfile) =~ /\b.*\.part\d+\.rar\b/i && filename($arfile) !~ /\b.*\.part0*1\.rar\b/i) {
+                       #out("std", "SKIP: part file: $arfile\n");
+                       next;
+               }
                unless (mkdir($dest)) {
                        out("warn", "WARN: could not create directory: $dest ($!), extracting to $sortd\n");
                        $dest = $sortd;



SortTV Broken in Mavericks? - samjdavis - 2013-10-25 05:37

I have recently updated to mavericks on my iMac 27". Before now, the script was running flawlessly, loved it so much! However, now whenever I try and run it, i get an error. This is my terminal output.

/Users/Sam/SortTV/sorttv.pl ; exit;
Sams-iMac:~ Sam$ /Users/Sam/SortTV/sorttv.pl ; exit;
Can't locate File/Copy/Recursive.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.5 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /Users/Sam/SortTV/sorttv.pl line 47.
BEGIN failed--compilation aborted at /Users/Sam/SortTV/sorttv.pl line 47.
logout

[Process completed]

Any suggestions?


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

(2013-10-25 05:37)samjdavis Wrote:  I have recently updated to mavericks on my iMac 27". Before now, the script was running flawlessly, loved it so much! However, now whenever I try and run it, i get an error. This is my terminal output.

/Users/Sam/SortTV/sorttv.pl ; exit;
Sams-iMac:~ Sam$ /Users/Sam/SortTV/sorttv.pl ; exit;
Can't locate File/Copy/Recursive.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.5 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /Users/Sam/SortTV/sorttv.pl line 47.
BEGIN failed--compilation aborted at /Users/Sam/SortTV/sorttv.pl line 47.
logout

[Process completed]

Any suggestions?

Just rerun the dependencies install

sudo cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API Getopt::Long Switch WWW::TheMovieDB JSON::Parse XML::Simple


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Vaevictus2 - 2013-10-25 16:46

Im running the latest version from sourceforge and I've just tried scanning my download directory.

File does not exist: timed out
at /usr/local/share/perl/5.14.2/TVDB/API.pm line 260.

this is kind of an unhandled exception which stops the script from continuing with the rest of my files.


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

(2013-10-08 23:48)AlxAlxV Wrote:  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

UP PLZ

Any ideas ?


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Vaevictus2 - 2013-10-26 21:27

ok some more observations:

-it's not processing movies any more (this was mentioned on the last page)
-youve got people on this forum recommending patches via the forum, why dont you move to github? then it's a bit easier to try peoples suggestions just by pulling their branch

but thanks - i at least managed to sort through a bunch of unsorted tv shows


New version of SortTV - cliffe - 2013-10-26 23:55

Version 1.36 of SortTV is now available.
  • This version improves movie lookups (ignore dots and so on, resolving a bug introduced in the last version)
  • Fixes the *.part001.rar bug: all but the first part are skipped (thanks, iamwudu)
  • Some additional name substitutions
  • Includes FreeBSD instructions in the README file (thanks, Ballistic)
  • Improves some error messages
  • Updates JSON message to include GUI notifications (thanks, TechLife)

Thanks also to everyone enjoying the script, and helping each other out with the script.

For some reason I had not received email notifications of posts, so missed that there were problems with the last release. I found and fixed the bug, to find you folks were faced with the same problem. This release should resolve the issue.

As always you can get the latest release from:
http://sourceforge.net/projects/sorttv/

--

(2013-10-02 15:00)Fox Wrote:  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
Hmm, this still needs some investigation. I will look into this when I have some extra time. Are you sure this is the source of the issue? Wouldn't that regex only behave that way when you use "S" as the season prefix? What causes the issue other times?

(2013-10-06 10:53)mybrain87 Wrote:  Somehow sorttv suddenly decided not to work on Movies anymore.
Thanks. This is fixed with this release.
(2013-10-07 11:42)benjy Wrote:  I have the same problem
Thanks for providing some troubleshooting. This release fixes this issue.

(2013-10-08 23:48)AlxAlxV Wrote:  Can't locate TVDB/API.pm in @INC
Anyone has an idea??
Not sure why the module is failing to install or be found on CPAN. Maybe someone else knows the answer to this?

(2013-10-25 16:46)Vaevictus2 Wrote:  Im running the latest version from sourceforge and I've just tried scanning my download directory.

File does not exist: timed out
at /usr/local/share/perl/5.14.2/TVDB/API.pm line 260.

this is kind of an unhandled exception which stops the script from continuing with the rest of my files.
Interesting. Looks like it is coming from the TVDB module, which I do not maintain. It might help to provide some more information on how to replicate this.

(2013-10-26 21:27)Vaevictus2 Wrote:  why dont you move to github? then it's a bit easier to try peoples suggestions just by pulling their branch
This project does use Git, and you are most welcome to contribute code via Git, either via Git's standard pull request method, or using sourceforge's new fork function w/pull request (which is similar to the way Github works). Most of the other contributors generally submit small (and very much appreciated!) changes, so sending these as patches is often much easier. Either way I am happy to receive code!

Thanks everyone. Hope you enjoy the latest release.


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

great job. Just git cloned it (cheers for that I didnt know sourceforge worked that way now!)

The script is now successfully sorting my movies :0)

cheers!


Solution for RaspBMC - AlxAlxV - 2013-10-31 20:26

Hi,

I've found the solution to launch this script on a raspberry pi.
Please follow this instruction

Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get clean
sudo apt-get install make
sudo apt-get install gcc
sudo apt-get install gcc-4.7
sudo apt-get install curl
sudo apt-get install expat
sudo apt-get install libexpat1-dev

sudo curl -L http://cpanmin.us | perl - --sudo App::cpanminus
sudo yum install -y perl-libwww-perl

After :

Code:
sudo cpanm File::Copy::Recursive    
sudo cpanm HTTP::Date                
sudo cpanm XML::SAX                
sudo cpanm Switch                     
sudo cpanm Getopt::Long             
sudo cpanm LWP::Simple                
sudo cpanm JSON::Parse                 
sudo cpanm WWW::TheMovieDB        
sudo cpanm XML::Simple                 
sudo cpanm TVDB::API


Enjoy Smile

But now I got this message :

Code:
INFO: Currently checking file: Criminal.Minds.S09E05.FASTSUB.VOSTFR.HDTV.XviD-ADDiCTiON
INFO: Entering into directory or compressed file /media/Lacie-CloudBox/Torrent/Completed/Criminal.Minds.S09E05.FASTSUB.VOSTFR.HDTV.XviD-ADDiCTiON
INFO: Currently checking file: Criminal.Minds.S09E05.FASTSUB.VOSTFR.HDTV.XviD-ADDiCTiON.avi
INFO: trying to move Criminal Minds season 09 episode 5
DBM::Deep: '1729971': Don't know what to do with type 't /usr/local/share/perl/5.14.2/TVDB/API.pm line 532

Any ideas ?
Thanks


RE: SortTV - mckinnon81 - 2013-11-11 14:48

Love the program. Thanks.

I am having some issues sorting one particular TV Series.

Keep getting the error - WARN: Could not get episode title

I am using SortTV v1.36

I am trying to sort Marvel's Agents of S.H.I.E.L.D.

The file same is marvels.agents.of.s.h.i.e.l.d.S0XE0X.mp4

I have added to the conf file the folloing

show-name-substitute=marvels.agents.of.s.h.i.e.l.d-->Marvel's Agents of S.H.I.E.L.D.
tvdb-id-substitute=Marvel's Agents of S.H.I.E.L.D.-->263365

But does not seem to work keep getting

Warning: TBDB::API: No series id found for: marvels agents of s h i e l d
WARN: Could not get episode title for marvels agents of s h i e l d Season X Episode X

Any help on setting this up is appreciated.

Thanks.

EDIT: After playing around with it I got it working. Had to change
show-name-substitute=marvels.agents.of.s.h.i.e.l.d-->Marvel's Agents of S.H.I.E.L.D. to show-name-substitute=marvels.agents.of.s.h.i.e.l.d-->Marvel's Agents of S.H.I.E.L.D
tvdb-id-substitute=Marvel's Agents of S.H.I.E.L.D.-->263365 to tvdb-id-substitute=Marvel's Agents of S H I E L D-->263365

This seems to be working.


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - AlxAlxV - 2013-11-11 19:28

(2013-11-11 14:48)mckinnon81 Wrote:  Love the program. Thanks.

I am having some issues sorting one particular TV Series.

Keep getting the error - WARN: Could not get episode title

I am using SortTV v1.36

I am trying to sort Marvel's Agents of S.H.I.E.L.D.

The file same is marvels.agents.of.s.h.i.e.l.d.S0XE0X.mp4

I have added to the conf file the folloing

show-name-substitute=marvels.agents.of.s.h.i.e.l.d-->Marvel's Agents of S.H.I.E.L.D.
tvdb-id-substitute=Marvel's Agents of S.H.I.E.L.D.-->263365

But does not seem to work keep getting

Warning: TBDB::API: No series id found for: marvels agents of s h i e l d
WARN: Could not get episode title for marvels agents of s h i e l d Season X Episode X

Any help on setting this up is appreciated.

Thanks.

EDIT: After playing around with it I got it working. Had to change
show-name-substitute=marvels.agents.of.s.h.i.e.l.d-->Marvel's Agents of S.H.I.E.L.D. to show-name-substitute=marvels.agents.of.s.h.i.e.l.d-->Marvel's Agents of S.H.I.E.L.D
tvdb-id-substitute=Marvel's Agents of S.H.I.E.L.D.-->263365 to tvdb-id-substitute=Marvel's Agents of S H I E L D-->263365

This seems to be working.

Had the same problem.
Correct with

tvdb-id-substitute:Marvels Agents of S H I E L D-->263365
tvdb-id-substitute:Marvel's Agents of S.H.I.E.L.D.-->263365
show-name-substitute=Marvels Agents of S H I E L D -->Marvels Agents of S.H.I.E.L.D.


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - vcarriere - 2013-11-12 23:51

Does anyone know why a proper release didn't override the previous one?

Could it be because its from a different release?

The.Blacklist.S01E08.720p.HDTV.X264-DIMENSION

vs

the.blacklist.s01e08.proper.720p.hdtv.x264-2hd

Is this normal behavior?


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

(2013-11-12 23:51)vcarriere Wrote:  Does anyone know why a proper release didn't override the previous one?

Could it be because its from a different release?

The.Blacklist.S01E08.720p.HDTV.X264-DIMENSION

vs

the.blacklist.s01e08.proper.720p.hdtv.x264-2hd

Is this normal behavior?

If the name is different and the rename parameter is set FALSE, it's normal I think.
Just turn rename TRUE


Sort Tv - diskjunky - 2013-11-17 14:45

Hi there i am having trouble getting this up and running. I am using windows 7 64bit. I believe everything has installed correctly but i keep getting this error message when i run the program : Can't use an undefined value as an ARRAY reference at sorttv.pl line 1661. Any ideas as to whats gone wrong?


SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Fox - 2013-11-18 11:25

(2013-10-26 23:55)cliffe Wrote:  
(2013-10-02 15:00)Fox Wrote:  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
Hmm, this still needs some investigation. I will look into this when I have some extra time. Are you sure this is the source of the issue? Wouldn't that regex only behave that way when you use "S" as the season prefix? What causes the issue other times?

I guess you didn't read/understand my whole message. Ya that was what i was saying, this only occurs when you have "S" or something else that is short as seasontitle (not the prefix I think).
I haven't tried this but I guess if you put "C" as your seasontile you would end up with The.Blacklist.S01E01.mkv turning into The Bla