Metadata agents for exported XBMC library

Hi! i have tried to add the "XBMCnfoImporter.bundle" folder on the path "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins" but the option for the XBMC agent is not avaliable. My Plex version is 9.7.17.

Hi!

That is the wrong path, you need C:\Users\\AppData\Local\Plex Media Server\Plug-ins

The easiest way to get there quick is to right-click on the PMS icon in your system tray and choose the "Open Plug-ins folder" option:

screenshot20121221at161.jpg

Can  anyone tells me what I should have in an nfo file to get this metadata agent working for series which are not on the TVdb with only 2 things:

Resume/Plot of the Episode

Actors Names

The name is directly taken from the file name added to library, the show/art are in the folder so i only need these 2 fields and it would be easier for me to make an nfo while I'm downloading the file.

I have no experience at all in XBMC and tried to find clues but all nfo I create end up not being taken by the agent so I need the exact structure to fill my 2 fields.

Hi!

That is the wrong path, you need C:\Users\\AppData\Local\Plex Media Server\Plug-ins

The easiest way to get there quick is to right-click on the PMS icon in your system tray and choose the "Open Plug-ins folder" option:

screenshot20121221at161.jpg

Thanks! Now it works fine! ...
 
... But now i have a problem with the metadata update. I already have done "Force Update", but it just update fanart and the poster. Then, I needed to edit movie by movie and fix manually with the option "Matching Using.. -> XMBCnfoImporter", then it works! Any sugestion for this issue?
 
I see which some users can access the log of the PMS... How i can access it? I'm developer too and i wish to contribute!

Thanks! Now it works fine! ...
 
... But now i have a problem with the metadata update. I already have done "Force Update", but it just update fanart and the poster. Then, I needed to edit movie by movie and fix manually with the option "Matching Using.. -> XMBCnfoImporter", then it works! Any sugestion for this issue?
 
I see which some users can access the log of the PMS... How i can access it? I'm developer too and i wish to contribute!

Hi!

After you've installed this new agent, you need to edit any existing section (or when creating a new section) and set select the XBMC .nfo Importer Agent from the dropdown:

screenshot20130323at175.jpg

All,

I am having similar problems getting the XBMC .nfo Importer metadata agent to run against a large library of titles (2,500 titles broken up by chapter into 10,000+ movies). Here is how I have my library structured:

Movies

            > Title 1

                      > Title 1 [Chapter 1]

                      > Title 1 [Chapter 2]

            > Title 2

                      > Title 2 [Chapter 1]

                      > Title 2 [Chapter 2]

            etc...

The thing is, if I copy a couple of the titles out to a separate "test" folder and create a new section using that "test" folder everything will work correctly. When I create a section pointing to my "movies" folder the XBMC .nfo Importer metadata agent will not run. I have tried this a couple of times using the suggested settings:

Scanner: Plex Movie Scanner

Agent: XBMC .nfo Importer

Language: None

A couple of things to note, when I point to my smaller "test" folder everything works and a log is created for the XBMC .nfo Importer metadata agent in the logs directory. If I point to my larger "movies" folder, no log is created. It seems like PLEX is importing my files but not triggering the metadata agent. The other odd thing I noticed is that PLEX is not picking up all of the items it should. Sometimes it will pull in 800-900 and sometimes it will pull in 4,000 when it should be pulling in around 10,000 items. When my content is indexed by XBMC every single item is indexed so I don't think it could be an issue with file name lengths or general corruption of the volume. I have done checks on the volume for consistency and corruption and all checks pass with flying colors.

I can do as the previous poster (emannuelbs) does and update the titles one by one and the metadata from the NFO file will be read an imported. But the "Force Update" option on the whole section does not work. Is there possibly a limit to the depth, breadth or size of a library that PLEX can handle?

Any help is much appreciated!

Guillaume, thanks for this,

Movies worked perfectly, TV shows only picked up names.

The xbmcnfotv log showed a critical error with updating:

************

2013-04-03 03:09:40,621 (1bb8) :  CRITICAL (core:561) - Exception in the update function of agent named 'XBMC TV .nfo Importer', called with guid 'com.plexapp.agents.xbmcnfotv://83246?lang=xn' (most recent call last):
  File "C:\Users\Peter\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 971, in _update
    agent.update(obj, media, lang)
  File "C:\Users\Peter\AppData\Local\Plex Media Server\Plug-ins\XBMCnfoTV.bundle\Contents\Code\__init__.py", line 86, in update
    path1 = media.items[0].parts[0].file
  File "C:\Users\Peter\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 110, in
    _getitem_           = lambda x, y: x.__getitem__(y),
