XBMC Community Forum
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)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43


- cliffe - 2010-09-03 18:07

davemex Wrote:Thanks for the update! I updated the file on my server and so far it appears to be working correctly. I really appreciate all the work you've put into this project as it really puts a nice shinny coat on my whole media acquisition/management setup!

Thanks again for the feedback. I am glad people are finding this helpful!

I would much rather spend the time making it automated than spend the time organising files Smile


- salithus - 2010-09-04 03:40

I ran into some issues with seasons higher than 9, so I made some modifications to zero-pad the season. Also, added some trimming to handle apostrophes and parentheses in show names.

http://pastebin.com/diff.php?i=FqshYC1w

Thanks for the excellent tool! It managed to parse 2500 of my files in a matter of seconds Smile


- cliffe - 2010-09-04 06:39

salithus Wrote:I ran into some issues with seasons higher than 9, so I made some modifications to zero-pad the season. Also, added some trimming to handle apostrophes and parentheses in show names.

http://pastebin.com/diff.php?i=FqshYC1w

Thanks for the patch! I have applied it to the git repo, and uploaded a new version of SortTV which includes your changes. I added a comment with your username, if you want your real name used let me know.

salithus Wrote:Thanks for the excellent tool! It managed to parse 2500 of my files in a matter of seconds Smile

Cool! I hadn't tried it on a very large number of files at once, so that is great to know.


- cliffe - 2010-09-04 06:47

cliffe Wrote:The new pattern matching is quite liberal. I pretty much only use it to sort episodes so I haven't had that problem. The movie title that was moved was probably followed by two numbers, which the script interpreted as season and episode numbers.

I added an optional "--conservative" flag that will make SortTV be less liberal with the episode pattern matching. Until I change the way arguments are processed, you can currently only use it as the 5th argument.

eg:
perl $HOME/sorttv/sorttv.pl $HOME/Downloads/ $HOME/TV $HOME/Non-episodes localhost:8080 --conservative


- megacrypto - 2010-09-15 22:04

is there a way for the script when adding a new folder to add "." instead of spaces?


- nitrag - 2010-10-07 01:41

cliffe,

glad to see you continuing to update this project. I was going to suggest a bug (which took me a while to notice) about the season 9+ issue but it looks like you've already patched it!

Good work and thank you!


New version available - cliffe - 2010-10-07 11:08

Hi everyone,

I have made some major improvements to SortTV, including
  • a config file to simplify configuration and use of the program
  • optional renaming of episode files to a "Show name S01E01.avi" type format (friendly to xbmc)
  • optional renaming of episode files to replace spaces with dots ("."); for example, converts the above to "Show.name.S01E01.avi"
  • season naming formatting options; Eg, "Series.01" or "Season 1"
  • by default is less liberal with pattern matches, but detects more legitimate episode naming formats, easy to configure it to be liberal, handy if you know all files to be sorted are episodes
  • output options including whether to be verbose, and can write to a log file
  • can specify secondary configuration files

All these features can be used via command line arguments or the configuration file.

By default the script reads sorttv.conf (if available) in the same directory, and any commandline arguments overwrite these settings.

An example config file is provided along with the new sorttv.pl script and README file. I have updated the first post to reflect the new features.

To upgrade, simply download the new script and config and be sure to edit the config file with the setting you want. Then, if you have already scheduled the script to run, edit the command to just "perl /path/to/sorttv.pl

As before, 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 Smile
http://schreuders.org

---

nitrag Wrote:cliffe,
glad to see you continuing to update this project. I was going to suggest a bug (which took me a while to notice) about the season 9+ issue but it looks like you've already patched it!

Good work and thank you!

Cool, thanks for checking, and for thinking about reporting issues. I hope you enjoy the new version.

megacrypto Wrote:is there a way for the script when adding a new folder to add "." instead of spaces?

There is now! Download the new version Smile


- Targettio - 2010-10-07 14:25

