Metadata agents for exported XBMC library

Hi Guillome,



could it be, that the newest Server version (0.9.6.9) makes some problem?



I updated some movies in my existing library (worked before), but have recognized, that the metadata import doesn’t work now.



Here’s the log:



The file exists.

Do you have any ideas?

See my answer in #91. You should just re-install the plugins to get a fix for this.

Thanks Guillome, that made the trick;-)


I'm with cristian on this one. One of the main reasons I needed the XMBC .nfo importer is because I have my own metadata manager that works outside of the Plex family for devices that you don't have an interface for. However, I can't use my subtitles, backgrounds, etc. without the ability to hit the disk for these pieces. Can we get this added or is there a way to do it manually?

See http://forums.plexapp.com/index.php/topic/38402-metadata-agents-for-exported-xbmc-library/page__view__findpost__p__274493 on how to enable it manually.

Hi Guillaume,



Love your scraper, just have one request. Been trying to do it my self with no luck.



When importing my movie collection to Plex Server all info gets imported as it should except one field. The Sort by field. This is set to the same as the movie title.

And i like to have for instance all my James Bond movies in corret order, etc.



Here’s a snib from the nfo file.



My Movies

007 - GoldenEye
GoldenEye
James Bond 1995
7
1995




Pierce Brosnan imponerer, i sin debut som den ustoppelige superagent, James Bond. Da et magtfuldt satelitsystem falder i hænderne på en tidligere allieret, som nu er på fjendens hold - må 007 på ba...
Pierce Brosnan imponerer, i sin debut som den ustoppelige superagent, James Bond. Da et magtfuldt satelitsystem falder i hænderne på en tidligere allieret, som nu er på fjendens hold - må 007 på banen. Sateliten kan med en enkelt stråle tilintetgøre al elektronisk udstyr, og derved skabe et uoverskueligt kaos.


124 min.

it's the bit in blue that doesn't get imported to Plex server. Any chance you could provide assistance to get this working?

I'm running Plex Media Server for Windows ver. 0.9.6.9

any help is very much appreciated, and thanks in advance

/Peter

I am sorry, but sort title cant be entered with metadata agents (I wish it could). If you dig through this topic you will see where it was attempted without success.

@chris3452



Sad to hear :frowning:



thought i had read through the past 6 pages, so sorry for bringing up an issue already mentioned. thank you for responding though :slight_smile:

Hi,



I’m using the agent on my Synology DS412+ with PLex 0.9.6.9

I’m french and when I have accent like é è in the path to my file, I get this error with the python script :



2012-11-13 22:07:00,413 (5800a) :  CRITICAL (agentkit:973) - Exception in the update function of agent named 'XBMC .nfo Importer', called with guid 'com.plexapp.agents.xbmcnfo://356?lang=xn' (most recent call last):<br />
  File "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 971, in _update<br />
    agent.update(obj, media, lang)<br />
  File "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/XBMC .nfo Importer.bundle/Contents/Code/__init__.py", line 79, in update<br />
    **if os.path.exists(posterFilename):**<br />
  File "/volume1/@appstore/Plex Media Server/Resources/Python/lib/python2.7/genericpath.py", line 18, in exists<br />
   ** os.stat(path)**<br />
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 61: ordinal not in range(128)



It seems that the script does not support path or filename with accent (if I remove the accent, it works)

How can it be solved ?
Thanks

I am trying to add some lectures as a tvshow series. I have created the .nfo files, and try to scrape them, but searching the logs i see the following error





2012-11-25 18:10:17,055 (2798) :  CRITICAL (core:561) - Exception in the search function of agent named 'XBMC TV .nfo Importer', called with keyword arguments {'openSubtitlesHash': '9b4e33b371407e3c', 'episode': '4', 'episodic': '1', 'show': 'Algorithms Design and Analysis, Part I Lectures', 'season': '16', 'filename': 'W:%5Clectures%5CAlgorithms%20-%20Design%20and%20Analysis,%20Part%20I%20(lectures)%5CSeason%2016%20-%20Balanced%20binary%20search%20trees%5CS16E04%20-%20Red-Black%20Trees%20(21%20min)%2Emp4', 'plexHash': '2bd28c5c4bb9c7bc8fac3b81e904b4c1abe03f95', 'duration': '1278259', 'id': '22919'} (most recent call last):<br />
  File "C:\Users\Kostas\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 923, in _search<br />
    agent.search(results, media, lang)<br />
  File "C:\Users\Kostas\AppData\Local\Plex Media Server\Plug-ins\XBMCnfoTV.bundle\Contents\Code\__init__.py", line 67, in search<br />
    tvshowid=nfoXML.xpath("id")[0].text<br />
  File "C:\Users\Kostas\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 110, in <lambda><br />
    _getitem_           = lambda x, y: x.__getitem__(y),<br />
