• 1
  • 11
  • 12
  • 13(current)
  • 14
  • 15
  • 49
SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac)
hi,

is it possible to integrate another sort-by feature "move-or-delete" or something? i just want the file to be deleted if it already exist in the destination and not to be silently skipped.

thanks!
nicx...
Reply
Smile 
SortTV v1.19

This new version has quite a few new features:
  • --if-file-exists:[SKIP|OVERWRITE]
    What to do if a file already exists in the destination
    If not specified, SKIP
  • --flatten-non-eps:[TRUE|FALSE]
    Should non-episode files loose their directory structure?
    This option only has an effect if a non-episode directory was specified.
    If set to TRUE, they will be renamed after directory they were in.
    Otherwise they keep their directory structure in the new non-episode-directory location.
    If not specified, FALSE
  • More pattern matching. For example:
    "Show/Season 1/1 blah blah.avi"
    "Show Season 1/101 Ep title.avi"
    "Show/Season 1/1x1.avi"
    "Show Series 1 Episode 1.avi" etc
  • Various fixes, including ignoring special characters in directory names.

Outstanding issues:
  • The specific example, "the.​vampire.​diaries.​s02e07.​720p.​hdtv.​x264-ctu.​mkv", for some reason is not detected correctly... manually typing the same filename seems to not have the problem though... Patches welcome...

Other notes:
I contacted the author of a perl module to access themoviedb.org, Paul Jobson, regarding adding his module to CPAN so that we can use it in SortTV for sorting movies. Paul very quickly did so (thanks!), so that is now possible. It seems to be accessible on Linux; however, for some reason not with Strawberry Perl. If anyone is interested in figuring this out then by all means have a look in to this...
(http://code.google.com/p/perl-themoviedb-api/)

As always, your testing, bug reports, and feedback are appreciated.

These updates took some time. Remember this is free open source software, and your donations are welcome. If you find this software helpful please consider a $5 donation. Click for more information:
http://sourceforge.net/donate/index.php?group_id=330009

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

TravellingGuy Wrote:Hi Cliffe.

I'm using sorttv, which does much of what I like. However, sometimes the torrents I download have square braces in the directory (i.e. [ and ]). sorttv doesn't like that very much, and just completely skips those directories when doing the sort.

For example,torrents distributed by Torrent Day always come in this type of format:

Running sorttv on that, sorttv will just skip right over it.

Fixed the directory problem, although see the note above. Let me know whether this sorts that file of yours.

slybas Wrote:I like the tool very much although I am only using it for the initial sorting of my torrent downloads into movie or tv dirs. After that Sickbeard or Couchpotato will finish the job. Sorttv checks the download folder and everything that is recognized as tv series is moved to the tv dir the rest by default to movies. And here comes my question is it possible to add a positive movie recognision? There is no need for a very fancy renaming but it would be nice if you could actively sort movies. (And to make it complete jpg and mp3 sorting).

I have got a slight problem with this option:
PHP Code:
# OPTIONAL - where to put things that are not episodes
# If this is supplied then files and directories that SortTV does not believe are episodes will be moved here
# If not specified, non-episodes are not moved
non-episode-dir:/home/cliffe/Files/Downloads/Non-episodes 

The Dirs and files which are none episodes get moved to (in my case movie) but it strips them of the directory structure. This is a problem for movies with subtitles etc.

Fixed Smile

Movie recognition is closer to a reality, note the above issue (want to look into that?). I am not going to develop anything until I know it will at least work on Windows (via Strawberry Perl) as well as Linux.

nicx76 Wrote:hi,

is it possible to integrate another sort-by feature "move-or-delete" or something? i just want the file to be deleted if it already exist in the destination and not to be silently skipped.

thanks!
nicx...

Done Smile
Reply
First, I just want to say that I love the intent of this script and hopefully it will suit my needs perfectly at some point. Now the bad news...

1. SortTV seems to ignore file types and copies any file that fits a pattern. This is bad for me because I have uTorrent (on Windows 7) configured to use multiple destination directories for different things. I tried using a root directory as the SortTV source (e.g. c:\downloads) but SortTV copies .torrent files as well as .ut! (incomplete torrent file) and anything else it finds. I don't think there is a way to specify multiple source directories without running the script multiple times. My only other choice is to reconfigure my uTorrent configuration which I don't really feel like doing. SortTV really should not be attempting to copy files which aren't videos or subtitles, for my purposes.

2. TheTvDb still isn't working for me on Windows. Perhaps that's a good thing if it significantly increases run time. XBMC downloads that info anyway (python api code must be fine, unlike the perl version) but it would be ideal to rename the episodes with the title. Perhaps porting the script to an XBMC plugin would be optimal (for XBMC users anyway).
Reply
crocoduck Wrote:First, I just want to say that I love the intent of this script and hopefully it will suit my needs perfectly at some point. Now the bad news...

1. SortTV seems to ignore file types and copies any file that fits a pattern. This is bad for me because I have uTorrent (on Windows 7) configured to use multiple destination directories for different things. I tried using a root directory as the SortTV source (e.g. c:\downloads) but SortTV copies .torrent files as well as .ut! (incomplete torrent file) and anything else it finds. I don't think there is a way to specify multiple source directories without running the script multiple times. My only other choice is to reconfigure my uTorrent configuration which I don't really feel like doing. SortTV really should not be attempting to copy files which aren't videos or subtitles, for my purposes.

Hey crocoduck. Yes, and this is a bit of niggler for me at the moment as well. I'm working on a patch that will make sorttv only sort video files (specifically .mkv or .avi). I'll post here when I get it patched/working, and cliffe can patch it into his source if he so desires (or make it better, as my code will be pretty hacky!)
Reply
This looks great, but since I'm a noob I can't seem to get it running.

I get this error when trying to run "perl sorttv.pl"

D:\Appz\-=XBMC=-\SortTV>perl sorttv.pl
Can't locate File/Copy/Recursive.pm in @INC (@INC contains: D:/Appz/-=XBMC=-/Str
aberry_Perl/perl/site/lib D:/Appz/-=XBMC=-/Straberry_Perl/perl/vendor/lib D:/App
z/-=XBMC=-/Straberry_Perl/perl/lib .) at sorttv.pl line 36.
BEGIN failed--compilation aborted at sorttv.pl line 36.

