[Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Come up with a useful post-processing script? Share it here!
Post Reply
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by tret »

joeblack2k wrote: First of all great script!

the only thing that's bothering me is it feels like its copying the files from /category to /download folder and not moving (takes 10min for mkv)
is that because the files are on external drive ? (/media/BOOK/downloads/Films -> /media/Book/downloads/Movies.. where Films is the category and Movies the ending-place)

also i found this neat little http cmd for XBMC:

http://192.168.1.96:9777/xbmcCmds/xbmcH ... sting123))

its show's you: Testing
                       testing123

in xbmc.. can that be used when the script is finished ? "MEDIA PROCESSING COMPLETE" (or even capture the imdb movie name or something like that? )

thanx for reading!
I like that xbmc message idea. I'll play with that.

I believe I do have it doing a copy rather than a move.  I'll look into having it do a move instead.

Thanks for the suggestions.

Rob
madd
Newbie
Newbie
Posts: 3
Joined: September 3rd, 2009, 2:13 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by madd »

I had a working script but suddenly I started getting:

    'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/Users/1/sabnzbd/media_process.py", line 3, in
    import os
ImportError: No module named os

I'm no Python expert - any idea on what might be causing this?
stanpete
Jr. Member
Jr. Member
Posts: 95
Joined: February 2nd, 2008, 11:35 am

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by stanpete »

tret wrote: I like that xbmc message idea. I'll play with that.
I like it too. A lot.
And what's also cool is having an rss-feed (or xml file) like episode butler had when I still used
it. So i could just turn on my tv and saw all newly downloaded shows on the xbmc menu screen...

Would that be an option ? ;-)

st
badapples
Newbie
Newbie
Posts: 11
Joined: September 8th, 2009, 9:12 am

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by badapples »

Nice script. I'll try it tonight on my opensolaris box running sab. Looks like I'll need to update python though because I believe I'm running 2.4 if I'm not mistaken.

Anyway, would it be possible to allow my to keep the "1080p" or "720p" in the filename of renamed movies? Here is the naming scheme I use that I find works well -

"The Dark Knight (2008).1080p.mkv"

Also, if the movie contains a DTS soundtrack, I like to keep that info in the filename as well.

"The Dark Knight (2008).1080p.DTS.mkv"

My hope is that eventually Plex or XBMC will be able to read these "tags" and put some kind of tag on the video in my media library so that when I'm browsing through my movies, I'll see "720P" or "DTS" as a little overlay on the movie thumbail perhaps. That may or may not ever happen, but in case it does, I want to keep this info in the filename if possible, but I still want to rename the movies that come across as "tdk.1080p.dts.release.en.subs.mkv" or whatever..
Jesus
Release Testers
Release Testers
Posts: 6
Joined: July 29th, 2009, 4:28 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by Jesus »

badapples wrote: Nice script. I'll try it tonight on my opensolaris box running sab. Looks like I'll need to update python though because I believe I'm running 2.4 if I'm not mistaken.

Anyway, would it be possible to allow my to keep the "1080p" or "720p" in the filename of renamed movies? Here is the naming scheme I use that I find works well -

"The Dark Knight (2008).1080p.mkv"

Also, if the movie contains a DTS soundtrack, I like to keep that info in the filename as well.

"The Dark Knight (2008).1080p.DTS.mkv"

My hope is that eventually Plex or XBMC will be able to read these "tags" and put some kind of tag on the video in my media library so that when I'm browsing through my movies, I'll see "720P" or "DTS" as a little overlay on the movie thumbail perhaps. That may or may not ever happen, but in case it does, I want to keep this info in the filename if possible, but I still want to rename the movies that come across as "tdk.1080p.dts.release.en.subs.mkv" or whatever..

A lot of the more advanced skins for XBMC does exactly that.  Try out the Mediastream mod its IMO the best- Aeon also does it I believe.  You can create a NFO XML file with a program like MIP (media info plus) that uses FFMPEG to pull the video data.  It can detect resolution (SD, 720p, 1080) and also audio container.  It also identifies dvd rips and TV rips based off the file name. 

I would love to use this script - but I do not rename any of my movie files.  I would not mind renaming it if SABnzbd had the option to create a batch file to rename it back to the original name.

Media Info Plus:
http://xbmc.org/forum/showthread.php?t=47071

Mediastream Skin Mod:
http://xbmc.org/forum/showthread.php?t=54207
richlin71
Release Testers
Release Testers
Posts: 5
Joined: July 6th, 2009, 12:07 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by richlin71 »

I have this same problem on my Mac running Snow Leopard (default Python install). Any ideas on how to fix it?
madd wrote: I had a working script but suddenly I started getting:

    'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/Users/1/sabnzbd/media_process.py", line 3, in
    import os
ImportError: No module named os

I'm no Python expert - any idea on what might be causing this?
madd
Newbie
Newbie
Posts: 3
Joined: September 3rd, 2009, 2:13 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by madd »

After further investigation I think the problem is with SABnzbd and Python execution. The script runs perfectly fine if run by command-line from eg. Terminal.
richlin71 wrote: I have this same problem on my Mac running Snow Leopard (default Python install). Any ideas on how to fix it?
madd wrote: I had a working script but suddenly I started getting:

    'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/Users/1/sabnzbd/media_process.py", line 3, in
    import os
