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


RE: SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux - colt082295 - 2013-03-12

For some reason I keep getting these warnings, and it doesn't matter what I set the directories to.
Code:
WARN: directory does not exist (/mnt/downloads/downloads/
)
WARN: directory does not exist (/mnt/downloads/SamsungRecovery/SamsungData/DataBackup#(2012-12-03.162653)/D Drive/Torrents/Finished/TV Shows
)
WARN: directory does not exist (/mnt/downloads/SamsungRecovery/SamsungData/DataBackup#(2012-12-03.162653)/D Drive/Torrents/Finished/Movies
)
Value "0
" invalid for option sort-only-older-than-days (number expected)
Value "1
" invalid for option year-tolerance-for-error (number expected)
WARN: directory does not exist (/mnt/downloads/SamsungRecovery/SamsungData/DataBackup)
Incorrect usage or configuration (missing sort or sort-to directories)



RE: .rar on OSX - aestridge - 2013-04-04

(2013-03-09, 10:45)Vaneshi Wrote:
(2013-02-25, 03:16)aestridge Wrote: I'm having a real problem getting the script to extract .rar files on OSX. Says there is an error and cannot find 7zip etc. I've tried a bunch of different extracting applications.. no luck. I've updated perl, and done whatever i could based on the other posts in this thread. Anyone else having this problem? Help!

The script won't/can't make use of any .app's you've installed. You need to find the command-line versions of those files and shove them in say /usr/bin (or somewhere on your PATH statement that sorttv.pl can find).


ah, that took care of it. Thanks!

Now, anyone else having trouble with SortTv not sorting SportsCenter? Like.. it doesn't see it at all.


Unicode problems - john.doe - 2013-04-05

Hi...great script! But there are still Unicode problems (problems with characters with diacritics).

For example I have the movie Pelíšky (http://www.themoviedb.org/movie/15387-pel-ky) and the script can't handle it.

Thanks for looking into this.


RE: SortTV - TechLife - 2013-04-13

I still can't express how much I love this script. Probably time for another donation. ;-) Keep up the great work Cliffe!

Now that I have you buttered up...I have one minor issue since upgrading to Frodo (this morning, finally). The auto-update feature isn't working anymore. The files are moved and renamed properly, but XBMC isn't receiving the update command.
Code:
WARN: Could not connect to xbmc server: Invalid argument

I am on 1.34. Control from another PC is enabled. I have verified the username and password in sorttv.conf matches what is in xbmc. The ip is correct. Control is allowed on port 80. I haven't updated my sorttv.conf file since updating to 1.34. I am still using the one I had with 1.32.

sorttv.conf:
Code:
# OPTIONAL - host for the new xbmc communication, to automatically update library when media arrives
# You probably want to set this to "localhost"
xbmc-remote-control=xbmc:[email protected]:80

What did I miss??

Sorry if this has already been covered. I've been out of the game for a while and don't currently have much (if any) free time to play.


SortTV: episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - newphreak - 2013-04-14

I'm not sure if this was solved in later version, but initially jsonrpc didn't work, so i have just worked around it with xbmcoldserver.

Line326:
Code:
get "http://$xbmcoldwebserver/xbmcCmds/xbmcHttp?command=ExecBuiltIn(updatelibrary(video))";
with:
Code:
get "http://$xbmcoldwebserver/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22id%22:0,%22method%22:%22VideoLibrary.Scan%22}";

And for the textbox with episode info:
Line328:
Code:
get "http://$xbmcoldwebserver/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(,NEW EPISODES NOW AVAILABLE TO WATCH\n$newshows, 7000))";
with:
Code:
get "http://192.168.1.5/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22id%22:0,%22method%22:%22GUI.ShowNotification%22,%22params%22:{%22message%22:%22$newshows%22,%22title%22:%22New%20Episodes%22}}";



RE: SortTV - TechLife - 2013-04-14

Thanks for the info.

I got the json to work. If I understood what I read correctly, xbmc listens on port 9090 anyway which is hard coded in the script and there isn't a password requirement. So all you need is:
Code:
# OPTIONAL - host for the new xbmc communication, to automatically update library when media arrives
# You probably want to set this to "localhost"
xbmc-remote-control=10.0.1.124

The notification isn't working though...I'll keep playing.


RE: SortTV - TechLife - 2013-04-15

OK. Got it working using JSON. Only took me all day because I don't know *anything* about perl. LOL

If you want notifications, insert the following at line 369:
Code:
print $sock "{\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"New Shows Available to Watch\",\"message\":\"$new\",\"image\":\"\"},\"displaytime\":10000,\"id\":1}\n";

so that it looks like this:
Code:
print $sock '{"jsonrpc": "2.0", "method": "VideoLibrary.ScanForContent", "id": 1}\n';
print $sock "{\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"New Shows Available to Watch\",\"message\":\"$new\",\"image\":\"\"},\"displaytime\":10000,\"id\":1}\n";
close($sock);

I'd like to add an option in the .conf file to choose if you want notifications or not. I may also consider offering an optional output format so instead of it displaying "Family Guy S11E17" you would see something like "Family Guy Ep. 17 - Bigfat". I'll keep working on it, but for now, this will get you by. Wink


question/feature request - aestridge - 2013-04-19

A question and a feature request:

How does SortTv deal with daily episodes? I can't seem to get it to sort SportsCenter, which is labeled by date instead of episode. (I can't seem to get XBMC to recognize it either if anyone has ideas on that)