I ran the command "cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API Text::Capitalize" to obtain the nessecarry modules but i recieved an error.

Here's the summary

"Test Summary Report
-------------------
t\002-captitle-default.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t\008-random_case.t (Wstat: 18688 Tests: 75 Failed:
73)
Failed tests: 2-74
Non-zero exit status: 73
t\009-scramble_case.t (Wstat: 18432 Tests: 75 Failed:
72)
Failed tests: 2-15, 17-74
Non-zero exit status: 72
t\boilerplate.t (Wstat: 0 Tests: 3 Failed: 0)
TODO passed: 1-3
Files=12, Tests=535, 2 wallclock secs ( 0.08 usr + 0.05 sys = 0.13 CPU)
Result: FAIL
Failed 3/12 test programs. 145/535 subtests failed.
DOOM/Text-Capitalize-1.3.tar.gz
D:\Appz\-=XBMC=-\Straberry_Perl\perl\bin\perl.exe ./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports DOOM/Text-Capitalize-1.3.tar.gz
Running Build install
make test had returned bad status, won't install without force"

Where did i go wrong?
Reply
Text::Capitalize is no longer needed for the script, it was removed as it won't build in windows.

run: cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API

and it should install everything you need without error.
Reply
CoinTos Wrote:Text::Capitalize is no longer needed for the script, it was removed as it won't build in windows.

run: cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API

and it should install everything you need without error.


Thanks, tried that but i still won't work.

This is the output of the command

"D:\Appz\-=XMBC=-\SortTV>cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::
API
CPAN: CPAN::SQLite loaded ok (v0.199)
Database was generated on Mon, 17 Jan 2011 21:25:03 GMT
Running install for module 'File::Copy::Recursive'
Running make for D/DM/DMUEY/File-Copy-Recursive-0.38.tar.gz
CPAN: Digest::SHA loaded ok (v5.48)
CPAN: Compress::Zlib loaded ok (v2.03)
Checksum for C:\strawberry\cpan\sources\authors\id\D\DM\DMUEY\File-Copy-Recursiv
e-0.38.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.68)
CPAN: File::Temp loaded ok (v0.22)
CPAN: Parse::CPAN::Meta loaded ok (v1.40)

CPAN.pm: Going to build D/DM/DMUEY/File-Copy-Recursive-0.38.tar.gz