ImportError: No module named os

I'm no Python expert - any idea on what might be causing this?
Chugalug
Newbie
Newbie
Posts: 2
Joined: May 25th, 2009, 12:20 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by Chugalug »

I am having this problem in Snow Leopard as well. I hope that someone figures out how to fix this plug-in, I don't know anything about python so I am no help but it's a great plugin so I hope it gets fixed.


madd wrote: After further investigation I think the problem is with SABnzbd and Python execution. The script runs perfectly fine if run by command-line from eg. Terminal.
richlin71 wrote: I have this same problem on my Mac running Snow Leopard (default Python install). Any ideas on how to fix it?
madd wrote: I had a working script but suddenly I started getting:

    'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/Users/1/sabnzbd/media_process.py", line 3, in
    import os
ImportError: No module named os

I'm no Python expert - any idea on what might be causing this?
wally007
Release Testers
Release Testers
Posts: 155
Joined: August 28th, 2009, 5:24 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by wally007 »

I'm trying to use this script for  tv shows that dont have thetvdb.com entry. I'd like to have these files under TV SHOWS in XBMC so from what i was told on XBMC site i need to make nfo file. So far sabnzbd+ very nicely renames and moves files to my destination but if there's no thetvdb entry , show wont show up under TV SHOWS ( only in VIDEOS )

Is there anyway this script could make generic nfo file if it wont find any entry on thetvdb ?

Example SHOW NAME S01E01.avi would result in generic episode name "EPISODE 1" under "SHOW NAME" folder and all other fields would be blank. This way even though not all info will be available at least it will show up in TV SHOWS and more important in RECENTLY ADDED list.

Thanks
wally007
Release Testers
Release Testers
Posts: 155
Joined: August 28th, 2009, 5:24 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by wally007 »

Finally got it to work. In Windows i had to move script to C:\Python26.

But as far as i know this is NOT proper nfo for XBMC. Proper nfo for an TV episode looks like this


        My TV Show
        http://www.thetvdb.com/api/1D62F2F90030 ... nguage.zip
       
        9.900
        0
        The best TV show in the world
        Action and Adventure / Drama
        2000-01-01
       
       
            Big John
            Jack of all trades
           
       
   
.

Maybe i'm not getting the point of this script but i thought script would make a nfo for scraping purposes. And if thetvdb entry is present , script would include URL in the tag.
Last edited by wally007 on September 13th, 2009, 3:51 pm, edited 1 time in total.
SpankIt
Newbie
Newbie
Posts: 21
Joined: September 23rd, 2009, 8:25 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by SpankIt »

Thanks for this. Saves me so much time.
sixones
Release Testers
Release Testers
Posts: 43
Joined: January 13th, 2009, 6:10 am

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by sixones »

Is it possible to use a username and password when communicating with XBMC? I've tried using the usual HTTP authentication format; "username:[email protected]:port" but it doesnt seem to work.
Last edited by sixones on October 4th, 2009, 9:41 am, edited 1 time in total.
SpankIt
Newbie
Newbie
Posts: 21
Joined: September 23rd, 2009, 8:25 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by SpankIt »

I'm running this script on a freenas box and seem to be having some issues with the Movie.nfo file. It doesn't give me read access to the file. I can open it in the fileeditor but can't open it through my SMB shares.

-rw-------  1 root  wheel        36 Oct  7 18:29 Movie.nfo

is what happens to the file when the script is run.

Edit: On a side note, if I run the script from putty using the root account the file comes out fine and I can read it.
Last edited by SpankIt on October 8th, 2009, 7:18 pm, edited 1 time in total.
JohnSCS
Newbie
Newbie
Posts: 42
Joined: August 17th, 2009, 12:23 am

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by JohnSCS »

If anyone is interested, I have made a quick python script to update the Video Library & displays the clean version of the job name on the bottom of the XBMC screen when Sab has finished downloading.

Note - The strings being passed to the Notification command MUST not have spaces in it - all spaces must be converted to %20

Code: Select all

import sys,urllib

job_title = "Download%20Complete"
job_name = sys.argv[3]
job_name=job_name.replace(' ', '%20')
job_name=job_name.replace('_', '%20')
job_name=job_name.replace('.', '%20')

urllib.urlopen("http://<xbmc ip add:port>/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(" + job_title + "," + job_name + ",20000,c:\scripts\sabnzbd.jpg))")
urllib.urlopen("http://<xbmc ip add:port>/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)")
And the image below is saved into the scripts directory too.
Image
SpankIt
Newbie
Newbie
Posts: 21
Joined: September 23rd, 2009, 8:25 pm

Re: [Linux, MacOSX, Windows] Media Processing + XBMC Updater

Post by SpankIt »

SpankIt wrote: I'm running this script on a freenas box and seem to be having some issues with the Movie.nfo file. It doesn't give me read access to the file. I can open it in the fileeditor but can't open it through my SMB shares.

-rw-------  1 root  wheel         36 Oct  7 18:29 Movie.nfo

is what happens to the file when the script is run.

Edit: On a side note, if I run the script from putty using the root account the file comes out fine and I can read it.
Anyone???
Post Reply