SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116) +--- Thread: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) (/showthread.php?tid=75949) |
RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Topgunn - 2012-11-08 I have tried all I can and now Im in over my head. There has to be an easier way of doing what I want. Time to try another script. RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - cliffe - 2012-11-10 (2012-10-30, 17:30)Lord_Kami Wrote: Found a bug in the latest stable version. Multi volume rar-archives where files are named .*part[number].rar, sorttv extracts each and every .rar resulting in a very time and space consuming operation. Sounds like a good idea. I'll add it to the TODO list, patches welcome! RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - cliffe - 2012-11-10 Sorry I haven't had a chance to reply earlier. Anyway, here are some short responses. (2012-11-03, 09:14)Topgunn Wrote: Hi, I am new to this script and Ive been having a few problems and hence have a few questions. I have been playing around with linux for a little while but Im still a novice with Google being my best friend. After my list of problems you will probably think why bother but the lure of completely automating my system and the fact Im always up for a challenge has me wanting to get it all sorted. The pattern matching is case sensitive, so a delete config line would have to be something like: delete=*(extracted by SortTV) However, the deletes happen after extractions and before the sorting happens, so you would have to run the script to extract and sort, and then again to delete. Then again, what you want is so specific that it might be easiest to just write a short Bash/Perl script to do that. Ignoring for the moment multipart rar files, if the extraction works properly and you use sort-by MOVE, then the extracted by SortTV directory is removed by SortTV once it is empty. (2012-11-03, 09:14)Topgunn Wrote: My current work around that I came up with is two copies of the script with different configs, one that processes normal files and copies them and the other that processes rars and moves them. I made a basic shell script that calls the normal/copy one first and when that finishes the next rar/move one does any that the first one didnt do. This works but I know it is far from ideal and I would rather have it setup so the one script works by copying all actual files (including whats in the rars) but after a successful copy deleting the rar files it creates and I was wondering what it is exactly I have to put in the script config to delete them?Sounds reasonable... (2012-11-03, 09:14)Topgunn Wrote: Now to my next question,You can put settings in the sorttv.conf file and then override some with command line arguments. For example, put all the directories you always want to sort into in the config file, and leave the source directory blank. From transmission set it to run perl sorttv.pl file-to-sort=$TORRENT_NAME And you can do your usual sorts with: perl sorttv.pl directory-to-sort=/your_source_directory (2012-11-03, 09:14)Topgunn Wrote: At the moment the script cant seem to find specials against standard scene release names on the TvDb such as Show Name.S01.Special.Episode title.HDTV.x264-Scene.Group.mp4. I have all the matching and renaming options still at default and I can find it manually on the TvDb listed as a special in Season 1. It picked up the normal episodes ok so I dont know what to change there or if thats a bug. No one has mentioned sorting specials before. Looks like a reasonable feature request. I don't have time to code it at the moment, but again I really do welcome patches (2012-11-07, 01:43)Topgunn Wrote: Ok Ive played around with it a bit and had a bit more of a think and im starting to sort out my problems. I managed to find an expression that the script would pick up to delete the folder left behind from the extract process but then i got a :is a directory error so researched how perl deletes files and found the unlink command in the script and that it only deletes files. I then looked up how to delete non-empty directories instead and found the rmtree command so I changed unlink to rmtree in the script and added use File:ath; to the top and bingo it worked. At this stage that folder is the only thing I want deleted so I can leave it like that for now. I doubt it will still delete files but I could add in another argument with unlink if I want that. Yeah, no worries. SortTV also deletes empty directories, so I think you can probably just change the delete pattern to something like: delete=*directory-name-to-delete/* (2012-11-08, 01:36)Topgunn Wrote: I have tried all I can and now Im in over my head. There has to be an easier way of doing what I want. Time to try another script. Well, hopefully this post helps. In the future, perhaps break your questions down more clearly so that it is easier to parse and respond. Good luck! RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Topgunn - 2012-11-10 Thanks so much for the replies to my problems. Sorry my questions were so jumbled too. There was a lot of playing around between posts and I got a bit lost, and carried away lol. I think your response has helped me a lot though. I did try delete=*(extracted by SortTv)/* but it wouldnt delete the folder because it still had the data inside. The other way I thought to do it is to have a transmission call a bash script that then executed a copy on complete script thats on their forums to move the data a temp folder on my storage drive combined with yours to unrar if needed and then move from the temp directory to the TV one and keep the original on my download/seeding drive to be deleted when it finishes. If I can just get the scripts called on the torrent and not the whole directory by using $TORRENT-NAME and doing what you suggested with the config it should execute pretty quickly. I guess ill try to integrate it both ways and see what works best for me. Ill try to research how to get the specials working and try the code from Lord Kami for the multipart rars and if I can get all this autonomous I will be so happy! Thanks again for working through my mess and giving me some pointers. I was going to try filebot next but getting that to do exactly what I want would probably be even harder and now hopefully I wont have to because this will be perfect RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Scottsburg - 2012-12-09 So I'm setting up my first install of XBMC, and this script was exactly what I needed to move and sort my latest downloads. I really want this setup to happen, but I cannot get this script working. I'm running on 64bit Windows 7 SP1, using Strawberry Pearl 5.16.2.1 I had to do a force install of WWW::TheMovieDB::Search, as it failed the test initially, but I believe all of the modules are now installed. The error I'm getting is: Code: DBM::Deep: Cannot sysopen file '/.tvdb.db': Permission denied I found reference to this error in the thread way back in 2010, but the only solution then was to setup the config file so the script doesn't require a connection to TheTVDB. However when I do that (no file renaming, no downloading artwork) I get this error message: Code: Can't call method "getSeries" on an undefined value at ./SortTV/sorttv.pl line 1705 Any help would be much appreciated. RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - cliffe - 2012-12-09 (2012-12-09, 06:55)Scottsburg Wrote: So I'm setting up my first install of XBMC, and this script was exactly what I needed to move and sort my latest downloads. I really want this setup to happen, but I cannot get this script working. I'm running on 64bit Windows 7 SP1, using Strawberry Pearl 5.16.2.1 Check the permissions on sorttv/.cache/.tvdb.db Perhaps try setting the permissions as liberally as possible (Grant Everyone all permissions to everything in .cache). See if that helps, and set the permissions to something that makes sense afterwards. RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - Scottsburg - 2012-12-10 I know just enough about scripting to get myself in trouble, but here's how I got it to work (probably not the best method, but...) I debugged 'sorttv.pl' and the script was stopping at line #294 Code: $tvdb = TVDB::API::new($TVDBAPIKEY); In the code for 'sorttv.pl', after the new $tvdb instance is created, the script then creates the '.cache' directory and sets that folder as the location for the $tvdb database. I assumed there was some kind of permission issue going on that didn't allow the code in TVDB::API to create the database in the location it wanted, so I just commented out a line in '/strawberry/perl/site/lib/TVDB/API.pm' - line #74 Code: $self->setCacheDB($args->{cache}); Script ran fine after that. Downloaded episode titles and everything. RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - marsilainen - 2013-01-08 (2012-11-10, 15:05)cliffe Wrote:(2012-10-30, 17:30)Lord_Kami Wrote: Found a bug in the latest stable version. Multi volume rar-archives where files are named .*part[number].rar, sorttv extracts each and every .rar resulting in a very time and space consuming operation. I have this problem too. Any progress? Filled the entire hd with one movie Thanks for the awesome program btw. Made everything so much easier! RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - logif - 2013-01-15 I am having problems installing models in to perl. I run sudo perl -MCPAN -e 'install Debug::Simple' and get this output: Going to read '/home/logif/.cpan/Metadata' Database was generated on Tue, 15 Jan 2013 13:53:03 GMT Running install for module 'Debug::Simple' Running make for B/BE/BEHANW/Debug-Simple-0.10.tar.gz Checksum for /home/logif/.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 Writing Makefile for Debug::Simple Writing MYMETA.yml BEHANW/Debug-Simple-0.10.tar.gz make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible it seems I have to have it installed to be able to install TVDB::ATI. is there a lib for ubuntu or ... what am i doing wrong? my system is Ubuntu server 12.04 RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - nayr - 2013-02-08 Thanks for the script, works great here in OSX w/Plex + Transmission. But Ive been having problems sorting TDS lately filename: The.Daily.Show.2013.02.07.Neil.Barofsky.720p.HDTV.x264-LMAO.mkv results in it thinking its season 720 episode 264, and bails out because there's no folder: "The Daily Show 2013 02 07 Neil Barofsky" any suggestions? RE: SortTV: Sort TV episodes, movies, and music into directories (Linux/Win/Mac) - vogelap - 2013-02-12 Trying to get this fantastic script working on my Win 7, 64-bit machine. I, too, am getting stuck when trying to install Switch. It keeps failing, even when I try to "force install" it. Any suggestions? Thanks! RE: SortTV: Sort TV episodes, movies, and music into directories (Linux/Win/Mac) - Fox - 2013-02-20 Switch seems to be gone in the newer versions of perl, if you grab switch.pm (in the perl/lib folder) from 5.12 and put in your folder it should work. Thats what I did when I was trying out a new version of Strawberry at least. .rar on OSX - aestridge - 2013-02-25 I'm having a real problem getting the script to extract .rar files on OSX. Says there is an error and cannot find 7zip etc. I've tried a bunch of different extracting applications.. no luck. I've updated perl, and done whatever i could based on the other posts in this thread. Anyone else having this problem? Help! RE: .rar on OSX - Vaneshi - 2013-03-09 (2013-02-25, 03:16)aestridge Wrote: I'm having a real problem getting the script to extract .rar files on OSX. Says there is an error and cannot find 7zip etc. I've tried a bunch of different extracting applications.. no luck. I've updated perl, and done whatever i could based on the other posts in this thread. Anyone else having this problem? Help! The script won't/can't make use of any .app's you've installed. You need to find the command-line versions of those files and shove them in say /usr/bin (or somewhere on your PATH statement that sorttv.pl can find). problem - sassafras - 2013-03-10 There is a problem with the script that occurs with one show. When the show Tosh.0 exists in the watch folder, the script will start but then stall before moving any shows. It takes 100% of available CPU cycles but accomplishes nothing. It sits indefinitely. I have tried to make a rename in the .conf file to make this more tvdb friendly, but it still stalls the script. I assume this is a problem with perl's syntax parsing dealing with the '.' (period) being part of the title. I assume the script uses the period as the delimiter between title and season which is what is throwing the script off. Is this something anyone else has run into? |