Checking if your kit is complete...
Looks good
... Detected uninstalled Perl. Trying to continue.
Have \appz\-_xmbc~1\strabe~1\perl\lib
Want \strawberry\perl\lib
Writing Makefile for File::Copy::Recursive
CPAN: Module::CoreList loaded ok (v2.40)
The system cannot find the path specified.
DMUEY/File-Copy-Recursive-0.38.tar.gz
C:\strawberry\c\bin\dmake.EXE -- NOT OK
CPAN: YAML loaded ok (v0.72)
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
File::Glob is up to date (1.07).
LWP::Simple is up to date (5.835).
Running install for module 'TVDB::API'
Running make for B/BE/BEHANW/TVDB-API-0.33.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\B\BE\BEHANW\TVDB-API-0.33.tar
.gz ok

CPAN.pm: Going to build B/BE/BEHANW/TVDB-API-0.33.tar.gz

Checking if your kit is complete...
Looks good
Warning: prerequisite Debug::Simple 0 not found.
... Detected uninstalled Perl. Trying to continue.
Have \appz\-_xmbc~1\strabe~1\perl\lib
Want \strawberry\perl\lib
Writing Makefile for TVDB::API
---- Unsatisfied dependencies detected during ----
---- BEHANW/TVDB-API-0.33.tar.gz ----
Debug::Simple [requires]
Running make test
Delayed until after prerequisites
Running make install
Delayed until after prerequisites
Running install for module 'Debug::Simple'
Running make for B/BE/BEHANW/Debug-Simple-0.10.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\B\BE\BEHANW\Debug-Simple-0.10
.tar.gz ok

CPAN.pm: Going to build B/BE/BEHANW/Debug-Simple-0.10.tar.gz

Checking if your kit is complete...
Looks good
... Detected uninstalled Perl. Trying to continue.
Have \appz\-_xmbc~1\strabe~1\perl\lib
Want \strawberry\perl\lib
Writing Makefile for Debug::Simple
The system cannot find the path specified.
BEHANW/Debug-Simple-0.10.tar.gz
C:\strawberry\c\bin\dmake.EXE -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Running make for B/BE/BEHANW/TVDB-API-0.33.tar.gz
Has already been unwrapped into directory C:\strawberry\cpan\build\TVDB-API-0.
33-Hb3W7i

CPAN.pm: Going to build B/BE/BEHANW/TVDB-API-0.33.tar.gz

Warning: Prerequisite 'Debug::Simple => 0' for 'BEHANW/TVDB-API-0.33.tar.gz' fai
led when processing 'BEHANW/Debug-Simple-0.10.tar.gz' with 'make => NO'. Continu
ing, but chances to succeed are limited.
CPAN: Time::HiRes loaded ok (v1.9721)
The system cannot find the path specified.
BEHANW/TVDB-API-0.33.tar.gz
C:\strawberry\c\bin\dmake.EXE -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible"

And when i try to run perl sorttv.pl i get

"D:\Appz\-=XMBC=-\SortTV>perl sorttv.pl
Can't locate File/Copy/Recursive.pm in @INC (@INC contains: D:/Appz/-=XMBC=-/Straberry_Perl/perl/site/lib D:/Appz/-=XMBC=-/Straberry_Perl/perl/vendor/lib D:/Appz/-=XMBC=-/Straberry_Perl/perl/lib .) at sorttv.pl line 36.
BEGIN failed--compilation aborted at sorttv.pl line 36."
Reply
The things that jump out of your log that I see is this:

... Detected uninstalled Perl. Trying to continue.
Have \appz\-_XBMC~1\strabe~1\perl\lib
Want \strawberry\perl\lib

and then this:

The system cannot find the path specified.

Now my guess is that those 2 installation are conflicting and it can't find the right lib to install to and then fails the make. It might be as simple as just deleting the \appz\-_XBMC~1\strabe~1\ folder if your new installation is in C:\strawberry\ but I can't say for sure. Hopefully, a better answer comes along from someone who uses strawberry.
Reply
yeah, i figured as much as well, thought maybe someone had a generell idea what was going on. gonna try and reinstall, see what happens, thanks!

edit: tried uninstall and reinstalled to another folder, didn't work, still looking for dmake.exe in c:\strawberry\

copied the strawberry folder from d:\ drive to c:\ and it found dmake.exe but I still got a lot of errors.

"D:\Appz\strawberry>cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API
CPAN: CPAN::SQLite loaded ok (v0.199)
Database was generated on Mon, 17 Jan 2011 23:03:32 GMT
Running install for module 'File::Copy::Recursive'
Running make for D/DM/DMUEY/File-Copy-Recursive-0.38.tar.gz
CPAN: Digest::SHA loaded ok (v5.48)
CPAN: Compress::Zlib loaded ok (v2.03)
Checksum for C:\strawberry\cpan\sources\authors\id\D\DM\DMUEY\File-Copy-Recursiv
e-0.38.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.68)
CPAN: File::Temp loaded ok (v0.22)
CPAN: Parse::CPAN::Meta loaded ok (v1.40)