IndexError: list index out of range


The tag in the tvshow.nfo is not optional. Just make up one.


Thx alot. That fixed it.

It seam that the plugin XBMC .nfo Importer.bundle do not work anymore with the latest version of PLEX ( 0.9.7.3.317 )

I cannot select the plugin anymore … only the 3 standards Agents are selectable, the XBMC .nfo… is not visible anymore :frowning:

Do you have an idea on how to do ?

Thank’s for your help


I have the same version, and it still works as expected:

http://f.cl.ly/items/1j3o3W1e0t2Q3i1B2T0m/Screen%20Shot%202012-11-28%20at%2018.49.53%20.png

Ok I will retry : desintall and re install



With you XMBC nfo importer I have a problem with all files including accent ( I’m in France / French langage )



I’m not pro in Python could you help me and sure help all French guys …



Is it possible to add a line in your script to specify that we use French caracters ?



Or do I have to modify all the nfo files and title one by one ?



Thank’s a lot for your precious help




Does I need to install something else than Python version 2.7.3-011 on a Synology to use your XBMC nfo importer ?

I am in France so with french caracteres accents

The nfo XBMC importer script recognize like almost of the 75 first thumbnails .tbn files but not all ( as you can see on the attached picture) I have each movie in a separate folder and for each movie a .nfo and a .tbn file issued from XBMC export fonction

And the script do not find any information in the nfo file

Here on example of nfo file issued from xbmc export


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>



15 ans et demi

4.000000

0.000000

2007

0



Philippe Le Tallec, brillant scientifique vivant aux Etats-Unis depuis 15 ans, décide de rentrer en France s’occuper de sa fille Eglantine. Il espère profiter de cette occasion pour tisser des liens avec cette jeune fille et rattraper le temps perdu, mais elle a bien d’autres préoccupations que de passer du temps avec son père… Le séjour s’annonce très différent de ce qu’il avait imaginé, et Philippe est totalement dépassé. Il va se résoudre à faire un improbable stage de rééducation pour pères en difficulté, animé par Jean-Maxence, un célèbre auteur de méthodes en tous genres…

Philippe Le Tallec, brillant scientifique vivant aux Etats-Unis depuis 15 ans, décide de rentrer en France s’occuper de sa fille Eglantine. Il espère profiter de cette occasion pour tisser des liens avec cette jeune fille et rattraper le temps perdu, mais elle a bien d’autres préoccupations que de passer du temps avec son père… Le séjour s’annonce très différent de ce qu’il avait imaginé, et Philippe est totalement dépassé. Il va se résoudre à faire un improbable stage de rééducation pour pères en difficulté, animé par Jean-Maxence, un célèbre auteur de méthodes en tous genres…



92

15 ans et demi.tbn



0





Comédie

François Desagnat

















xvid

1.818182

640

352

5574





mp3



2









Daniel Auteuil (Philippe Le Tallec)









Juliette Lamboley (Eglantine)









François Damiens (Jean-Maxence)









Lionel Abelanski (Guy)









Julie Ferrier (Fiona)









François Berléand (Albert Einstein)









Elise Larnicol (Sylvie)









Benjamin Siksou (Gaspard)









Maud Verdeyen (Zoé)









Lucie Lucas (Karine)









Coura Traoré (Anne-Sophie)









Canis Crevillen (Charlotte)









Lionel Lingelser (Vincent)









Dylan Imayanga (Zoé)









Philippe Duquesne (Jean-Louis)









Chick Ortega (Denis)









Alain Chabat (Le Sdf)









Elie Semoun (L’Automobiliste Énervé)









Bastien Clerin (Un Collégien).









0.000000

0.000000







As you can see on the picture not all movies have thumbnails and not at all have informations after having install and use the XBMC nfo importer script… and yet in XBMC all my files have complete informations and thumbnails…



I think that perhaps the xpath command need to import a special library ?



