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) |
- Capt.Insano - 2010-10-20 Would it be possible to set naming parameters in sorttv.conf. to choose the format of episode naming? ie: My sorttv.conf has: Code: rename-format:INCLUDE-EPISODE-TITLE Episodes get named as follows: Code: [Series] [Ep #] - [Ep Name] eg: 30 Rock S05E04 - Live Show (East Coast Taping) but all the episodes on my Media Server are naming using the following naming convention: Code: [Series].[Ep #].[Ep Name] eg: 30 Rock.S05E03.Let's Stay Together Could I set how these "Variables" appear in episode names? It would prob suit people to have custom naming conventions. P.S: The .conf option Code: use-dots-instead-of-spaces:FALSE "30.Rock.S05E03.-.Let's.Stay.Together" I hope this post made sense!! The Capt New version available - cliffe - 2010-10-20 A new version of SortTV is now available (v1.3).
The new sample configuration file contains: Code: show-name-substitute:CSI-->CSI: Crime Scene Investigation You can get the new version from: https://sourceforge.net/projects/sorttv/files/ If you find this script helpful then please consider making a $5 paypal donation http://sourceforge.net/donate/index.php?group_id=330009 CoinTos Wrote:Hi cliffe, Done, grab the new version Currently the renaming does not create that specific style (however, it is almost identical without the first '-'). Adding the option will be easy. I am trying not to have regex in the conf file for simplicity, but I have to think about the best way to implement the different styles that people might want. - cliffe - 2010-10-20 Capt.Insano Wrote:Would it be possible to set naming parameters in sorttv.conf. to choose the format of episode naming? Ok, stay tuned. I'll implement something soon... Maybe tomorrow. In the mean time, feel free to hack around line ~479 of sorttv.pl to make your copy output to your desired format. Eg: if you change (line 474): $title = " - $name"; to $title = " $name"; and turn on use-dots-instead-of-spaces, you get your desired format Update: Almost... Change it to $title = ".$name"; and also change 479 to put a "." rather than a space between show name and episode. - cliffe - 2010-10-21 Capt.Insano Wrote:Really looking forward to setting this up, when I'm home from work!! Thanks New version available - cliffe - 2010-10-21 Ok, you asked for it and here it is. A new version of SortTV is now available (v1.4). The new version now allows custom file renaming, and a number of examples are provided in the sorttv.conf file, so just choose the one that matches the format you want. --rename-format:{formatstring} Hint: including the Episode Title as part of the name slows the process down a bit since titles are retrieved from thetvdb.com The formatstring can be made up of:
For example: for "My Show S01E01 - Episode Title" (this is the default) --rename-format:[SHOW_NAME] - [EP1][EP_NAME1] for "My Show.S01E01.Episode Title" --rename-format:[SHOW_NAME].[EP1][EP_NAME2] You can get the new version from: https://sourceforge.net/projects/sorttv/files/ If you find this script helpful then please consider making a $5 paypal donation http://sourceforge.net/donate/index.php?group_id=330009 - Capt.Insano - 2010-10-21 Started using 1.4 and it is working really well, Thanks a million Cliffe. Just wondering if there is a way to use this script recursively? Sometimes my Sort Folder contains torrented episodes in folders. So instead of file being in my "directory-to-sort"; "/Torrents/Complete/TV Shows/" it is in some sub-folder; "Torrents/Complete/TV Shows/QI.XL.S08E04.WS.PDTV.XviD-W4F/ Again, Many Thanks! The Capt. - distracto - 2010-10-21 I've tried this and it works like a charm - thanks so much. i'm running windows, and i did have to have to grab the extra files from cpan for it to work. few questions though, i have more than one location where my tv shows are archived, but one location where they are downloaded to. how would i go about sorting from an incoming folder to 3 different locations if all the files to be moved are stored in one location? should i be separating the incoming files into folders based on where they will end up when this script has been run? also, just to be sure, is there a files exists rule? aaaand one more question.... is it possible to keep the file name intact? i like to keep track of the encoder New version available - cliffe - 2010-10-21 Once again, a new version of SortTV is now available (v1.5). (5th release this week!) New feature: --treat-directories:[AS_FILES_TO_SORT|RECURSIVELY_SORT_CONTENTS|IGNORE] How to treat directories. AS_FILES_TO_SORT - sorts directories, moving entire directories that represents an episode, also detects and moves directories of entire seasons RECURSIVELY_SORT_CONTENTS - doesn't move directories, just their contents, including subdirectories AS_FILES_TO_SORT/RECURSIVELY_SORT_CONTENTS/IGNORE If not specified, RECURSIVELY_SORT_CONTENTS With recursive sort, if sub directories end up empty, then they are removed. If you have a non-episodes directory set, then anything that is not an episode will be MOVED into your non-episode directory, if this not what you want then don't specify a non-episode directory. Enjoy. You can get the new version from: https://sourceforge.net/projects/sorttv/files/ Capt.Insano Wrote:Started using 1.4 and it is working really well, Thanks a million Cliffe. There is now - cliffe - 2010-10-21 distracto Wrote:I've tried this and it works like a charm - thanks so much. i'm running windows, and i did have to have to grab the extra files from cpan for it to work.Great. I did some early testing on Windows, but mostly use Linux. distracto Wrote:few questions though, i have more than one location where my tv shows are archived, but one location where they are downloaded to. how would i go about sorting from an incoming folder to 3 different locations if all the files to be moved are stored in one location? should i be separating the incoming files into folders based on where they will end up when this script has been run?Currently you would have to have the file separated into 3 directories to sort. I guess I could add a feature later to optionally require the show directory exist in the sort-to directory. That way you could just create the show directories in the destination directories, and it would only move if you were sorting into the appropriate directory. Is this a feature you want? The script is getting pretty feature-rich. Only problem with that is it may seem complicated. It would be nice to build a graphical interface to edit the config file. If I find time... By the way, everyone should feel free to contribute code distracto Wrote:also, just to be sure, is there a files exists rule?Yep. If moving, it won't move, an error message will be generated. If copying or placing a symlink it will silently fail, leaving the files as is (assuming it has already copied). distracto Wrote:aaaand one more question.... is it possible to keep the file name intact? i like to keep track of the encoderYep! Just set rename-episodes:FALSE and leave use-dots-instead-of-spaces:FALSE Cheers. - lompelurt - 2010-10-21 Hi Anybody wanna help a noob with a guide to do this on windows? I've downloaded perl and the sortTV files. No i'm not sure what to do. What I want is to copy(because of seeding) my episodes to my episodes directory. I don't need to rename the episodes or anything. So what do I have to type, and were do I have to type it for it to work. - Capt.Insano - 2010-10-21 Just wondering; Anyone having permission probs with Symlinks created by SortTV? When I try to delete any Symlinks created by SortTV over Samba I get permission denied error. Any Ideas? Thanks The Capt. P.S: BTW: The recursive option works PERFECTLY Cliffe!! - palmsquadler - 2010-10-22 Thanks for the great script cliffe, but I noticed one problem when I was trying to run it this morning. I'm running this in windows and the script fails when it tries to rename and move an episode that has an illegal character in the tvdb title. In my case it was a : (colon). - newphreak - 2010-10-22 symlinks worked locally and on samba for me, but glftpd couldnt use it which doesnt matter to me. so great work and thanks again, great work! - cliffe - 2010-10-22 palmsquadler Wrote:Thanks for the great script cliffe, but I noticed one problem when I was trying to run it this morning. I'm running this in windows and the script fails when it tries to rename and move an episode that has an illegal character in the tvdb title. In my case it was a : (colon). Thanks for letting me know! Linux doesn't mind ":" etc. Version 1.6 is now available. SortTV now does some illegal character filtering, depending on the platform. (So Linux users can still have ":" in file names, but on Windows the script will remove ":") Cheers, Cliffe. - cliffe - 2010-10-22 lompelurt Wrote:Hi 1. Install Perl (as you have done) 2. Install the Perl modules that SortTV uses: On Windows, open a command prompt (Run->"cmd") Type: Code: cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API Then keep pressing enter until finished. 3. Save the SortTV files somewhere. Extract the contents of the .zip file, for example to your home directory. 4. Edit the sorttv.conf file The sorttv.conf file tells SortTV what to do. The lines starting with "#" simply explain things Change the directories, to the ones you want "to-sort" and to "sort-to" For example, change Code: directory-to-sort:/home/cliffe/Files/Downloads/Unsorted Code: directory-to-sort:C:\MyDownloads Since you want to copy rather than move, change the line Code: sort-by:MOVE Code: sort-by:COPY 5. Run the script In the command prompt, get the the directory containing SortTV. Use the "cd" command to change to that directory Then type Code: perl sorttv.pl This will sort your files according to the config file. Alternatively you can tell it to sort from C:\FROM to C:\TO by typing Code: perl sorttv.pl C:\FROM C:\TO 6. Automate Once that is set up you can schedule it to sort every hour Use Windows scheduler and tell it to run "perl [full/path/to/SortTV]sorttv.pl" (where [full/path/to/SortTV] is where you extracted SortTV) |