CPAN.pm: Going to build D/DM/DMUEY/File-Copy-Recursive-0.38.tar.gz

Checking if your kit is complete...
Looks good
Have \appz\strawb~1\perl\lib
Want \strawb~1\perl\lib
Your perl and your Config.pm seem to have different ideas about the
architecture they are running on.
Perl thinks: [lib]
Config says: [MSWin32-x86-multi-thread]
This may or may not cause problems. Please check your installation of perl
if you have problems building this extension.
Writing Makefile for File::Copy::Recursive
CPAN: Module::CoreList loaded ok (v2.40)
cp Recursive.pm blib\lib\File\Copy\Recursive.pm
DMUEY/File-Copy-Recursive-0.38.tar.gz
C:\strawberry\c\bin\dmake.EXE -- OK
CPAN: YAML loaded ok (v0.72)
Running make test
D:\Appz\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harnes
s(0, 'blib\lib', 'blib\arch')" t/*.t
t/1.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.03 usr + 0.01 sys = 0.05 CPU)
Result: PASS
DMUEY/File-Copy-Recursive-0.38.tar.gz
C:\strawberry\c\bin\dmake.EXE test -- OK
Running make install
Prepending C:\strawberry\cpan\build\File-Copy-Recursive-0.38-eenFn9/blib/arch C:
\strawberry\cpan\build\File-Copy-Recursive-0.38-eenFn9/blib/lib to PERL5LIB for
'install'
Installing C:\strawberry\perl\site\lib\File\Copy\Recursive.pm
Appending installation info to C:\strawberry\perl\lib/perllocal.pod
DMUEY/File-Copy-Recursive-0.38.tar.gz
C:\strawberry\c\bin\dmake.EXE install UNINST=1 -- OK
File::Glob is up to date (1.07).
LWP::Simple is up to date (5.835).
Running install for module 'TVDB::API'
Running make for B/BE/BEHANW/TVDB-API-0.33.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\B\BE\BEHANW\TVDB-API-0.33.tar
.gz ok

CPAN.pm: Going to build B/BE/BEHANW/TVDB-API-0.33.tar.gz

Checking if your kit is complete...
Looks good
Warning: prerequisite Debug::Simple 0 not found.
Have \appz\strawb~1\perl\lib
Want \strawb~1\perl\lib
Your perl and your Config.pm seem to have different ideas about the
architecture they are running on.
Perl thinks: [lib]
Config says: [MSWin32-x86-multi-thread]
This may or may not cause problems. Please check your installation of perl
if you have problems building this extension.
Writing Makefile for TVDB::API
---- Unsatisfied dependencies detected during ----
---- BEHANW/TVDB-API-0.33.tar.gz ----
Debug::Simple [requires]
Running make test
Delayed until after prerequisites
Running make install
Delayed until after prerequisites
Running install for module 'Debug::Simple'
Running make for B/BE/BEHANW/Debug-Simple-0.10.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\B\BE\BEHANW\Debug-Simple-0.10
.tar.gz ok

CPAN.pm: Going to build B/BE/BEHANW/Debug-Simple-0.10.tar.gz

