![]() |
|
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) |
- nicx76 - 2011-01-13 12:43 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... New version available - cliffe - 2011-01-14 11:33 SortTV v1.19 This new version has quite a few new features:
Outstanding issues:
Other notes: [INDENT]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/) [/INDENT] 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. 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). Fixed ![]() 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, Done
File type filter - crocoduck - 2011-01-16 21:53 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). re: File type filter - TravellingGuy - 2011-01-17 05:13 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... 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!) - e2zippo - 2011-01-17 20:23 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? - CoinTos - 2011-01-17 22:55 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. - e2zippo - 2011-01-17 23:41 CoinTos Wrote:Text::Capitalize is no longer needed for the script, it was removed as it won't build in windows. 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." - CoinTos - 2011-01-18 00:17 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. - e2zippo - 2011-01-18 00:56 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::Pod::Coverage 1.08 required for testing POD c overage t/pod.t ........... skipped: Test::Pod 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::Pod::Coverage 1.08 required for testing POD c overage t/pod.t ........... skipped: Test::Pod 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." - cliffe - 2011-01-18 07:27 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... Just set a completed downloads directory. http://torrentfreak.com/use-utorrent-to-organize-your-bittorrent-downloads/ Quote:"1. Separate complete from incomplete files 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 ).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! 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! |