Posts: 7
Joined: Jan 2013
Reputation:
0
2015-01-09, 03:58
(This post was last modified: 2015-01-20, 05:07 by FoeT.)
I have no perl experience but hacked this which works. Just comment (#) out the code thats currently in place in the "sub update_xbmc {" section and replace it with this.
my $jsonUrl = sprintf("http://127.0.0.1:8080/jsonrpc");
my $jsonReq = "\{\"jsonrpc\"\: \"2.0\", \"method\": \"VideoLibrary.Scan\", \"id\"\: 1\}";
my $http = HTTP::Request->new('POST', $jsonUrl);
$http->header('Content-Type' => 'application/json');
$http->content($jsonReq);
# Fire off the request.
my $ua = LWP::UserAgent->new;
my $res = $ua->request($http);
die "Couldn't post request" unless defined $res;
# Return the HTTP status and exit.
printf("Library Updated: %s\n", $res->status_line);
#print $res;
my $jsonUrl2 = sprintf("http://127.0.0.1:8080/jsonrpc");
my $jsonReq2 = "{\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"New Shows Available to Watch\",\"message\":\"$new\",\"image\":\"\"},\"displaytime\":10000,\"id\":1}\n";
my $http2 = HTTP::Request->new('POST', $jsonUrl2);
$http2->header('Content-Type' => 'application/json');
$http2->content($jsonReq2);
# Fire off the request.
my $ua2 = LWP::UserAgent->new;
my $res2 = $ua2->request($http2);
die "Couldn't post request" unless defined $res2;
# Return the HTTP status and exit.
printf("Sent message: %s\n", $res2->status_line);
#print $res;
Posts: 5
Joined: Jul 2014
(2010-06-20, 09:59)cliffe Wrote: ~~~~~~
---
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
Hi Cliffe,
Just wanted to suggest a small change to the README info for automation, after installing the perl modules, for cron to work properly, the correct full path for perl needs to be specified.
For me, this was: "/usr/local/bin/perl"
not just "perl" or "/usr/bin/perl", otherwise cron doesn't have access to the modules, in particular, the TVDB one, for which perl 5.2 was installed with cpan
This might save some others a bit of time.
Posts: 531
Joined: Jan 2015
Reputation:
8
Just used the latest version on Windows.
Works well but it missed a lot of files.
Examples of file names and folder names it missed are:
Lo (2009)/Lo DVDrip (2009).avi
I.Am.Nancy.2010.720p.BluRay.x264/ly-iamnancy720.mkv
and files
PSYCHO.III.1986.DVDRip.WS.XviD.avi
Romeos.2011.DVDRip.XviD.avi
Posts: 4
Joined: Mar 2011
Reputation:
0
Quick question... has anyone else noticed problems sorting show names that start with numbers ie: 12 Monkeys. The script does not seem to be able to parse the title properly and ends up searching for "" on TVDB. This ends up causing an error to be thrown in the perl TVDB api. Here is the actual error:
Can't use string ("") as a HASH ref while "strict refs" in use at /usr/local/share/perl/5.14.2/TVDB/API.pm line 472.
Posts: 2
Joined: Aug 2010
Reputation:
0
is it possible to add an option to convert season numbers for shows that are listed on TVDB by year.
Paws Stars is what im currently having problems with. The files are listed as S12 but TVDB list them by year. If i rename the file so S2015 they sort correctly.
Posts: 15
Joined: Nov 2009
Reputation:
0
2015-01-25, 17:35
(This post was last modified: 2015-01-25, 17:40 by magnumk.)
I've been having this issue for years and I can't find any solution to it.
SortTv won't sort shows that starts with the letter S, and give the wrong name for shows that contains it.
If a show for an example is called "Man Seeking Woman", SortTv will handle this as if the show is called "Man" and sort the files in to the folder "Man".
And for example Suits, it will ignore it and leave these files untouched...
For shows with the letter S in it i use the "show-name-substitute", this works for the most (even if it is annoying)
Example for shows with letter S in the name:
show-name-substitute=The Leftover-->The Leftovers
show-name-substitute=Intruder-->Intruders
show-name-substitute=The Mentali-->The Mentalist
show-name-substitute=Bo-->Bosch
show-name-substitute=12 Monkey-->12 Monkeys
show-name-substitute=Back-->Backstrom
show-name-substitute=Man-->Man Seeking Woman
Any thoughts?
Posts: 7
Joined: Mar 2012
Reputation:
0
2015-02-10, 20:23
(This post was last modified: 2015-02-10, 20:53 by Toddmc.)
I'm having trouble getting sorttv to work correctly. It used to sort everything fine but some time last year it started hanging.
The script would freeze up, take a bunch of cpu time, and never finish. Sometimes it would work, sometimes not. Turns out the problem is TV shows. It sorts movies, music, and misc fine if I turn off the tv show option. Unfortunately my main use for it is sorting TV episodes. Fiddling around a little more it's not every TV show episode, sometimes it will sort a couple and then hit one it can't handle and hang. Using verbose it hangs at the step INFO: Fetching episode title for whatever. If I set --rename-episodes=FALSE then the script does not hang, but of course the episode titles are not consistent. Which seems like it could cause problems.
The problem does not seem to be file names, permissions, or formats. It just doesn't seem to like certain episodes. Mythbusters almost always hangs it.
So any thoughts on why this is happening and how I could fix it? Is my TVDB not installed correctly, or perhaps a bug in the script or the wrong version of perl? I'm using perl 5.20.1.
Edit: It also doesn't like if an archer episode leaves out the 2009, maybe it's checking the wrong show.
Edit 2: Taking EP_NAME out of rename-tv-format also works.
Posts: 19,982
Joined: May 2009
Reputation:
451
nickr
Retired Team-Kodi Member
Posts: 19,982
thetvdb does have its downtime quite frequently.
Archer is a different series to Archer (2009).
Have you tried filebot? I haven't used sort tv, but I know filebot is great.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Posts: 19,982
Joined: May 2009
Reputation:
451
nickr
Retired Team-Kodi Member
Posts: 19,982
filebot is very easy, and IMHO worth the effort.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)