Also, when i add a file that already exists, would it be possible to keep the larger file and overwrite the smaller? For example, if I have a 720p show, and accidentally add a 420p show, right now it overwrites it. I'd like it to always keep the higher quality show.

Thanks for the awesome script!


RE: SortTV - TechLife - 2013-04-20

By default, they both look to thetvdb.com for info. If it isn't found there, they can't do anything with it. In XBMC, you can add additional scrapers. The trick would be finding one that scrapes a database that has the info for SportsCenter. The only fix for SortTV would be to add that db (assuming you could find one) as an additional lookup location which isn't as easy as it may seem...


Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac) - aestridge - 2013-04-20

thetvdb.com has a SportsCenter show page: http://thetvdb.com/?tab=series&id=77967&lid=7

It doesn't show episodes because it's a daily show.


RE: SortTV - TechLife - 2013-04-20

And that is the issue. There are no entries for the scrapers to pull data from.


ah - aestridge - 2013-04-21

ah, i see. SportsCenter doesn't appear to be on any scrapers i can find, and i suppose even if SortTv could sort it, XBMC wouldn't recognize it. Thanks for the info.


Error running on Raspberry Pi - azzamunza - 2013-05-07

Hi Guys,

I'm using SortTV on my Raspberry Pi on an Xbian image.
I have managed to install it and everything that it needs (as far as I can tell) and I can now run it.
However I'm getting errors saying directory does not exist.
I'm kinda thinking this must be a simple issue but I can't work it out.

This is my output when I run SortTV

Code:
SortTV
~~~~~~
)ARN: directory does not exist (/portal/Sort
)ARN: directory does not exist (/portal/00_TV
)ARN: directory does not exist (/portal/00_Movies
" invalid for option sort-only-older-than-days (number expected)
" invalid for option year-tolerance-for-error (number expected)
Incorrect usage or configuration (missing sort or sort-to directories)
run 'perl sorttv.pl --help' for more information about how to use SortTV

Directories are definitely there. Running SortTV from /portal/sorrtv
Would be very grateful if someone can help or even point me in the right location.

Aaron


RE: SortTV: Sort TV episodes - pjobson - 2013-05-16

Hey all..

I'm the author of WWW::TheMovieDB::Search

I'm starting a rewrite of the source code for The Movie Database API version 3.0, the 2.1 API will be deprecated in September 15, 2013. The XMBC SortTV community is probably the only people using my code, just wanted to drop you a line letting you know what's going on.


RE: SortTV: Sort TV episodes - cliffe - 2013-05-18

(2013-05-16, 06:57)pjobson Wrote: Hey all..

I'm the author of WWW::TheMovieDB::Search

I'm starting a rewrite of the source code for The Movie Database API version 3.0, the 2.1 API will be deprecated in September 15, 2013. The XMBC SortTV community is probably the only people using my code, just wanted to drop you a line letting you know what's going on.

Great, thanks Paul! I look forward to it. If you have time, feel free to integrate your updated module with SortTV while you are at it Smile

Thanks providing the module! It helps SortTV to provide sorting of movie files.

I will follow your module update with a new release of SortTV at some point. It has been a while (and over 3,000 downloads) since the previous SortTV release. I have been busy working on other projects, but thankfully (other than in some fringe cases) SortTV has proven to be quite a robust script, and for the most part happily hums away in the background automatically sorting new files.

If anyone has any code patches you want included in the next release then please post them here. I prefer patches generated with "diff -u", but if your changes are clear (and make sense) I will try to include it. Also I am interested in including TV show name substitutions and so on that you have found helpful. If anyone has added regex for other file naming patterns, then also please let me know. If you have already posted changes to the forum since the last release I will hopefully pick those patches up.

Cheers,

Cliffe.

(2013-04-15, 02:40)TechLife Wrote: OK. Got it working using JSON. Only took me all day because I don't know *anything* about perl. LOL

If you want notifications, insert the following at line 369:
Code:
print $sock "{\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"New Shows Available to Watch\",\"message\":\"$new\",\"image\":\"\"},\"displaytime\":10000,\"id\":1}\n";

so that it looks like this:
Code:
print $sock '{"jsonrpc": "2.0", "method": "VideoLibrary.ScanForContent", "id": 1}\n';
print $sock "{\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"New Shows Available to Watch\",\"message\":\"$new\",\"image\":\"\"},\"displaytime\":10000,\"id\":1}\n";
close($sock);

I'd like to add an option in the .conf file to choose if you want notifications or not. I may also consider offering an optional output format so instead of it displaying "Family Guy S11E17" you would see something like "Family Guy Ep. 17 - Bigfat". I'll keep working on it, but for now, this will get you by. Wink

Great! Thanks for the update to the notification code. Further configuration options sounds good Smile