Awesome Big Grin


- cliffe - 2010-10-07 15:32

I just made a small update so that when called by cron the script looks in the correct directory for the config file. If you have already downloaded the new version please grab it again. Cheers.


- Capt.Insano - 2010-10-07 17:49

Is it possible to have an option that the Script copies the TV Episodes into the correct folders rather than move them?

My Setup:
rtorrent and rutorrent downloads all my shows through RSS to a folder
Code:
/mnt/DATA/Torrents/Complete/TV

I would like to copy these shows to another location:
Code:
/media/FREECOM/TV Shows/[i][b]Show Name/Season #/Episode Name[/b][/i]

Copy is important so that I can finish seeding the shows.

Would the fact that the script would need to remember what shows it has copied and not copy them again make it too difficult to achieve?

Congrats on the Script either way!!
The Capt


- cliffe - 2010-10-07 18:47

Capt.Insano Wrote:Is it possible to have an option that the Script copies the TV Episodes into the correct folders rather than move them?

My Setup:
rtorrent and rutorrent downloads all my shows through RSS to a folder
Code:
/mnt/DATA/Torrents/Complete/TV

I would like to copy these shows to another location:
Code:
/media/FREECOM/TV Shows/[i][b]Show Name/Season #/Episode Name[/b][/i]

Copy is important so that I can finish seeding the shows.

Would the fact that the script would need to remember what shows it has copied and not copy them again make it too difficult to achieve?

Congrats on the Script either way!!
The Capt

Ok, I added the feature you requested!

Check out the sort-by:[MOVE|COPY] option. Download the new script and config and edit the config to COPY rather than MOVE.

The first post in this thread has been updated with details.

Enjoy!

--

Keep in mind that copying files is a much slower process than moving files.


- Capt.Insano - 2010-10-07 19:01

cliffe Wrote:Ok, I added the feature you requested!

Check out the sort-by:[MOVE|COPY] option. Download the new script and config and edit the config to COPY rather than MOVE.

The first post in this thread has been updated with details.

Enjoy!

--

Keep in mind that copying files is a much slower process than moving files.

Wow, Thanks a Million!

Before I begin using it,

Does the script rename the file before or during the copy?
If the file was renamed before the copy then my torrent client would be still trying to seed the originally named file.

example:
File Downloaded is named: "FamilyGuy.2x01.HDTV.avi" and is being seeded by rtorrent.

Will SortTV rename the file first, then copy the file to "/Family Guy/Season 2/Family Guy S02E01.avi" and leave a file "Family Gut S01E02.avi (which would not continue seeding), or rename during the copy so the original file retains its name?

I hope that just made sense!!

Thanks,
The Capt.


- cliffe - 2010-10-07 19:13

Capt.Insano Wrote:Wow, Thanks a Million!

Before I begin using it,

Does the script rename the file before or during the copy?
If the file was renamed before the copy then my torrent client would be still trying to seed the originally named file.

example:
File Downloaded is named: "FamilyGuy.2x01.HDTV.avi" and is being seeded by rtorrent.

Will SortTV rename the file first, then copy the file to "/Family Guy/Season 2/Family Guy S02E01.avi" and leave a file "Family Gut S01E02.avi (which would not continue seeding), or rename during the copy so the original file retains its name?

I hope that just made sense!!

Thanks,
The Capt.

Using sort-by:COPY, the original file wont be affected at all, so it wont disturb seeding. Smile


- megacrypto - 2010-10-10 14:52

thanks Smile your code is a life saver


- jjrroberts - 2010-10-11 02:19

cliffe Wrote:If you find this script helpful then please consider making a $5 paypal donation Smile
http://schreuders.org

$5 sent, love both the tool and speed of updates/enhancements!

Donation link is here to save others some time, I looked at your home page for the link when i should have gone to sf.net

Edit - And i see you are a fellow aussie, that makes me even more pleased!