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

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 44 45 46 47 48 49


- cliffe - 2011-09-25

sheka Wrote:I have the same issue = Ubuntu Server - Perl version 5.8.8

I get the message

MOVE EPISODE: sorting x/x/x/x --to--> x/x/x/x/x

but it just hangs and doesn't returns....

strange things is that it actually moves the file

Could you please try with "--no-network", and see if that temporarily resolves it. On Windows machines this behaviour has happened when trying to connect to xbmc when it was not accepting connections. Ensure that xbmc is accepting connections or that SortTV is not configured to try to send commands to xbmc.


- sheka - 2011-09-25

cliffe Wrote:Could you please try with "--no-network", and see if that temporarily resolves it. On Windows machines this behaviour has happened when trying to connect to xbmc when it was not accepting connections. Ensure that xbmc is accepting connections or that SortTV is not configured to try to send commands to xbmc.

That seems to fix it....

problem now though is that the rename function doesn't happen as obviously with no network it can't check for episode titles.....

is there a way to perform the lookup, rename and then turn the network off for the move?


- cliffe - 2011-09-26

sheka Wrote:That seems to fix it....

problem now though is that the rename function doesn't happen as obviously with no network it can't check for episode titles.....

is there a way to perform the lookup, rename and then turn the network off for the move?

Ok great, now that we have narrowed it down, try editing your config so that the two xbmc connection options are disabled.


- sheka - 2011-09-26

cliffe Wrote:Ok great, now that we have narrowed it down, try editing your config so that the two xbmc connection options are disabled.

If I run the script with --rename-media=FALSE then the script hangs when I get the message as mentioned previously - when moving the file....but after it has actually moved the file - if you know what I mean.

If I run it with --rename-media=TRUE (default action) - Then it hangs after:

INFO: Fetching episode title for xxxxxxxxxx Season x Episode X


- sheka - 2011-09-26

The two XBMC options are commented out - I don't use the script in that way.


- cliffe - 2011-09-27

sheka Wrote:The two XBMC options are commented out - I don't use the script in that way.

Ok, Another quick suggestion: try disabling image downloads (tv and/or movie).


- sheka - 2011-09-27

cliffe Wrote:Ok, Another quick suggestion: try disabling image downloads (tv and/or movie).

no still hangs....

will try on a later version of Ubuntu / Perl


- snowxbmc - 2011-09-28

Thanks for the great tool cliffe.

I've just started using it and have run into 2 features that I think would be useful as I've been running it against my existing shows. I've briefly looked through this thread and couldn't find mention of them, so I don't think they exist yet.

1. Multi-Episode in file naming - e.g. Some.Show.S01E01.Genesis.HDTV.XviD-FQM.avi contains both Episode 1 and 2 so a better name would be Some.Show.S01E01E02.Genesis.avi
Not sure how you work that out though? Sometimes the original file names do have indicators that they are multi-episode.

2. Quality in file name - it would be great to optionally be able to store the quality of the file in the name for both video and audio (i.e SD, HD, 720p, 1080p; MP3, AC3, DTS, etc.). Is there a library that could extract that info from a file?


- fush - 2011-10-01

Hi Cliffe

I've just updated to your latest script and gave the Movie sorting a test.

1. Can the sort handle having "CD1" or "CD2" in the file name? So far my tests haven't been able to match any movie files with CD1 or CD2 in the name? Or could I be doing something wrong?

2. Movie Renaming, I have force-windows-compatible-filenames=TRUE in the config file yet it still seems to like to add ":" into the names of some films, the files works fine in Linux but if I open the folder on my windows machine, its just a bunch of random letters/numbers, and I can't edit unless I am in Linux. Maybe if support windows naming is on, we can replace them with "-" or "."?

3. Renaming doesn't add the year it was made? the date is only added/kept if it already existed on the filename?

Otherwise its an awesome tool dude. I massively appreciate what you've done and your ability to keep on working on it.

almost forgot, is there a way I could output just a list of sorted episodes/movies to a file? I have most of my download/sorting automated and I use Prowl to send me notifications of when files have been added for download/finished downloading/etc and I have one that just tells me that sortTv has run, but it would be cool if I could feed it a list from file of which shows have successfully been sorted so I can see that info in the notification

Regards

Andrew


- cliffe - 2011-10-01

sheka Wrote:no still hangs....

will try on a later version of Ubuntu / Perl

Damn. Ok, as a matter of elimination, could you please try each of these:
--fetch-show-title=FALSE
--rename-episodes=FALSE


- cliffe - 2011-10-01

snowxbmc Wrote:Thanks for the great tool cliffe.