IndexError: list index out of range

************

Can anyone tell me why this is happening, how I can fix it.

thanks everyone who contributed to this work of art.

I've heard that a "list index out of range" error in python usually means that the index wasn't there at all.

So, pardon my ignorance, but what is the index referred to in this code

thanks for any help, Peter

Woops, sorry, I just found Ileone's post with the same problem, and his solution in post #168.

Still having the same problems as inanimated refers to in post #171 however.

Shall persist, and let the forum know if I find anything useful.

thanks again for the code, everyone involved.

P

I am having the same issues as the others, it works with movies, but doesn't work with TV.

it scans tv, and only uses the names from the nfo, if i manually go to an item and click "unmatch" it'll find the backdrop and dvd cover, but nothing else.

screenshot033u.png

 am having the same issues as the others, it works with movies, but doesn't work with TV.

it scans tv, and only uses the names from the nfo, if i manually go to an item and click "unmatch" it'll find the backdrop and dvd cover, but nothing else.

Yeah,

this is a known Bug. It seems that no developer (including me) actually got the time to fix this. You may use a slightly older build.

https://github.com/gboudreau/XBMC-TVShows-Metadata-Agent-for-Plex/tree/20ad6f7bd65ffcea677edf615cd8f5f92ec9a00d

Execpt some NAS Devices this version will work on Linux, Max and Windows.

Just tried putting in the latest movies agent from git hub.  Then I take an existing movie that has a name but no other details - unmatch it, then match it using the NFO agent (is that an ok way to do it?)

I've been getting the following error:

2013-04-10 08:48:56,548 (3fd4) :  INFO (agentkit:914) - Searching for matches for {'year': '2010', 'id': '12018', 'name': 'Elmos Animal Adventures'}
2013-04-10 08:48:56,549 (3fd4) :  DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/library/metadata/12018/tree'
2013-04-10 08:48:56,556 (3fd4) :  INFO (logkit:16) - Searching
2013-04-10 08:48:56,556 (3fd4) :  CRITICAL (core:561) - Exception in the search function of agent named 'XBMC .nfo Importer', called with keyword arguments {'year': '2010', 'id': '12018', 'name': 'Elmos Animal Adventures'} (most recent call last):
  File "C:\Users\Administrator\AppData\Local\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 "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\XBMC.nfo Importer.bundle\Contents\Code\__init__.py", line 18, in search
    path1 = String.Unquote(media.filename)
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\utilkit.py", line 252, in Unquote
    return urllib.unquote(s)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python26.zip\urllib.py", line 1170, in unquote
    res = s.split('%')
AttributeError: 'NoneType' object has no attribute 'split'

2013-04-10 08:49:01,105 (3cbc) : INFO (agentkit:914) - Searching for matches for {‘openSubtitlesHash’: ‘5c69e15c8aebb2cf’, ‘name’: ‘Elmos Animal Adventures’, ‘plexHash’: ‘225adb7690282efe891b9a1e3b4483077f9d07f8’, ‘filename’: ‘%5C%5Caragorn%5Cvideos%5CE%5CElmos%2EAnimal%2EAdventures%2E(2009)%2Eavi’, ‘year’: ‘2009’, ‘duration’: ‘3073000’, ‘guid’: ‘tt1775323’, ‘id’: ‘12018’}
2013-04-10 08:49:01,105 (3cbc) : DEBUG (networking:172) - Requesting ‘http://127.0.0.1:32400/library/metadata/12018/tree
2013-04-10 08:49:01,114 (3cbc) : INFO (logkit:16) - Searching
2013-04-10 08:49:01,114 (3cbc) : INFO (logkit:16) - Looking for Movie NFO file at \aragorn\videos\E\Elmos.Animal.Adventures.(2009).nfo
2013-04-10 08:49:01,121 (3cbc) : INFO (logkit:16) - Found movie information in NFO file: title = Elmo’s Animal Adventures, year = 2009, id = tt1775323
2013-04-10 08:49:01,122 (3cbc) : DEBUG (runtime:896) - Response: [200] str, 656 bytes

Just tried putting in the latest movies agent from git hub.  Then I take an existing movie that has a name but no other details - unmatch it, then match it using the NFO agent (is that an ok way to do it?)

I've been getting the following error:

You should better use a completly new library scanned only with this agent. 

Please could you send me your nfo file so i may check this. The last recent Movie Agent worked well for me. (About 700 Movies)

But i've never did it this way.

EDIT: Since i've updated my Plex Server i've also get this error mostly with new Movies.

Also i get Exceptions from python.

2013-04-10 09:07:39,078 (974) :  DEBUG (model:223) - Deserializing from C:\Users\Administrator\AppData\Local\Plex Media Server\Metadata\Movies\e\6ba2ce11461a8d70f14559ef232621834d5d95d.bundle\Contents\com.plexapp.agents.xbmcnfo\Info.xml
2013-04-10 09:07:39,082 (18c0) :  DEBUG (model:223) - Deserializing from C:\Users\Administrator\AppData\Local\Plex Media Server\Metadata\Movies\4\e0218be0382af3250899f9a8e767c03010a5b72.bundle\Contents\com.plexapp.agents.xbmcnfo\Info.xml
2013-04-10 09:07:39,082 (1b04) :  DEBUG (model:223) - Deserializing from C:\Users\Administrator\AppData\Local\Plex Media Server\Metadata\Movies\1\8d4587e00304b00aacb9625737ef3eb035b8b36.bundle\Contents\com.plexapp.agents.xbmcnfo\Info.xml
2013-04-10 09:07:39,157 (1b04) :  CRITICAL (core:561) - Exception deserializing Movie with guid 'com.plexapp.agents.xbmcnfo://tt0120611?lang=xn' (C:\Users\Administrator\AppData\Local\Plex Media Server\Metadata\Movies\1\8d4587e00304b00aacb9625737ef3eb035b8b36.bundle\Contents\com.plexapp.agents.xbmcnfo) (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\model.py", line 191, in _read
    try: self._deserialize(path)
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\model.py", line 237, in _deserialize
    attr._deserialize(os.path.join(path, attr_el.tag), attr_el)
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\attributes.py", line 199, in _deserialize
    self._value = datetime.datetime.strptime(content_str, "%Y-%m-%d").date()
AttributeError: _strptime

2013-04-10 09:07:39,163 (1b04) :  DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/library/metadata/48507/tree'
2013-04-10 09:07:39,217 (18c0) :  DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/library/metadata/48508/tree'
2013-04-10 09:07:39,217 (974) :  DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/library/metadata/48509/tree'
2013-04-10 09:07:39,678 (1b04) :  INFO (logkit:16) - Found poster image at E:\Test Bib\Blade A3\Blade (1998)\Blade (1998).tbn

Yeah,
 
this is a known Bug. It seems that no developer (including me) actually got the time to fix this. You may use a slightly older build.
 
https://github.com/gboudreau/XBMC-TVShows-Metadata-Agent-for-Plex/tree/20ad6f7bd65ffcea677edf615cd8f5f92ec9a00d


Execpt some NAS Devices this version will work on Linux, Max and Windows.


Thanks for the info, ill try an older version when I get home.

Also an unrelated question, is it possible to add tv and movies into the same category?

I have some documentaries, but some are movies and others are series and i would prefer it in the same category instead of having one for movies and one for tv.

Thanks for the info, ill try an older version when I get home.

Also an unrelated question, is it possible to add tv and movies into the same category?

I have some documentaries, but some are movies and others are series and i would prefer it in the same category instead of having one for movies and one for tv.

This isn't direct possible with this meta agent. i've had a similar problem with anime (OVA, movie and series) OVAs and Movies were faked as "Season 00" and "Showname - S00E00 - Moviename".

if you got more specific questions related to this topic i would ask you to use another more related thread.

This isn't direct possible with this meta agent. i've had a similar problem with anime (OVA, movie and series) OVAs and Movies were faked as "Season 00" and "Showname - S00E00 - Moviename".

if you got more specific questions related to this topic i would ask you to use another more related thread.

ok, so ill have to keep them seperate.

But i have it mostly working, except it doesnt load thew background/fanart

my naming scheme is like this

/Seriesname

- Season 01
- tvshow.nfo

season-all-poster.jpg
- fanart.jpg
season01.tbn

**Edit

I got it working now, after going through most of the pages i found this

http://forums.plexapp.com/index.php/topic/38402-metadata-agents-for-exported-xbmc-library/page-4#entry277833

I successfully used the movies agent to import all the info from the nfos and use the local artwork.

I've been going through trying to fix a few covers and fanarts. The images I stored locally for some films had foreign covers. Rather than fix them through the Plex interface I though it best to fix the local info. That way it'll always be right in the future in case I need to delete and start again at some point.

I've now replaced the jpgs and told Plex to refresh but it doesn't grab the new image.

I've changed some info in the nfo's and when I refresh, Plex picks up the changes but images are stuck with the original images that the agent found.

Is my only option to wait until I fix all my films then delete and scan again?

I also tried 'unmatching' a film in the hope I could rematch it but now it doesn't find a match... though it shows the correct images but no info :(

Any ideas?

I successfully used the movies agent to import all the info from the nfos and use the local artwork.

I've been going through trying to fix a few covers and fanarts. The images I stored locally for some films had foreign covers. Rather than fix them through the Plex interface I though it best to fix the local info. That way it'll always be right in the future in case I need to delete and start again at some point.

I've now replaced the jpgs and told Plex to refresh but it doesn't grab the new image.

I've changed some info in the nfo's and when I refresh, Plex picks up the changes but images are stuck with the original images that the agent found.

Is my only option to wait until I fix all my films then delete and scan again?

I also tried 'unmatching' a film in the hope I could rematch it but now it doesn't find a match... though it shows the correct images but no info :(

Any ideas?

Have you tried a force refresh?

Another option would be to delete your library and scan it again. if you only use local stuff for information this will be very fast

I think I may be able to shed some light on the subject.If you look at:Library/Application Support/Plex Media Server/Plug-ins/LocalMedia.bundle/Contents/Code/__init__.py(or its equivalent on windows, C:\Users\\AppData\Local\Plex Media Server\Plug-ins\...)you will find two troubling lines:

class localMediaMovie(Agent.Movies):
  name = 'Local Media Assets (Movies)'
...
  contributes_to = ['com.plexapp.agents.imdb', 'com.plexapp.agents.none']
and
class localMediaTV(Agent.TV_Shows):
  name = 'Local Media Assets (TV)'
...
  contributes_to = ['com.plexapp.agents.thetvdb', 'com.plexapp.agents.none']
In a nutshell, it won't send contribute metadata to the xbmc import method any more. Nothing you do to Movies.xml or TV_Shows.xml is going to connect the two any more and "Local" will never appear. Presumably something has changed in later versions of Plex, and the metadata graph is built dynamically now.On my copy, I changed the first so that:
contributes_to = ['com.plexapp.agents.imdb', 'com.plexapp.agents.xbmcnfo', 'com.plexapp.agents.none']
and the second:
contributes_to = ['com.plexapp.agents.thetvdb', 'com.plexapp.agents.xbmcnfotv', 'com.plexapp.agents.none']
With this change I was able to see the "Local Media(TV)" and "Local Media(Movies)" on the preferences dialog for the metadata. You can check the box and make sure they're moved above XBMC.Repeat.. the change was to LocalMedia.bundle and not the xbmc agent plugins!My main interest is to avoid a duplicate thetvdb.com lookup for a large media library. I already have a complete set of local metadata so it's wasteful to have Plex re-query and download the data again. Particularly when thetvdb.com is melting or having serious issues.I can tell that it's working because of differences in the gathered metadata. eg: no paragraph breaks in descriptive text or missing genre/rating data. My XMBC source data is missing season thumbnails for some shows only, and they don't show up when imported to plex.I'm not entirely sure if that's an 'export to xbmc' issue or something else. I'm looking into it.

I've used that method but the changes to the ini.py files do not stick. I make the changes, refresh and/or scan and it works ell...then I come back a few days later and the ini.py file has reverted to the previous version...so I have to apply the code changes again...Anyway we can make the changes to stick so I won't have to patcn that file every few days?. BTW I'm on a win 7 machine using the last posted version of PMS...

Thanks

Have you tried a force refresh?

Another option would be to delete your library and scan it again. if you only use local stuff for information this will be very fast

Yes I tried a forced refresh but it didn't help. Delete and rescan is an option but a bit of a pain in the ass if further down the line I notice another change required but if that's the only option it will have to do

Hey

just tried your meta-data-scanner wanted to tell you that you did a great job
and i really appreciate your work.

I wouldn´t have made this post but when I saw that only a few people were
able to hit the "like this" button I kind of had to write this.

It´s a shame for a thread with 10 pages.

Anyway you should know that there are actually people out there who are
absolutely happy you wrote this.

so a big THANK YOU you saved me from ours of work

sincerely freude