Thank’s very much for your help

Here my com.plexapp.agents.xbmcnfo.log



2012-12-03 03:23:57,654 (4001f9b0) : INFO (core:336) - Starting framework core - Version: 2.2.3.0, Build: 092e9af (Fri Nov 16 15:10:37 UTC 2012)

2012-12-03 03:23:57,671 (4001f9b0) : DEBUG (core:348) - Using the elevated policy

2012-12-03 03:23:57,675 (4001f9b0) : DEBUG (core:437) - Starting runtime component.

2012-12-03 03:23:57,742 (4001f9b0) : DEBUG (core:437) - Starting caching component.

2012-12-03 03:23:57,757 (4001f9b0) : DEBUG (core:437) - Starting data component.

2012-12-03 03:23:57,764 (4001f9b0) : DEBUG (core:437) - Starting networking component.

2012-12-03 03:23:57,838 (4001f9b0) : DEBUG (networking:312) - Loaded HTTP cookies

2012-12-03 03:23:57,875 (4001f9b0) : DEBUG (networking:498) - Setting the default network timeout to 20.0

2012-12-03 03:23:57,988 (4001f9b0) : DEBUG (core:437) - Starting localization component.

2012-12-03 03:23:57,991 (4001f9b0) : INFO (localization:408) - Setting the default locale to en-us

2012-12-03 03:23:57,996 (4001f9b0) : DEBUG (core:437) - Starting messaging component.

2012-12-03 03:23:58,198 (4001f9b0) : DEBUG (core:437) - Starting debugging component.

2012-12-03 03:23:58,202 (4001f9b0) : DEBUG (core:437) - Starting services component.

2012-12-03 03:23:58,221 (4001f9b0) : DEBUG (core:437) - Starting myplex component.

2012-12-03 03:23:58,224 (4001f9b0) : DEBUG (core:437) - Starting notifications component.

2012-12-03 03:23:58,238 (4292a490) : DEBUG (networking:166) - Requesting ‘http://127.0.0.1:32400/system/messaging/clear_events/com.plexapp.agents.xbmcnfo

2012-12-03 03:24:06,026 (4001f9b0) : DEBUG (accessor:68) - Creating a new model access point for provider com.plexapp.agents.xbmcnfo in namespace ‘metadata’

2012-12-03 03:24:06,707 (4001f9b0) : DEBUG (runtime:1044) - Created a thread named ‘load_all_services’

2012-12-03 03:24:06,713 (42c18490) : DEBUG (services:265) - Plug-in is not daemonized - loading services from system

2012-12-03 03:24:06,797 (4001f9b0) : DEBUG (runtime:1044) - Created a thread named ‘get_server_info’

2012-12-03 03:24:06,980 (4001f9b0) : DEBUG (core:149) - Finished starting framework core

2012-12-03 03:24:06,983 (4001f9b0) : DEBUG (core:547) - Loading plug-in code

2012-12-03 03:24:07,108 (431f4490) : DEBUG (networking:166) - Requesting ‘http://127.0.0.1:32400

2012-12-03 03:24:07,113 (42c18490) : DEBUG (networking:166) - Requesting ‘http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_

2012-12-03 03:24:13,336 (4001f9b0) : DEBUG (core:553) - Finished loading plug-in code

2012-12-03 03:24:13,419 (4001f9b0) : DEBUG (agentkit:1010) - Creating new agent class called xbmcnfo

2012-12-03 03:24:13,440 (4001f9b0) : DEBUG (agentkit:890) - Updating agent information: [{‘media_types’: [‘Movie’], ‘accepts_from’: None, ‘fallback_agent’: None, ‘contributes_to’: None, ‘languages’: [‘xn’], ‘persist_stored_files’: True, ‘primary_provider’: True, ‘prefs’: False, ‘name’: ‘XBMC .nfo Importer’}]