Checking if your kit is complete...
Looks good
Have \appz\strawb~1\perl\lib
Want \strawb~1\perl\lib
Your perl and your Config.pm seem to have different ideas about the
architecture they are running on.
Perl thinks: [lib]
Config says: [MSWin32-x86-multi-thread]
This may or may not cause problems. Please check your installation of perl
if you have problems building this extension.
Writing Makefile for Debug::Simple
cp lib/Debug/Simple.pm blib\lib\Debug\Simple.pm
BEHANW/Debug-Simple-0.10.tar.gz
C:\strawberry\c\bin\dmake.EXE -- OK
Running make test
D:\Appz\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harnes
s(0, 'blib\lib', 'blib\arch')" t/*.t
t/00-load.t ....... # Testing Debug::Simple 0.10, Perl 5.012002, D:\Appz\STRAWB~
1\perl\bin\perl.exe
t/00-load.t ....... ok
t/pod-coverage.t .. skipped: Test:Tongueod::Coverage 1.08 required for testing POD c
overage
t/pod.t ........... skipped: Test:Tongueod 1.22 required for testing POD
All tests successful.
Files=3, Tests=1, 1 wallclock secs ( 0.05 usr + 0.00 sys = 0.05 CPU)
Result: PASS
BEHANW/Debug-Simple-0.10.tar.gz
C:\strawberry\c\bin\dmake.EXE test -- OK
Running make install
Prepending C:\strawberry\cpan\build\Debug-Simple-0.10-xYFZ1_/blib/arch C:\strawb
erry\cpan\build\Debug-Simple-0.10-xYFZ1_/blib/lib to PERL5LIB for 'install'
Installing C:\strawberry\perl\site\lib\Debug\Simple.pm
Appending installation info to C:\strawberry\perl\lib/perllocal.pod
BEHANW/Debug-Simple-0.10.tar.gz
C:\strawberry\c\bin\dmake.EXE install UNINST=1 -- OK
Running make for B/BE/BEHANW/TVDB-API-0.33.tar.gz
Has already been unwrapped into directory C:\strawberry\cpan\build\TVDB-API-0.
33-Sz2Jkb

CPAN.pm: Going to build B/BE/BEHANW/TVDB-API-0.33.tar.gz

Warning: Prerequisite 'Debug::Simple => 0' for 'BEHANW/TVDB-API-0.33.tar.gz' alr
eady built but the result looks suspicious. Skipping another build attempt, to p
revent looping endlessly.
cp lib/TVDB/API.pm blib\lib\TVDB\API.pm
BEHANW/TVDB-API-0.33.tar.gz
C:\strawberry\c\bin\dmake.EXE -- OK
Running make test
D:\Appz\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harnes
s(0, 'blib\lib', 'blib\arch')" t/*.t
t/00-load.t .......
# Failed test 'use TVDB::API;'
t/00-load.t ....... 1/1 # at t/00-load.t line 6.
# Tried to use 'TVDB::API'.
# Error: Can't locate Debug/Simple.pm in @INC (@INC contains: C:\strawberry
\cpan\build\TVDB-API-0.33-Sz2Jkb\blib\lib C:\strawberry\cpan\build\TVDB-API-0.33
-Sz2Jkb\blib\arch D:/Appz/strawberry/perl/site/lib D:/Appz/strawberry/perl/vendo
r/lib D:/Appz/strawberry/perl/lib) at C:\strawberry\cpan\build\TVDB-API-0.33-Sz2
Jkb\blib\lib/TVDB/API.pm line 13.
# BEGIN failed--compilation aborted at C:\strawberry\cpan\build\TVDB-API-0.33-Sz
2Jkb\blib\lib/TVDB/API.pm line 13.
# Compilation failed in require at (eval 4) line 2.
# BEGIN failed--compilation aborted at (eval 4) line 2.
Use of uninitialized value $TVDB::API::VERSION in concatenation (.) or string at
t/00-load.t line 9.
# Testing TVDB::API , Perl 5.012002, D:\Appz\STRAWB~1\perl\bin\perl.exe
# Looks like you failed 1 test of 1.
t/00-load.t ....... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
t/pod-coverage.t .. skipped: Test:Tongueod::Coverage 1.08 required for testing POD c
overage
t/pod.t ........... skipped: Test:Tongueod 1.22 required for testing POD

Test Summary Report
-------------------
t/00-load.t (Wstat: 256 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 1
Files=3, Tests=1, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: FAIL
Failed 1/3 test programs. 1/1 subtests failed.
dmake.EXE: Error code 255, while making 'test_dynamic'
BEHANW/TVDB-API-0.33.tar.gz
C:\strawberry\c\bin\dmake.EXE test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports BEHANW/TVDB-API-0.33.tar.gz
Running make install
make test had returned bad status, won't install without force

D:\Appz\strawberry>cd..

D:\Appz>cd SortTV

D:\Appz\SortTV>perl sorttv.pl
Can't locate File/Copy/Recursive.pm in @INC (@INC contains: D:/Appz/strawberry/p
erl/site/lib D:/Appz/strawberry/perl/vendor/lib D:/Appz/strawberry/perl/lib .) a
t sorttv.pl line 36.
BEGIN failed--compilation aborted at sorttv.pl line 36."
Reply
crocoduck Wrote:First, I just want to say that I love the intent of this script and hopefully it will suit my needs perfectly at some point. Now the bad news...

