[DOWNLOAD] MediaAssistent - XBMC Media Flagging Script
#1
Thumbs Up 
Hi,
i've being spending some time in the last few days writing xbmc script for configuring the media flags that aeon and alike can present, my main purpose here is to be able doing it all from within xbmc using the remote so was trying to utilising xbmc as much as i can.
the script will depend on the nfo's that xbmc produce during the "export to library" function, those are the nfo's that the media tags are going to be written to.
it will first look for the movies paths and names in the database video34db, for tags discovery the script is using MediaInfo metadata extractor as well as scanning for possible tags in the filename, after doing so it will output the extra data to the appropriate nfo file.

in order to to be able to see all those extra tags in aeon here is what u should do:
A - if u don't already have nfo's based library, first u need to export all the nfo's and pix files that xbmc configured during the content scan or while updating the library, u do that by using xbmc's function "export to library" then choose to export all tbn and alike as well as nfo to separate files.
B - run the script,it will scan the DB for the right nfo paths and will output all the extra info to the <studio> tag.
C - browse to your movie library, delete everything in there by setting the content to none.
D - now reload the library again by setting the content as it was prior to the library deletion and rescan it, this time xbmc will use the exported nfo and pix files so it will take place immediately

if it all went well u should see the extra tags with aeon
the script was tested only on linux and would not run under windows.
if u encounter any problems please use the debug log.
hope u'll make any use of it.Big Grin

changelog:
- after some time playing with it, it turns out that Mediainfo would be way better for tags discovery, so hachoir was replaced by MediaInfo, it took a while to port it to xbmc's python 2.4 but all seems fine now.
- the writing procedure to the xml files was replaced as well, StringIO will be used instead of elementTree, there are way to many xml files which reports utf-8 but actually not so and therefore making elementTree to failed writing to those files.

a word for win users:
the script would not run on win box'es, there few binaries that needs to be hunt down and i don't really have any win machine to test it on, so i've figured that i would leave it as a linux script(there are few other win apps that can accomplished the task any way).
if there is some win python coder who willing to port it over, i'll be glad to help.

download 0.2.1: http://dl.getdropbox.com/u/283941/Media%...-0.2.1.rar
Reply
#2
cant figure out the error,

posted debug log below for your reference. thanks
KODI1: Shield 2019 2D and 4K HDR / Zidoo Z9X 3DMVC /ATV4K 2D/ and 4K HDR/ DV AVR1: YAM RXA3080 DISP1: LG OLED77G6P /3D/HDR/DV
KODI2: Shield 2015 2D and 4K HDR / Zidoo X9S 3DMVC /ATV4K 2D and 4K/ HDR/ DV AVR2: Marantz NR1607 DISP2: LG OLED55C6P /3D/HDR/DV
KODI3: Shield 2015 2D and 4K HDR / Zidoo X9S 3DMVC /ATV4K 2D and 4K/ HDR/ DV AVR3: Denon AVR-X3300 DISP3: LG OLED65G6P /3D/HDR/DV
Reply
#3
10x, something is wrong with "Me dia Assistent" should be "Me dia Assistent".
Reply
#4
Code:
Traceback (most recent call last):
15:42:24 T:4856 M:1370124288  NOTICE:   File "C:\Users\nc88keyz\AppData\Roaming\XBMC\scripts\Media Assistent\default.py", line 2, in ?
15:42:24 T:4856 M:1370124288  NOTICE:
15:42:24 T:4856 M:1370124288  NOTICE: from SqliteHandler import SqliteHandler
15:42:24 T:4856 M:1370124288  NOTICE:   File "C:\Users\nc88keyz\AppData\Roaming\XBMC\scripts\Media Assistent\SqliteHandler.py", line 1, in ?
15:42:24 T:4856 M:1370124288  NOTICE:
15:42:24 T:4856 M:1370124288  NOTICE: from pysqlite2 import dbapi2 as sqlite
15:42:24 T:4856 M:1370124288  NOTICE:   File "C:\Users\nc88keyz\AppData\Roaming\XBMC\scripts\Media Assistent\pysqlite2\dbapi2.py", line 27, in ?
15:42:24 T:4856 M:1370124288  NOTICE:
15:42:24 T:4856 M:1370124288  NOTICE: from pysqlite2._sqlite import *
15:42:24 T:4856 M:1370124288  NOTICE: ImportError
15:42:24 T:4856 M:1370124288  NOTICE: :
15:42:24 T:4856 M:1370124288  NOTICE: No module named _sqlite
15:42:24 T:4856 M:1370124288  NOTICE:
15:42:24 T:4856 M:1370124288   ERROR: Scriptresult: Error