2012-12-03 03:24:13,555 (4001f9b0) : DEBUG (networking:166) - Requesting ‘http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0FnZW50U2VydmljZTpVcGRhdGVJbmZv/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQo1CmRpY3QKbGlzdApkaWN0Cmxpc3QKbGlzdAoyCnMyNgpjb20ucGxleGFwcC5hZ2VudHMueGJtY25mb3MxMAppZGVudGlmaWVycjEKczEwCmFnZW50X2luZm8xCnIyCjkKcjMKczExCm1lZGlhX3R5cGVzbnMxMgphY2NlcHRzX2Zyb21uczE0CmZhbGxiYWNrX2FnZW50bnMxNApjb250cmlidXRlc190b3I0CnM5Cmxhbmd1YWdlc2IxczIwCnBlcnNpc3Rfc3RvcmVkX2ZpbGVzYjFzMTYKcHJpbWFyeV9wcm92aWRlcmIwczUKcHJlZnNzMTgKWEJNQyAubmZvIEltcG9ydGVyczQKbmFtZTEKczUKTW92aWUxCnMyCnhucjAK

2012-12-03 03:24:17,717 (431f4490) : DEBUG (core:525) - Machine identifier is 9398651809fc7a874781eddfe0b2da2b3272db96

2012-12-03 03:24:17,883 (431f4490) : DEBUG (core:526) - Server version is 0.9.6.9.240-8fd9c6a

2012-12-03 03:24:24,467 (4001f9b0) : CRITICAL (sandbox:298) - Function named ‘Start’ couldn’t be found in the current environment

2012-12-03 03:24:24,472 (4001f9b0) : INFO (core:598) - Started plug-in

2012-12-03 03:24:24,475 (4001f9b0) : DEBUG (socketinterface:144) - Starting socket server

2012-12-03 03:24:24,811 (4001f9b0) : DEBUG (runtime:1044) - Created a thread named ‘start’

2012-12-03 03:24:24,815 (4001f9b0) : INFO (socketinterface:168) - Socket server started on port 34168

2012-12-03 03:24:24,820 (4001f9b0) : INFO (pipeinterface:25) - Entering run loop

2012-12-03 03:24:24,824 (4001f9b0) : DEBUG (runtime:655) - Handling request GET /:/prefixes

2012-12-03 03:24:24,902 (4001f9b0) : DEBUG (runtime:751) - Found route matching /:/prefixes

2012-12-03 03:24:25,462 (4001f9b0) : DEBUG (runtime:851) - Response: [200] MediaContainer, 151 bytes

2012-12-03 03:24:26,326 (4292a490) : DEBUG (runtime:655) - Handling request GET /:/plugins/com.plexapp.agents.xbmcnfo/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCnhuczQKbGFuZ3M1Ck1vdmllczEwCm1lZGlhX3R5cGViMHM2Cm1hbnVhbHIxCnM2Cmt3YXJnczYKczE2CmM2MTI1OWY1MGIzMmMwYjZzMTcKb3BlblN1YnRpdGxlc0hhc2hzMTkKMTAgTWludXRlcyDDoCBWaXZyZXM0Cm5hbWVzODgKJTJGdm9sdW1lMSUyRnZpZGVvJTJGRmlsbXMlMkYxMCUyMG1pbnV0ZXMlMjDDoCUyMHZpdnJlJTJGMTAlMjBtaW51dGVzJTIww6AlMjB2aXZyZSUyRWF2aXM4CmZpbGVuYW1lczQwCjU5NGU3Y2FhZmE5Nzg2OTg4NGQ5ZTI5ZDBiZGYwNDBiNDI2YmMzOTNzOApwbGV4SGFzaHM3CjUwNTkwMDBzOApkdXJhdGlvbnM0CjU4MjJzMgppZHIwCg__

2012-12-03 03:24:26,991 (4292a490) : DEBUG (runtime:751) - Found route matching /:/plugins/com.plexapp.agents.xbmcnfo/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCnhuczQKbGFuZ3M1Ck1vdmllczEwCm1lZGlhX3R5cGViMHM2Cm1hbnVhbHIxCnM2Cmt3YXJnczYKczE2CmM2MTI1OWY1MGIzMmMwYjZzMTcKb3BlblN1YnRpdGxlc0hhc2hzMTkKMTAgTWludXRlcyDDoCBWaXZyZXM0Cm5hbWVzODgKJTJGdm9sdW1lMSUyRnZpZGVvJTJGRmlsbXMlMkYxMCUyMG1pbnV0ZXMlMjDDoCUyMHZpdnJlJTJGMTAlMjBtaW51dGVzJTIww6AlMjB2aXZyZSUyRWF2aXM4CmZpbGVuYW1lczQwCjU5NGU3Y2FhZmE5Nzg2OTg4NGQ5ZTI5ZDBiZGYwNDBiNDI2YmMzOTNzOApwbGV4SGFzaHM3CjUwNTkwMDBzOApkdXJhdGlvbnM0CjU4MjJzMgppZHIwCg__