I've just started using it and have run into 2 features that I think would be useful as I've been running it against my existing shows. I've briefly looked through this thread and couldn't find mention of them, so I don't think they exist yet.

1. Multi-Episode in file naming - e.g. Some.Show.S01E01.Genesis.HDTV.XviD-FQM.avi contains both Episode 1 and 2 so a better name would be Some.Show.S01E01E02.Genesis.avi
Not sure how you work that out though? Sometimes the original file names do have indicators that they are multi-episode.

Yes. I have known about that limitation for a long time. I agree, it would be better to do that. Possible solutions have been discussed in here on the forum.

snowxbmc Wrote:2. Quality in file name - it would be great to optionally be able to store the quality of the file in the name for both video and audio (i.e SD, HD, 720p, 1080p; MP3, AC3, DTS, etc.). Is there a library that could extract that info from a file?

Probably the easiest way of extracting that information would just be a regexp that picks out any of those terms. Then store that in a variable, and add it as an optional naming format string (eg "[QUALITY]").

I strongly urge you to itch that scratch and write some code Smile It has been a while since others have contributed code (thanks to all of you that have!). Perl is fun.

Thanks.


- cliffe - 2011-10-01

fush Wrote:Hi Cliffe

I've just updated to your latest script and gave the Movie sorting a test.

1. Can the sort handle having "CD1" or "CD2" in the file name? So far my tests haven't been able to match any movie files with CD1 or CD2 in the name? Or could I be doing something wrong?

Not currently. The same problem exists with "part 1" in episode files. We discussed solutions. Hopefully that can make its way into the script soon. Thanks for pointing it out.

fush Wrote:2. Movie Renaming, I have force-windows-compatible-filenames=TRUE in the config file yet it still seems to like to add ":" into the names of some films, the files works fine in Linux but if I open the folder on my windows machine, its just a bunch of random letters/numbers, and I can't edit unless I am in Linux. Maybe if support windows naming is on, we can replace them with "-" or "."?

Ahh, thanks, I guess the Windows compatibility function isn't currently called on the movie renaming.

fush Wrote:3. Renaming doesn't add the year it was made? the date is only added/kept if it already existed on the filename?

That was somewhat intentional, but perhaps the better solution would be to use the year that was returned by tmdb in match_and_sort_movie(). Sounds like a good idea.

If you feel like coding any of your suggestions above then please give it a go Smile

fush Wrote:Otherwise its an awesome tool dude. I massively appreciate what you've done and your ability to keep on working on it.

almost forgot, is there a way I could output just a list of sorted episodes/movies to a file? I have most of my download/sorting automated and I use Prowl to send me notifications of when files have been added for download/finished downloading/etc and I have one that just tells me that sortTv has run, but it would be cool if I could feed it a list from file of which shows have successfully been sorted so I can see that info in the notification

Regards

Andrew

All the moves are logged to sorttv.log. You could remove the log file before running SortTV, then just see it there is anything in the log.

For example, assuming Linux\Mac, you could write a bash script to only tell you when files have actually been sorted like this:

Code:
if grep '\-->' sorttv.log
then
  #Prowl stuff
fi
And to get the file names that were sorted:
Code:
grep '\-->' sorttv.log | grep -o '[^/]*$'



LibXML Problem - spazlon - 2011-10-05

Hi,

I finally got around to trying the script, but after I installed it and ran the script I got the following error:

Can't load 'C:/strawberry/perl/vendor/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML: load_file:The specified module could not be found at C:/strawberry/perl/lib/DynaLoader.pm line 200.

So I tried to install LibXML through CPAN again and it gives me this error:

http://pastebin.com/VCL6L7EU

How can I fix the LibXML error in Perl?

Thanks!


- cliffe - 2011-10-06

spazlon Wrote:Hi,

I finally got around to trying the script, but after I installed it and ran the script I got the following error:

Can't load 'C:/strawberry/perl/vendor/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML: load_file:The specified module could not be found at C:/strawberry/perl/lib/DynaLoader.pm line 200.

So I tried to install LibXML through CPAN again and it gives me this error:

http://pastebin.com/VCL6L7EU

How can I fix the LibXML error in Perl?

Thanks!

Make sure you followed the install instructions in the readme:
Quote:Install the modules the script uses.
To do so, run this command on Linux:
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"



- Headcase_Fargon - 2011-10-13

Been using SortTV for a while now and for the most part it works great. Something I've noticed recently though as a lot of people are RARing their content...

Say an episode is split into 50 RAR parts. The first part finishes but the rest of the parts of the file are still downloading and thus labeled .part. SortTV is extracting that first RAR so I end up with a 1 minute show in my library.

Would it be possible to get an option to have the script check for any .part files in the folder and not extract until there are none?