•  Previous
  • 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
  • 48
  • Next 
 
Thread Rating:
  • 8 Vote(s) - 4.88 Average
SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac)
Thanks cliffe,

My mistake for the part I am working on is I need to use the remdot sub not fixtitle sub. I can't believe I missed that. Also thanks for the update, I am perl regex challenged, I just didn't see it.
Reply
Capt.Insano Wrote:XBMC has "allow control of xbmc via HTTP" enabled and when I use the above URL on another computer on the same network (changing user and pass, and localhost to correct IP address) I get the Correct "Test Test" Pop Up. But SortTV still does not start XBMC Library Update.

SortTV has the correct info:
Code:
xbmc-web-server:user:[email protected]:8080

I could not open a browser and run above URL on the same machine as XBMC as I use a Minimal XBMC Set-Up and have no Browser on the box.

Any further advice?

Thanks
The Capt.

EDIT:
Found out I could use PHP to request a URL through the commandline so I used
Code:
php -r "file('http://[i]USER:PASS[/i]@localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn%28Notification%28test,test,%207000%29%29');"

and I got the required test test PopUp, So I know that xbmc is set up correctly and there is no reason why a localhost request to port 8080 should not work, yet XBMC still will not update on using SortTV.

If the script is running on the same machine try "localhost" rather than the IP address (if that isn't what you are already doing).

If that doesn't help, you could try copying just the xbmc update line from sorttv.pl into a test.pl and try running it to test Perl sending the request. (hardcode the host and port.)

Let me know how you go.
Reply
Hi cliffe,

I am done the patch now. It passes all my test files except ABC-Showtitle that Malexx reported. Thanks for all your help on this mod and hopefully this will pass your look over.

Here the patch: Patch File
Reply
cliffe Wrote:If the script is running on the same machine try "localhost" rather than the IP address (if that isn't what you are already doing).

If that doesn't help, you could try copying just the xbmc update line from sorttv.pl into a test.pl and try running it to test Perl sending the request. (hardcode the host and port.)

Let me know how you go.

As I wrote in the Edit to my prev post, I ran a localhost version of that URL request from the same machine as the Script + XBMC and successfully caused the test test pop up

Capt.Insano Wrote:EDIT:
Found out I could use PHP to request a URL through the commandline so I used

Code:
php -r "file('http://USER:[email protected]:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn%28Notification%28test,test,%207000%29%29');"

and I got the required test test PopUp, So I know that xbmc is set up correctly and there is no reason why a localhost request to port 8080 should not work, yet XBMC still will not update on using SortTV.

So I don't know why SortTV XBMC Update wont work on my machine. Also I am completely inexperienced in perl so I have no clue whats lines to copy into test.pl as requested above.
Reply
Capt.Insano Wrote:So I don't know why SortTV XBMC Update wont work on my machine. Also I am completely inexperienced in perl so I have no clue whats lines to copy into test.pl as requested above.

Put this in networktest.pl:
Code:
use LWP::Simple;

print "xbmc ok" if get "http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(,Test, 7000))";
print "google ok" if get "http://google.com";
Run with "perl networktest.pl"
Reply
OK, tried networktest.pl and this is what I got:

Situation 1: networktest.pl + XBMC Webserver with no Username + Password;
If I use
Code:
use LWP::Simple;

print "xbmc ok" if get "http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(,Test, 7000))";
print "google ok" if get "http://google.com";

As expected I get correct the correct results (XBMC PopUp and CommandLine "xbmcok googleok").

Situation 2: networktest.pl + Username and Password set for XBMC Webserver

If I set a user + password to the xbmc webserver however I get nothing from XBMC, even if I change networktest.pl to
Code:
use LWP::Simple;

print "xbmc password ok" if get "http://[b]user:[email protected][/b]localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(,Test, 7000))";
print "xbmc ok" if get "http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(,Test, 7000))";
print "google ok" if get "http://google.com";

All I get is "google ok" in commandline. (nothing from XBMC with or without user:pass in networktest.pl)

So I tried XBMC with no Webserver User + Pass and SortTV because it looks like it should work,..

Situation 3 sorttv.pl + XBMC Webserver with no Username + Password;

My sorttv.conf reads as follows
Code:
# ~~~~~
# This config file is optional, but is an easy way to configure SortTV.
# Simply place it in the same directory as SortTV.
# ~~~~~

# ~~~~~
# Directories
# ~~~~~

# The new files to sort
# For example, set this to where completed downloads are stored
directory-to-sort:/mnt/DATA/Torrents/Complete/TV Show/

# Where to sort episodes into (dir that will contain dirs for each show)
# This directory will contain the structure (Show)/(Seasons)/(episodes)
directory-to-sort-into:/media/FREECOM/TV Shows/

# OPTIONAL - where to put things that are not episodes
# If this is supplied then files and directories that SortTV does not believe are episodes will be moved here
# If not specified, non-episodes are not moved
#non-episode-dir:/home/cliffe/Files/Downloads/Non-episodes

# ~~~~~
# Output and xbmc integration
# ~~~~~

# OPTIONAL - host:port for xbmc webserver, to automatically update library when new episodes arrive
# You probably want to set this to port 8080. Remember to enable the webserver within xbmc, and "set the content" of your TV directory in xbmc.
# If not specified, xbmc is not updated
xbmc-web-server:localhost:8080

# OPTIONAL - log to this file
# If not specified, output only goes to stdout (the screen)
log-file:/home/xbmc/sorttv/sorttv.log

# OPTIONAL - Output verbosity. Set to TRUE to show messages describing the decision making process.
# TRUE/FALSE
# If not specified, FALSE
verbose:TRUE

# ~~~~~
# Download images
# ~~~~~

# OPTIONAL - Download images for shows, seasons, and episodes from thetvdb
# Downloaded images are copied into the sort-to (destination) directory.
# NEW_SHOWS - When new shows, seasons, or episodes are created the associated images are downloaded
# FALSE - No images are downloaded
# NEW_SHOWS/FALSE
# if not specified, NEW_SHOWS
fetch-images:NEW_SHOWS

# OPTIONAL - Sets the image format to use, poster or banner.
# POSTER/BANNER
# if not specified, POSTER
images-format:POSTER

# ~~~~~
# File renaming
# ~~~~~

# OPTIONAL - rename episodes to a new format when moving
# TRUE/FALSE
# If not specified, FALSE
rename-episodes:TRUE

# Optional - the format to use if renaming to a new format (as specified above)
# Hint: including the Episode Title as part of the name slows the process down a bit since titles are retrieved from thetvdb.com
# The format can be made up of:
#     [SHOW_NAME]: "My Show"
#     [EP1]: "S01E01"
#     [EP2]: "1x1"
#     [EP3]: "1x01"
#     [EP_NAME1] " - Episode Title"
#     [EP_NAME2] ".Episode Title"
# If not specified the format is, "[SHOW_NAME] - [EP1][EP_NAME1]"
#
# Examples: (remove the # from the renameformat line that follows the example filename you want)
# for "My Show S01E01 - Episode Title" (this is the default)
#rename-format:[SHOW_NAME] - [EP1][EP_NAME1]
# for "My Show - S01E01"
#rename-format:[SHOW_NAME] - [EP1]
# for "My Show.S01E01.Episode Title"
rename-format:[SHOW_NAME].[EP1][EP_NAME2]
# for "My Show - S01E01 - Episode Title"
#rename-format:[SHOW_NAME] - [EP1][EP_NAME1]
# for "My Show - 1x1 - Episode Title"
#rename-format:[SHOW_NAME] - [EP2][EP_NAME1]
# for "My Show - 1x01 - Episode Title"
#rename-format:[SHOW_NAME] - [EP3][EP_NAME1]

# OPTIONAL - renames episodes to replace spaces with dots
# TRUE/FALSE
# If not specified, FALSE
use-dots-instead-of-spaces:FALSE

# Substitute the titles of these shows
show-name-substitute:CSI-->CSI: Crime Scene Investigation
show-name-substitute:Sanctuary US-->Sanctuary
show-name-substitute:Shit My Dad Says-->$#*! My Dad Says

# ~~~~~
# Directory naming
# ~~~~~

# OPTIONAL - Season title (eg "Season " -> "Season 1",  "Series "->"Series 1", "Season."->"Season.1")
# Note: if you want a space it needs to be included
# If not specified, "Season "
season-title:Season

# OPTIONAL - Season format padded to double digits (eg "Season 01" rather than "Season 1")
# TRUE/FALSE
# If not specified, FALSE
season-double-digits:FALSE

# ~~~~~
# Matching options
# ~~~~~

# OPTIONAL - Match type. LIBERAL assumes all files are episodes and tries to extract season and episode number any way possible.
# LIBERAL/NORMAL
# If not specified, NORMAL
match-type:NORMAL

# ~~~~~
# Behaviour
# ~~~~~

# OPTIONAL - Sort by moving or copying the file. If the file already exists because it was already copied it is silently skipped.
# the MOVE-AND-LEAVE-SYMLINK-BEHIND option may be handy if you want to continue to seed after sorting, this leaves a symlink in place of the newly moved file
# PLACE-SYMLINK does not move the original file, but places a symlink in the sort-to directory (probably not what you want).
# MOVE/COPY/MOVE-AND-LEAVE-SYMLINK-BEHIND/PLACE-SYMLINK
# If not specified, MOVE
sort-by:MOVE-AND-LEAVE-SYMLINK-BEHIND

# OPTIONAL - How to treat directories.
# AS_FILES_TO_SORT - sorts directories, moving entire directories that represents an episode, also detects and moves directories of entire seasons
# RECURSIVELY_SORT_CONTENTS - doesn't move directories, just their contents, including subdirectories
# IGNORE - ignores directories
# AS_FILES_TO_SORT/RECURSIVELY_SORT_CONTENTS/IGNORE
# If not specified, RECURSIVELY_SORT_CONTENTS
treat-directories:RECURSIVELY_SORT_CONTENTS

# OPTIONAL - Only sort into show directories that already exist
# This may be helpful if you have multiple destination directories. Just set up all the other details in the conf file,
#  and specify the destination directory when invoking the script. Only episodes that match existing directories in the destination will be moved.
# If this is false, then new directories are created for shows that dont have a directory.
# TRUE/FALSE
# If not specified, FALSE
require-show-directories-already-exist:FALSE

# OPTIONAL - Delete symlinks from the directory to sort while sorting.
# This may be helpful if you want to remove all the symlinks you left behind using --sort-by:MOVE-AND-LEAVE-SYMLINK-BEHIND
# You could schedule "perl sorttv.pl --remove-symlinks:TRUE" to remove these once a week/month
# If this option is enabled and used at the same time as --sort-by:MOVE-AND-LEAVE-SYMLINK-BEHIND,
#  then only the previous links will be removed, and new ones may also be created
# TRUE/FALSE
# If not specified, FALSE
remove-symlinks:FALSE

# OPTIONAL - Forces MSWindows compatible file names, even when run on other platforms such as Linux
# This may be helpful if you are writing to a Windows share from a Linux system
# If not specified, FALSE
force-windows-compatible-filenames:TRUE

# OPTIONAL - Set language for thetvdb lookups, this effects episode titles etc
# Valid values include: it, zh, es, hu, nl, pl, sl, da, de, el, he, sv, eng, fi, no, fr, ru, cs, en, ja, hr, tr, ko, pt
# If not specified, en (English)
lookup-language:en

# OPTIONAL - secondary config file, overwrites settings loaded so far (DO NOT PUT THE NAME OF THIS FILE!)
# If not specified, only the default config file is loaded (sorttv.config)
# read-config-file:

But still XBMC does nothing, even thought it has no pass+username setup!! All the above situations are completely repeatable, while writing this post I tested it all again.

I'm completely confused!!

Sorry if I am wrecking your head with this!
Any further advice?

Thanks,
The Capt.

P.S. Sorry for the really long post I was just trying to fully explain all my findings!!
Reply
CoinTos Wrote:Hi cliffe,

I am done the patch now. It passes all my test files except ABC-Showtitle that Malexx reported. Thanks for all your help on this mod and hopefully this will pass your look over.

Here the patch: Patch File

Thanks for the patch Smile I am currently in the process of incorporating it into the next release.
Reply
nicx76 Wrote:ok just a simple example:

this is what i have: "Two and a Half Men - Give Me Your Thumb.ts"
this is what i want: "Two and a Half Men - S7E6 - Give Me Your Thumb.ts"

is this that complicated? Wink

nicx...

any news to this feature wish? is it possible?

nicx...
Reply
nicx76 Wrote:any news to this feature wish? is it possible?

nicx...

It's in the patch file I submitted.

According to cliffe last answer to me, it is being put in now.
Reply
Smile 
A new version of SortTV is now available: v 1.14

I encourage everyone to upgrade to this new version, which includes new features and should be compatible with both Linux and Windows (and probably Mac?). Please report your experiences.

New features:
  • --fetch-show-title:[TRUE|FALSE]
    Fetch show titles from thetvdb.com (for proper formatting)
    If not specified, TRUE
  • --match-files-named-showname-episodetitle:[TRUE|FALSE]
    Attempt to sort files that are named after the show and episode title.
    For example, "My show - My episode title.avi" could become "My Show - S01E01 - My episode title.avi"
    Attempts to lookup the season and episode number based on the episodes in thetvdb.com database.
    Since this involves downloading the list of episodes from the Internet, this will cause a slower sort.
    If not specified, TRUE
  • --tvdb-id-substitute:NAME1-->TVDB ID
    Substitutes names equal to NAME1 for TVDB ID for lookups
    This argument can be repeated to add multiple rules for lookups
  • Lots of other improvements and fixes including better:
    --show-name-substitute:NAME1-->NAME2
    [INDENT]Substitutes names equal to NAME1 for NAME2
    This argument can be repeated to add multiple rules for substitution
    [/INDENT]
  • Makes the features from the last few releases available to Windows users.
  • Different default settings. For example, by default no xbmc web server is specified (edit the config file, or start SortTV with arguments that set how you want it)

Thanks to CoinTos for writing a lot of the code for the new features!

If you find this script helpful then please consider making a $5 paypal donation. Click for more information:
http://sourceforge.net/donate/index.php?group_id=330009

You can get the new version from:
https://sourceforge.net/projects/sorttv/files/

Enjoy Smile

nicx76 Wrote:any news to this feature wish? is it possible?

nicx...

The feature you requested is included Smile

Targettio Wrote:That sorts it! Thanks soo much. Big GrinLaugh

By default it doesn't try to connect to the xbmc web server anymore. So those that don't use the xbmc web server won't have to wait for it to try to connect.

CoinTos Wrote:Hi cliffe,

I am done the patch now. It passes all my test files except ABC-Showtitle that Malexx reported. Thanks for all your help on this mod and hopefully this will pass your look over.

Here the patch: Patch File

Please make sure you do a diff against the version I am releasing to see all the changes I have made. I look forward to receiving more code Smile
Reply
cliffe Wrote:Please make sure you do a diff against the version I am releasing to see all the changes I have made. I look forward to receiving more code.
Will do and thanks again for your help through this as I learn the ins and outs of perl. I, also, now have the version I need for this wednesdays launch of my dedicated media server so I can't wait to put this into production, thanks.
Reply
wow great news, i will test it and if its working i am sure your paypal account increases Wink

thanks!
nicx...
Reply
one more feature wish:

i just want to rename all files in one directory (including all subdirectories) without sorting them into new directories. is it possible to inclue a "sorting=no" option?

btw: the script is working great Smile

thanks!
nicx...
Reply
Really like your script, works amazingly well. Thanks!
Reply
hmm, would it be possible to change the notification sent to xbmc to only send successfull moves/symlink/copy's? Smile as i symlink from a messy incomingdir i use place-symlink. And xbmc stutters like crazy while getting those notifications, so i would like to just get the successfull ones.

Edit:
Also, i noticed the notifications have a limited length, so would be cool if they were shorted down to "showname S00E00"
Wink
Reply
  •  Previous
  • 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
  • 48
  • Next 



SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac)4.888