1. SortTV seems to ignore file types and copies any file that fits a pattern. This is bad for me because I have uTorrent (on Windows 7) configured to use multiple destination directories for different things. I tried using a root directory as the SortTV source (e.g. c:\downloads) but SortTV copies .torrent files as well as .ut! (incomplete torrent file) and anything else it finds. I don't think there is a way to specify multiple source directories without running the script multiple times. My only other choice is to reconfigure my uTorrent configuration which I don't really feel like doing. SortTV really should not be attempting to copy files which aren't videos or subtitles, for my purposes.

Just set a completed downloads directory.

http://torrentfreak.com/use-utorrent-to-...downloads/
Quote:"1. Separate complete from incomplete files
Just for the sake of clarity. All my active downloads will go to /downloads/incomplete, once they are finished, uTorrent will automatically move them to the /downloads directory.

Go to options/preferences/downloads to enable it"

Problem solved. When wouldn't a (completed download) called "Show S01E01.ext" be the first episode of season 1? Having said that I am happy to include a whitelist of filenames if it is a feature someone wants (especially if someone codes it Smile).

Maybe a blacklist would be more helpful. Such as:
dont-sort:torrent-downloaded-from*.txt
dont-sort:*.nfo
dont-sort:*.torrent
dont-sort:*.ut

TravellingGuy Wrote:Hey crocoduck. Yes, and this is a bit of niggler for me at the moment as well. I'm working on a patch that will make sorttv only sort video files (specifically .mkv or .avi). I'll post here when I get it patched/working, and cliffe can patch it into his source if he so desires (or make it better, as my code will be pretty hacky!)

Ok cool. I look forward to a patch. I suggest you allow a list of patterns in the config file (look at the substitute name code), then add an if statement (before the main if else block at ~line 124) in the main for loop (~line 117), and "next FILE" if the file doesn't match one of patterns defined in the config file.


crocoduck Wrote:2. TheTvDb still isn't working for me on Windows. Perhaps that's a good thing if it significantly increases run time. XBMC downloads that info anyway (python api code must be fine, unlike the perl version) but it would be ideal to rename the episodes with the title. Perhaps porting the script to an XBMC plugin would be optimal (for XBMC users anyway).

The problem seems to be with the TVDB API module. It works fine on my Windows system, so I don't know what is causing your problems. I do know that images don't download correctly on Windows. CoinTos mentioned that this was due to the module not entering binary mode when writing the jpgs. I encourage anyone to try to solve those problems and send the author of that module a patch.

I have no plans to re-implement SortTV as an XBMC plugin. I don't know if the plugins can be written in Perl, I doubt it. Eventually it would be nice to have a graphical interface though, perhaps in Perl/Tk since it is available for Linux and Windows etc.

e2zippo Wrote:yeah, i figured as much as well, thought maybe someone had a generell idea what was going on. gonna try and reinstall, see what happens, thanks!

edit: tried uninstall and reinstalled to another folder, didn't work, still looking for dmake.exe in c:\strawberry\

copied the strawberry folder from d:\ drive to c:\ and it found dmake.exe but I still got a lot of errors.

It is usually not a good idea to move files around that were installed by a program. Try to put everything back and use the "Programs and Features" tool in the Windows control panel to remove all traces of Perl. Then try reinstalling. Good luck!
Reply
I got it running now, wouldn't work unless strawberry was installed on c:\strawberry

Anyway, i recieved a few errors when running the script.

"D:\Appz\sorttv>perl sorttv.pl
SortTV
~~~~~~
WARN: Non-episode directory does not exist (/home/cliffe/Files/Downloads/Non-epi
sodes)
WARN: Could not open log file /home/cliffe/sorttv.log: No such file or directory