2012-12-03 03:24:27,000 (4292a490) : INFO (agentkit:914) - Searching for matches for {‘openSubtitlesHash’: ‘c61259f50b32c0b6’, ‘name’: ‘10 Minutes \xc3\xa0 Vivre’, ‘filename’: ‘%2Fvolume1%2Fvideo%2FFilms%2F10%20minutes%20\xc3\xa0%20vivre%2F10%20minutes%20\xc3\xa0%20vivre%2Eavi’, ‘plexHash’: ‘594e7caafa97869884d9e29d0bdf040b426bc393’, ‘duration’: ‘5059000’, ‘id’: ‘5822’}

2012-12-03 03:24:27,149 (4292a490) : DEBUG (networking:166) - Requesting ‘http://127.0.0.1:32400/library/metadata/5822/tree

2012-12-03 03:24:28,167 (4292a490) : INFO (init:15) - Searching

2012-12-03 03:24:28,268 (4292a490) : DEBUG (networking:166) - Requesting ‘http://localhost:32400/library/metadata/5822

2012-12-03 03:24:31,467 (42c18490) : DEBUG (services:362) - Loaded services

2012-12-03 03:24:32,100 (42f06490) : DEBUG (services:438) - No shared code to load

2012-12-03 03:24:50,313 (4292a490) : CRITICAL (agentkit:930) - Exception in the search function of agent named ‘XBMC .nfo Importer’, called with keyword arguments {‘openSubtitlesHash’: ‘c61259f50b32c0b6’, ‘name’: ‘10 Minutes \xc3\xa0 Vivre’, ‘filename’: ‘%2Fvolume1%2Fvideo%2FFilms%2F10%20minutes%20\xc3\xa0%20vivre%2F10%20minutes%20\xc3\xa0%20vivre%2Eavi’, ‘plexHash’: ‘594e7caafa97869884d9e29d0bdf040b426bc393’, ‘duration’: ‘5059000’, ‘id’: ‘5822’} (most recent call last):

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py”, line 923, in _search

agent.search(results, media, lang)

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/XBMC .nfo Importer.bundle/Contents/Code/init.py”, line 18, in search

xml = XML.ElementFromURL(pageUrl)

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/parsekit.py”, line 328, in ElementFromURL

method=method,

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/networkkit.py”, line 67, in _http_request

req = self._core.networking.http_request(url, *args, **kwargs)

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py”, line 416, in http_request

return HTTPRequest(self._core, url, data, h, url_cache, encoding, errors, timeout, immediate, sleep, opener, follow_redirects, method)

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py”, line 141, in init

self.load()

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py”, line 177, in load

f = self._opener.open(req, timeout=self._timeout)

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py”, line 438, in open

response = self._open(req, data)

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py”, line 456, in _open

‘_open’, req)

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py”, line 416, in _call_chain

result = func(*args)

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py”, line 1217, in http_open

return self.do_open(httplib.HTTPConnection, req)

File “/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py”, line 1192, in do_open

raise URLError(err)

URLError:



2012-12-03 03:24:50,476 (4292a490) : DEBUG (runtime:851) - Response: [200] str, 16 bytes

This tells me one of the URL in that NFO file is invalid. The script tries to fetch it, and it times out waiting for a response from the remote web server.


Thank’s a lot for your time and your so precious help.



Is it possible to modify something in your script or do I have to modify all my files to have no more such characters like “é,è,à,ô,ç,î,ï” ?



If the or paragraph contain same characters as “é,è,à,ô…” would it also be a problem or not ?



And last question : your script use “xpath” fonction. Do I need to install something else like a library to use your script with a SYNOLOGY with Python installed ?




Indeed, it’s not in the NFO, but this URL that fails to load:

http://localhost:32400/library/metadata/5822



This URL should return the metadata that Plex has for the 10 minutes à vivre movie. And it doesn’t load.

I just tried on my install, and have the same problem.

That URL is also used by the new web UI; trying to click on that movie in the web UI, you’ll probably receive an error, after waiting a while for that URL to load.

Not sure if this has been reported already, but it should be, if not.



*edit: Going back to PMS 0.9.6 should fix this: http://wiki.plexapp.com/index.php/Downloads