2010-06-20, 09:59
~~~~~~
SortTV
~~~~~~
Automatically sorts TV show episodes, movies, and music into an organised directory structure.
For example, TV/[Show Name]/[Season X]/[Show Name - SXXEXX - Episode Name]
SortTV works on Linux, Windows, and Mac OS X.
- Automatically sorts your media, so you don't have to.
- Intelligently understands lots of different file naming schemes.
- Many renaming options, so you can have your files organised just the way you like.
- Can optionally rename episodes and movies using information from thetvdb and tmdb.
- Image downloading for movies and TV shows, seasons, and episodes.
- Extract compressed files such as .rar or .zip.
- Sort by move, copy, symlink, or hardlink.
- Integration with xbmc (notification and library update).
- Many many other options (see below / the README file).
SortTV provides the magic required to have your home theatre PC (HTPC) keep itself sorted out.
You can combine this script with an automatic episode downloader (there are many available*),
and this script runs in the background, sorting all of your new episodes, renaming them appropriately if you like.
Then, if you use xbmc as a front end, it can tell xbmc to check for the new episodes and
display a message to anyone viewing, that new episodes are available.
All you will have to do is sit back and enjoy.
* Episodes of many openly licensed shows are available, and episodes can be downloaded using
RSS feeds, torrent downloaders, file hosting site downloaders etc.
SortTV development has been driven by suggestions and code submissions. Thanks!
---
Copyright 2010 Z. Cliffe Schreuders
z.cliffe {at} schreuders.org
http://schreuders.org
Get SortTV here:
https://sourceforge.net/projects/sorttv/files/
Please discuss SortTV here on the xbmc forum:
http://forum.xbmc.org/showthread.php?t=75949
Paypal donations:
http://sourceforge.net/donate/index.php?group_id=330009
---
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
---
Install
Make sure you have Perl installed.
If you are using Windows I recommend Strawberry Perl. Linux and Mac OS X often have Perl already installed.
On Mac OS X you may need to install the CLI developer tools.
Extract the SortTV script (sorttv.pl etc) wherever you like.
For example, on Linux into /home/[yourusername]/sorttv/
Edit the sorttv.conf file to the settings you want (at minimum specify the location of the directories to sort from and to)
Install the modules the script uses.
To do so, run this command on Linux or Mac OS X:
sudo cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API Getopt::Long Switch WWW::TheMovieDB::Search XML::Simple
On Windows run the same command, without "sudo"
---
Automation
If you want to make it sort new episodes every hour:
On Linux:
In a console type: crontab -e
On a new line enter "5 * * * * " followed by the command to run the script.
This will run the script 5 mins past every hour.
Eg:
5 * * * * nice perl /home/cliffe/sorttv/sorttv.pl
Every hour this would sort new episodes according to the configuration in /home/cliffe/sorttv/sorttv.conf
On Windows:
Create a .bat file with the command and use scheduler.
Google is your friend.
---
USAGE:
sorttv.pl [OPTIONS] [directory-to-sort directory-to-sort-into]
By default SortTV tries to read the configuration from sorttv.conf
(an example config file is provided with SortTV)
The simplest way to use SortTV is to edit the example config file, then just run "perl sorttv.pl" to do the sorting
You can overwrite any config options with commandline arguments, which match the format of the config file (except that each argument starts with "--")
OPTIONS:
There are now too many options to fit them in one forum post
Please refer to the README document, which describes them all in detail
http://sourceforge.net/projects/sorttv/files//README/
EXAMPLES:
Does a sort, as configured in sorttv.conf:
perl sorttv.pl
The directory-to-sort and directory-to-sort-to can be supplied directly:
To sort a Downloads directory contents into a TV directory
perl sorttv.pl /home/me/Downloads /home/me/Videos/TV
Alternatively:
perl sorttv.pl --directory-to-sort=/home/me/Downloads --directory-to-sort-into=/home/me/Videos/TV
To move non-episode files in a separate directory:
perl sorttv.pl --directory-to-sort=/home/me/Downloads --directory-to-sort-into=/home/me/Videos/TV --non-episode-dir=/home/me/Videos/Non-episodes
To integrate with xbmc (notification and automatic library update):
perl sorttv.pl --directory-to-sort=/home/me/Downloads --directory-to-sort-into=/home/me/Videos/TV --xbmc-webserver=localhost:8080
And so on...
---
Frequently Asked Queries
Q: SortTV wont run, it gives an error indicating that modules are missing (cant find a .pm file)
A: Make sure you followed the instructions on installing the cpan modules. If that doesn't work, see below.
Q: I am having trouble installing the cpan modules...
A: If they are not passing the tests, you can force cpan to install them anyway. Run sudo cpan, then type "force install Switch", where Switch is the name of the module you are trying to install.
Q: Why doesn't SortTV download images for TV shows/episodes on Windows?
A: This is currently a limitation in the TVDB::API cpan module. The images should download fine for movies, or if you use SortTV on Linux all images should download correctly. Images downloaded by the module on Windows are corrupted, therefore this features is now automatically disabled for Windows users. Feel free to discuss this problem with the creator of the module.
Q: How do I submit code?
A: For simple patches, I suggest you make your changes in a copy, and create a patch using the command: "diff -ur dir1 dir2 > patch", where dir1 is a directory containing the latest release of SortTV, and dir2 is your-new-version. This creates a file named "patch" containing just your changes. Send "patch" via an email or via the forum. Alternatively, if you wish you can use Git. Find repo information on the SortTV sourceforge page.
Q: How can I say thank you / make a donation?
A: I am really glad you have found SortTV useful! Pop by the forum and say hello, or make a donation via Paypal here: http://sourceforge.net/donate/index.php?group_id=330009 If you would rather donate via Bitcoin let me know and I'll give you details.
Q: Something else...
A: Please discuss the issue on the forum
---
Enjoy!
Paypal donations welcome:
http://sourceforge.net/donate/index.php?group_id=330009
If you find this script helpful then please consider making a $5 paypal donation
SortTV
~~~~~~
Automatically sorts TV show episodes, movies, and music into an organised directory structure.
For example, TV/[Show Name]/[Season X]/[Show Name - SXXEXX - Episode Name]
SortTV works on Linux, Windows, and Mac OS X.
- Automatically sorts your media, so you don't have to.
- Intelligently understands lots of different file naming schemes.
- Many renaming options, so you can have your files organised just the way you like.
- Can optionally rename episodes and movies using information from thetvdb and tmdb.
- Image downloading for movies and TV shows, seasons, and episodes.
- Extract compressed files such as .rar or .zip.
- Sort by move, copy, symlink, or hardlink.
- Integration with xbmc (notification and library update).
- Many many other options (see below / the README file).
SortTV provides the magic required to have your home theatre PC (HTPC) keep itself sorted out.
You can combine this script with an automatic episode downloader (there are many available*),
and this script runs in the background, sorting all of your new episodes, renaming them appropriately if you like.
Then, if you use xbmc as a front end, it can tell xbmc to check for the new episodes and
display a message to anyone viewing, that new episodes are available.
All you will have to do is sit back and enjoy.
* Episodes of many openly licensed shows are available, and episodes can be downloaded using
RSS feeds, torrent downloaders, file hosting site downloaders etc.
SortTV development has been driven by suggestions and code submissions. Thanks!
---
Copyright 2010 Z. Cliffe Schreuders
z.cliffe {at} schreuders.org
http://schreuders.org
Get SortTV here:
https://sourceforge.net/projects/sorttv/files/
Please discuss SortTV here on the xbmc forum:
http://forum.xbmc.org/showthread.php?t=75949
Paypal donations:
http://sourceforge.net/donate/index.php?group_id=330009
---
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
---
Install
Make sure you have Perl installed.
If you are using Windows I recommend Strawberry Perl. Linux and Mac OS X often have Perl already installed.
On Mac OS X you may need to install the CLI developer tools.
Extract the SortTV script (sorttv.pl etc) wherever you like.
For example, on Linux into /home/[yourusername]/sorttv/
Edit the sorttv.conf file to the settings you want (at minimum specify the location of the directories to sort from and to)
Install the modules the script uses.
To do so, run this command on Linux or Mac OS X:
sudo cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API Getopt::Long Switch WWW::TheMovieDB::Search XML::Simple
On Windows run the same command, without "sudo"
---
Automation
If you want to make it sort new episodes every hour:
On Linux:
In a console type: crontab -e
On a new line enter "5 * * * * " followed by the command to run the script.
This will run the script 5 mins past every hour.
Eg:
5 * * * * nice perl /home/cliffe/sorttv/sorttv.pl
Every hour this would sort new episodes according to the configuration in /home/cliffe/sorttv/sorttv.conf
On Windows:
Create a .bat file with the command and use scheduler.
Google is your friend.
---
USAGE:
sorttv.pl [OPTIONS] [directory-to-sort directory-to-sort-into]
By default SortTV tries to read the configuration from sorttv.conf
(an example config file is provided with SortTV)
The simplest way to use SortTV is to edit the example config file, then just run "perl sorttv.pl" to do the sorting
You can overwrite any config options with commandline arguments, which match the format of the config file (except that each argument starts with "--")
OPTIONS:
There are now too many options to fit them in one forum post
Please refer to the README document, which describes them all in detail
http://sourceforge.net/projects/sorttv/files//README/
EXAMPLES:
Does a sort, as configured in sorttv.conf:
perl sorttv.pl
The directory-to-sort and directory-to-sort-to can be supplied directly:
To sort a Downloads directory contents into a TV directory
perl sorttv.pl /home/me/Downloads /home/me/Videos/TV
Alternatively:
perl sorttv.pl --directory-to-sort=/home/me/Downloads --directory-to-sort-into=/home/me/Videos/TV
To move non-episode files in a separate directory:
perl sorttv.pl --directory-to-sort=/home/me/Downloads --directory-to-sort-into=/home/me/Videos/TV --non-episode-dir=/home/me/Videos/Non-episodes
To integrate with xbmc (notification and automatic library update):
perl sorttv.pl --directory-to-sort=/home/me/Downloads --directory-to-sort-into=/home/me/Videos/TV --xbmc-webserver=localhost:8080
And so on...
---
Frequently Asked Queries
Q: SortTV wont run, it gives an error indicating that modules are missing (cant find a .pm file)
A: Make sure you followed the instructions on installing the cpan modules. If that doesn't work, see below.
Q: I am having trouble installing the cpan modules...
A: If they are not passing the tests, you can force cpan to install them anyway. Run sudo cpan, then type "force install Switch", where Switch is the name of the module you are trying to install.
Q: Why doesn't SortTV download images for TV shows/episodes on Windows?
A: This is currently a limitation in the TVDB::API cpan module. The images should download fine for movies, or if you use SortTV on Linux all images should download correctly. Images downloaded by the module on Windows are corrupted, therefore this features is now automatically disabled for Windows users. Feel free to discuss this problem with the creator of the module.
Q: How do I submit code?
A: For simple patches, I suggest you make your changes in a copy, and create a patch using the command: "diff -ur dir1 dir2 > patch", where dir1 is a directory containing the latest release of SortTV, and dir2 is your-new-version. This creates a file named "patch" containing just your changes. Send "patch" via an email or via the forum. Alternatively, if you wish you can use Git. Find repo information on the SortTV sourceforge page.
Q: How can I say thank you / make a donation?
A: I am really glad you have found SortTV useful! Pop by the forum and say hello, or make a donation via Paypal here: http://sourceforge.net/donate/index.php?group_id=330009 If you would rather donate via Bitcoin let me know and I'll give you details.
Q: Something else...
A: Please discuss the issue on the forum
---
Enjoy!
Paypal donations welcome:
http://sourceforge.net/donate/index.php?group_id=330009
If you find this script helpful then please consider making a $5 paypal donation