9:6:46, 18-0-2011
Sorting E:\Nedladdat\Tv-Serier/ into E:\TV-Serier/
Unrecognized escape \T passed through in regex; marked by <-- HERE in m/E:\Nedla
ddat\T <-- HERE v-Serier// at sorttv.pl line 121.
INFO: making season directory: E:\TV-Serier/Desperate Housewives/Season 7
DOWNLOAD: downloading season image for Desperate Housewives
MOVE: sorting E:\Nedladdat\Tv-Serier/Desperate.Housewives.S07E13.720p.HDTV.X264-
DIMENSION/Desperate.Housewives.S07E13.720p.HDTV.X264-DIMENSION.mkv to E:\TV-Seri
er/Desperate Housewives/Season 7/Desperate Housewives - S07E13 - I'm Still Here.
mkv
MOVE: sorting E:\Nedladdat\Tv-Serier/Desperate.Housewives.S07E13.720p.HDTV.X264-
DIMENSION/desperate.housewives.713.720p-dimension.nfo to E:\TV-Serier/Desperate
Housewives/Season 7/Desperate Housewives - S07E13 - I'm Still Here.nfo
Can't stat E:\Nedladdat\Tv\-Serier: No such file or directory
at sorttv.pl line 135
MOVE: sorting E:\Nedladdat\Tv-Serier/Family.Guy.S09E07.Road.to.the.North.Pole.72
0p.iTunes.DD5.1.H.264-CtrlHD.mkv to E:\TV-Serier/Family Guy/Season 9/Family Guy
- S09E07 - Road to the North Pole.mkv
INFO: making show directory: E:\TV-Serier/The Simpsons
DOWNLOAD: downloading images for The Simpsons
INFO: making season directory: E:\TV-Serier/The Simpsons/Season 22
DOWNLOAD: downloading season image for The Simpsons
MOVE: sorting E:\Nedladdat\Tv-Serier/The.Simpsons.S22E11.720p.HDTV.X264-DIMENSIO
N/The.Simpsons.S22E11.720p.HDTV.X264-DIMENSION.mkv to E:\TV-Serier/The Simpsons/
Season 22/The Simpsons - S22E11 - Flaming Moe.mkv
←[33mWarning: TBDB::API: No series id found for: the simpsons 2211 720p
←[0mWARN: Failed to get the simpsons 2211 720p series information on the tvdb.co
m.
Can't stat E:\Nedladdat\Tv\-Serier: No such file or directory
at sorttv.pl line 135"


The only things i've changed in the .conf file is the "new files to sort" and "where to sort into"

It looks like this

# The new files to sort
# For example, set this to where completed downloads are stored
directory-to-sort:E:\Nedladdat\Tv-Serier

# Where to sort episodes into (dir that will contain dirs for each show)
# This directory will contain the structure (Show)/(Seasons)/(episodes)
# Alternatively set this to "KEEP_IN_SAME_DIRECTORIES" for a recursive renaming of files in directory-to-sort
directory-to-sort-into:E:\TV-Serier

It doesn't seem to be reading it properly? Oo

And i noticed now that none of the images that was downloaded worked
poster.jpg and folder.jpg look like this

http://dl.dropbox.com/u/2059999/folder.jpg

and the others ones are either black or blank.

Thanks guys!
Reply
e2zippo Wrote:I got it running now, wouldn't work unless strawberry was installed on c:\strawberry

Anyway, i recieved a few errors when running the script.

"D:\Appz\sorttv>perl sorttv.pl
SortTV
~~~~~~
WARN: Non-episode directory does not exist (/home/cliffe/Files/Downloads/Non-epi
sodes)
WARN: Could not open log file /home/cliffe/sorttv.log: No such file or directory

9:6:46, 18-0-2011
Sorting E:\Nedladdat\Tv-Serier/ into E:\TV-Serier/
Unrecognized escape \T passed through in regex; marked by <-- HERE in m/E:\Nedla
ddat\T <-- HERE v-Serier// at sorttv.pl line 121.
INFO: making season directory: E:\TV-Serier/Desperate Housewives/Season 7
DOWNLOAD: downloading season image for Desperate Housewives
MOVE: sorting E:\Nedladdat\Tv-Serier/Desperate.Housewives.S07E13.720p.HDTV.X264-
DIMENSION/Desperate.Housewives.S07E13.720p.HDTV.X264-DIMENSION.mkv to E:\TV-Seri
er/Desperate Housewives/Season 7/Desperate Housewives - S07E13 - I'm Still Here.
mkv
MOVE: sorting E:\Nedladdat\Tv-Serier/Desperate.Housewives.S07E13.720p.HDTV.X264-
DIMENSION/desperate.housewives.713.720p-dimension.nfo to E:\TV-Serier/Desperate
Housewives/Season 7/Desperate Housewives - S07E13 - I'm Still Here.nfo
Can't stat E:\Nedladdat\Tv\-Serier: No such file or directory
at sorttv.pl line 135
MOVE: sorting E:\Nedladdat\Tv-Serier/Family.Guy.S09E07.Road.to.the.North.Pole.72
0p.iTunes.DD5.1.H.264-CtrlHD.mkv to E:\TV-Serier/Family Guy/Season 9/Family Guy
- S09E07 - Road to the North Pole.mkv
INFO: making show directory: E:\TV-Serier/The Simpsons
DOWNLOAD: downloading images for The Simpsons
INFO: making season directory: E:\TV-Serier/The Simpsons/Season 22
DOWNLOAD: downloading season image for The Simpsons
MOVE: sorting E:\Nedladdat\Tv-Serier/The.Simpsons.S22E11.720p.HDTV.X264-DIMENSIO
N/The.Simpsons.S22E11.720p.HDTV.X264-DIMENSION.mkv to E:\TV-Serier/The Simpsons/
Season 22/The Simpsons - S22E11 - Flaming Moe.mkv
←[33mWarning: TBDB::API: No series id found for: the simpsons 2211 720p
←[0mWARN: Failed to get the simpsons 2211 720p series information on the tvdb.co
m.
Can't stat E:\Nedladdat\Tv\-Serier: No such file or directory
at sorttv.pl line 135"


The only things i've changed in the .conf file is the "new files to sort" and "where to sort into"

It looks like this

# The new files to sort
# For example, set this to where completed downloads are stored
directory-to-sort:E:\Nedladdat\Tv-Serier

# Where to sort episodes into (dir that will contain dirs for each show)
# This directory will contain the structure (Show)/(Seasons)/(episodes)
# Alternatively set this to "KEEP_IN_SAME_DIRECTORIES" for a recursive renaming of files in directory-to-sort
directory-to-sort-into:E:\TV-Serier

It doesn't seem to be reading it properly? Oo

And i noticed now that none of the images that was downloaded worked
poster.jpg and folder.jpg look like this

http://dl.dropbox.com/u/2059999/folder.jpg

and the others ones are either black or blank.

Thanks guys!

Glad you got it working.

Thanks for reporting these. It looks like the sort is working, just a few warning messages.

You can ignore the "Can't stat" error messages, they just mean that empty directories won't be removed automatically. I'll fix that later. In the mean time if you avoid using "-" in directories those messages will go away.

Also, for now, try using Unix style slashes "/" rather than "\". That should get rid of the regex error message. I will fix that later too.

The two warnings at the start are because you haven't set the location for a log file or a non-episode directory. If you don't want these remove the lines from the config by starting them with a "#".

As I mentioned in my last post, the image download does not work on Windows. You can turn that off in the config.

Cheers,

Cliffe.
Reply
Just wondering if you were going to port this to an official addon? I think it would be alot easier for users if it was an addon and you could configure it thru xbmc etc.. is this in your plans?
Nvidia Shield with Kodi 18
Reply
cliffe Wrote:Glad you got it working.

Thanks for reporting these. It looks like the sort is working, just a few warning messages.

You can ignore the "Can't stat" error messages, they just mean that empty directories won't be removed automatically. I'll fix that later. In the mean time if you avoid using "-" in directories those messages will go away.

Also, for now, try using Unix style slashes "/" rather than "\". That should get rid of the regex error message. I will fix that later too.

The two warnings at the start are because you haven't set the location for a log file or a non-episode directory. If you don't want these remove the lines from the config by starting them with a "#".

As I mentioned in my last post, the image download does not work on Windows. You can turn that off in the config.

Cheers,

Cliffe.

Thanks, got most of it sorted out!

But i tested with a two family guy episodes and i noticed it takes a long time to go through the process.

For two episodes it took me 25 minutes, that seems a bit long since both dirs are on the same disk.

A simple .srt file takes minutes.
Could it be the lookup and renaming of the file that does it?


Edit: tried without renaming or any lookup at all against thetvdb.com and it still takes a loong time!
Moving the file in explorer is done in a split second.
Reply
e2zippo Wrote:Thanks, got most of it sorted out!

But i tested with a two family guy episodes and i noticed it takes a long time to go through the process.

For two episodes it took me 25 minutes, that seems a bit long since both dirs are on the same disk.

A simple .srt file takes minutes.
Could it be the lookup and renaming of the file that does it?


Edit: tried without renaming or any lookup at all against thetvdb.com and it still takes a loong time!
Moving the file in explorer is done in a split second.

Woah. No that is not normal...

Try adding the command line argument "--no-network" and let me know how long that takes.

Perl on Windows (strawberry) seems to take a really long time to recover when it tries to connect to a non-existing network host.

It could be trying to connect to xbmc. If no-network speeds it up, try commenting that line out of the config.

Let me know how that goes.
Reply
  • 1
  • 11
  • 12
  • 13(current)
  • 14
  • 15
  • 49

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