logfile
KODI1: Shield 2019 2D and 4K HDR / Zidoo Z9X 3DMVC /ATV4K 2D/ and 4K HDR/ DV AVR1: YAM RXA3080 DISP1: LG OLED77G6P /3D/HDR/DV
KODI2: Shield 2015 2D and 4K HDR / Zidoo X9S 3DMVC /ATV4K 2D and 4K/ HDR/ DV AVR2: Marantz NR1607 DISP2: LG OLED55C6P /3D/HDR/DV
KODI3: Shield 2015 2D and 4K HDR / Zidoo X9S 3DMVC /ATV4K 2D and 4K/ HDR/ DV AVR3: Denon AVR-X3300 DISP3: LG OLED65G6P /3D/HDR/DV
Reply
#5
10x for your help nc88keyz,

i guess the problem is that in linux it loads _sqlite.so from /Media Assistent/pysqlite2, but theres no eqviliant dll for windows there,
i'll have a look.
Reply
#6
ok , ill look forward to an update then. looked nice since it works off the xbmc video.db and therefore wouldnt have an issues like the other program with movies in one folder vs seperate.

I think anyways....but im no programmer or debugger for that matter

there is an sqlite3.dll

for windows binaryf ro sqlite explorer i think...
KODI1: Shield 2019 2D and 4K HDR / Zidoo Z9X 3DMVC /ATV4K 2D/ and 4K HDR/ DV AVR1: YAM RXA3080 DISP1: LG OLED77G6P /3D/HDR/DV
KODI2: Shield 2015 2D and 4K HDR / Zidoo X9S 3DMVC /ATV4K 2D and 4K/ HDR/ DV AVR2: Marantz NR1607 DISP2: LG OLED55C6P /3D/HDR/DV
KODI3: Shield 2015 2D and 4K HDR / Zidoo X9S 3DMVC /ATV4K 2D and 4K/ HDR/ DV AVR3: Denon AVR-X3300 DISP3: LG OLED65G6P /3D/HDR/DV
Reply
#7
yes many issues been escaped by using the DB.
anyway i just saw how does AMT supply the sqlite dll within the rar, so i'll have a fix for that soon, till then it's not really usable for windows, i'll edit the first post.

10x again for your help.
Reply
#8
Works great on Fedora 10!Smile

Doesn't read the video resolution, but after taking a quick peek at the code, it looks to me that this simply isn't implemented yet?
Reply
#9
Ha glad to hear it Big Grin
the thing is that when i extract the resolution data from the metadata within the file then it only reports 720 or 1280 but not 720i or 720p
so i have no certain way to be sure about it, all though if the resolution it's found in the file name then it will be picked(hopefully).
Reply
#10
deleted== working=
XBMC SVN (updated every week) ubuntu Karmic 64bits
Intel E5200/ 3 Go Ram / Nvidia GT220 1Go / 6To (1.5To x 4 Raid 5)
Reply
#11
0.2 was uploaded, please have a look at the first post for more info.
Reply
#12
Not to be overly picky, but the word is spelled "assistant."
Reply
#13
Laugh

10x
Reply
#14
theophile Wrote:Not to be overly picky, but the word is spelled "assistant."
Not in germanyWink
Reply
#15
Ok, got this:

Code:
[...]
20:29:29 T:2867301264 M:777740288  NOTICE:   File "/home/mythtv/.xbmc/scripts/Media Assistent/libs/MediaInfo/MediaInfoDLL.py", line 37, in ?
20:29:29 T:2867301264 M:777740288  NOTICE:
20:29:29 T:2867301264 M:777740288  NOTICE: MediaInfoDLL_Handler = CDLL("/home/moty/Workspace/python/projects/MediaAssistent/src/libs/MediaInfo/libmediainfo.so.0")
[...]
20:29:29 T:2867301264 M:777740288  NOTICE: /home/moty/Workspace/python/projects/MediaAssistent/src/libs/MediaInfo/libmediainfo.so.0: cannot open shared object file: No such file or directory

Fixed it myself by replacing line 37 in libs/MediaInfo/MediaInfoDLL.py with this one:
Code:
MediaInfoDLL_Handler = CDLL(os.path.join(os.getcwd(),"libs","MediaInfo","libmediainfo.so.0"))

But now i get an error about a missing libzen.so.0 (which seems to be linked to by libmediainfo.so.0).

So, WTF is "libzen" and where do i get it?Smile

Update:
There simply seems to be no libmediainfo/libzen in fedora's default repos, so i installed libzen from here:
http://mediainfo.sourceforge.net/en/Down...ra_10.i386

But now only 1 file gets scanned. After that the scripts ends without errors..
Reply

Logout Mark Read Team Forum Stats Members Help
[DOWNLOAD] MediaAssistent - XBMC Media Flagging Script0