Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Metadata agents for exported XBMC library

1235775

Comments

  • alex_m74@hotmail.comalex_m74@hotmail.com Posts: 14Members ✭✭

    ok scan complete now everything seems to work exept : the tv show season pictures aren't displayed all episodes searies pics are working well but the other dont

    someone with the same problem ??? i am using plex 9.6.5

    tx seppl


    I have the same problem here... fresh install of PMS (0.9.6.3) on Windows 7 x64, using the latest XBMC plugins. Getting the exception below:

    2012-07-16 17:50:51,467 (ca4) :  CRITICAL (core:541) - Exception in the search function of agent named 'XBMC TV .nfo Importer', called with keyword arguments {'openSubtitlesHash': '39c598f1e720a1fa', 'episode': '4', 'episodic': '1', 'show': 'Anger Management', 'season': '1', 'filename': '%5C%5Cnas-tak%5CMedia%5CTV%20Series%5CAnger%20Management%5CSeason%2001%5CAnger%20Management%20-%20s01e04%20-%20Charlie%20and%20Kate%20Battle%20Over%20a%20Patient%2Emkv', 'plexHash': 'e4c791adf3b2792ec9466de11508d81763f27de8', 'duration': '1285664', 'id': '388'} (most recent call last):
      File "C:\Users\ardm\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 918, in _search
        agent.search(results, media, lang)
      File "C:\Users\ardm\AppData\Local\Plex Media Server\Plug-ins\XBMCnfoTV.bundle\Contents\Code\__init__.py", line 25, in search
        path = os.path.dirname(path1)
    AttributeError: 'module' object has no attribute 'path'
    


    Strangely enough, this used to work not long ago, with the same version of Plex; I recently reformatted my PC and reinstalled Win7 on it. But previously I had a lot of other applications installed on there, so not sure if some other installation provided different Python libraries to Plex (though I don't see how that could make much of a difference if Plex is self-contained). Also, same/similar version of Plex on a different device (Synology DS1812+) is working fine - version reported there is 0.9.6.3.143-4466fb5.

    I'll tinker with this when I get home later, hopefully we'll figure it out!

    -Alex

    P.S. Guillaume: great job with these plugins! I wouldn't be using Plex if it weren't for these... :)
  • WurtzelSeppWurtzelSepp Posts: 12Members
    exact mine error hope for an solution too (getting this error again)

    so i figured out that u can select the localmediaagent in the xmbnfo agents tab when u modify the ...\AppData\Local\Plex Media Server\Plug-ins\LocalMedia.bundle\Contents\Code\init.py thing like said in the previous posts
    also i created an

    ...\AppData\Local\Plex Media Server\Plug-in Support\Metadata Combination\com.plexapp.agents.xbmcnfo
    and
    ...\AppData\Local\Plex Media Server\Plug-in Support\Metadata Combination\com.plexapp.agents.xbmcnfotv
    folder qithe the xml files in it but it still doesent work and got the error logged that u described
  • alex_m74@hotmail.comalex_m74@hotmail.com Posts: 14Members ✭✭
    Quick update - I uninstalled Plex, completely cleared the local cache folders (everything in ...\AppData\Local\Plex Media Server), and reinstalled it. Seems to be working fine now, though I still have no idea why it wasn't working the first time round...

    I created a folder which has a small subset of TV shows for it to process for testing, so now to try it with my main library - hopefully I won't have any issues this time round!
  • WurtzelSeppWurtzelSepp Posts: 12Members
    same i described in my last posts worked for about an day added then a few folders and got same error again but i dont want to reinstall complete-delete all i got to get new titles working

    so i think u will get this error again after a few reboots and updates of ur folder
  • alex_m74@hotmail.comalex_m74@hotmail.com Posts: 14Members ✭✭
    Yup, same here - I spoke too soon! It's not working anymore, this is weird :(
  • WurtzelSeppWurtzelSepp Posts: 12Members
    jea but i dont get what is the problem of this mistirious line of code ... thought maybe an python problem so reinstalled python but doesnt make any difference
  • gboudreaugboudreau Posts: 89Members, Plex Pass Plex Pass
    That looks like a problem with Windows only, as I've never seen it myself, and I'm on Mac, and you both are on Windows.

    If you are willing, I could connect remotely and try to see what is going on.
    Just install TeamViewer from http://help.danslereseau.com/, and PM me your ID and password. I should connect with a few minutes.

    While you wait for me to connect, please open the log file that shows the error, and everything I need to reproduce it (whatever you use to initiate a refresh of a section I guess).
    Also open C:\Users\<username>\AppData\Local\Plex Media Server\Plug-ins\XBMCnfoTV.bundle\Contents\Code\__init__.py in a text editor.
  • alex_m74@hotmail.comalex_m74@hotmail.com Posts: 14Members ✭✭
    Guillaume,

    I think I figured it out, though what is going on is still a bit of a mystery to me... perhaps someone with more Python knowledge than my non-existent one can help get to the bottom of it!

    After some reading (Google was indeed my friend), I traced the problem to the "imports" directive you're using in the plugin packages. I replaced:
    import os, re, os.path, time, datetime
    

    with:
    import os, re, time, datetime
    

    (remove the "os.path" import)

    ... and hey presto, it works! :D

    Now it seems that the folks over at stackoverflow have differing opinions over whether to import just "os" or "os.path" too: http://stackoverflow.com/questions/2724348/should-i-use-import-os-path-or-import-os

    It may be that some Plex module on the Windows installation has a conflicting namespace to "os.path" and something weird happens due to that?

    Anyway, I removed "os.path" from the import line for both TV and movie plugins, and they're working fine for me now... but definitely worth investigating further, so my offer for the Team Viewer session still stands; I'm logging off now, but we could arrange it some other time (and let's hope that reintroducing "os.path" breaks it again, otherwise we won't be able to reproduce this!)

    For now, I'm going to clean Plex and get it to rescan my entire library - will let you know if anything else crops up...

    @WurtzelSepp: FYI the file you need to edit is "__init__.py" in each of the two plugin bundle folders - let us know if this works for you too.

    -Alex
  • gboudreaugboudreau Posts: 89Members, Plex Pass Plex Pass

    After some reading (Google was indeed my friend), I traced the problem to the "imports" directive you're using in the plugin packages. I replaced:
    import os, re, os.path, time, datetime
    

    with:
    import os, re, time, datetime
    

    (remove the "os.path" import)

    ... and hey presto, it works! :D

    Nice find!

    I committed that change to both plugins in Github, so the original download links now contain this change. Re-downloading the plugins should fix this for anyone who had this problem.

    If you could, could you try to reproduce the issue, by re-adding os.path, then try if removing os instead of os.path also resolves the issue?
    I'd prefer to keep os.path, since it's the only thing I use, and do away with the os import that would mess things up.

    Thanks.
  • TheLexusTheLexus Posts: 28Members, Plex Pass
    The newest version without os.path seems to make the plugin working under linux too. Well.

    But if i cange the <moviename>.tbn file the poster image seems not to be updated, at least in the web media manager. The xbmcnfo log tells me that the metadata was updated and the poster was found, but it seems not to be changed...
  • TheLexusTheLexus Posts: 28Members, Plex Pass
    I tried to only use os.path, but this does not work. At least if its the first import. Ive got an error on

    File "/nas/var/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 966, in _update
        agent.update(obj, media, lang)
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/XBMCnfoImporter.bundle/Contents/Code/__init__.py", line 78, in update
        if os.path.exists(posterFilename):
    AttributeError: 'module' object has no attribute 'path'
    
  • gboudreaugboudreau Posts: 89Members, Plex Pass Plex Pass
    TheLexus wrote:

    I tried to only use os.path, but this does not work. At least if its the first import. Ive got an error on

    File "/nas/var/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 966, in _update
        agent.update(obj, media, lang)
      File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/XBMCnfoImporter.bundle/Contents/Code/__init__.py", line 78, in update
        if os.path.exists(posterFilename):
    AttributeError: 'module' object has no attribute 'path'
    


    Thanks for the confirmation; I'll leave the plugins as-is then.
  • TheLexusTheLexus Posts: 28Members, Plex Pass
    edited July 2012
    I have found another bug, or problem. I have movie filenames that contains umlauts like (ä,ö) which are fine for xbmc (for example). But the os.path.exists part of xbmcnfo gets an UnicodeEncodeError. It seems the string that contains the path from the Plex XML is not encoded using the filesystem (or locale) encoding. Its set to de_DE.UTF-8 on my system.

    I tried to use the encoding parameter of XML.ElementFromURL function without success. Cant tell exactly where the problem is.

    Seems to be related to: http://forums.plexapp.com/index.php/topic/26764-cant-add-movies-error-in-plex-movie-scannerpy/page__gopid__280176#entry280176
  • TheLexusTheLexus Posts: 28Members, Plex Pass
    Maybe i found a fix, can someone please test?

    I changed

    path1 = String.Unquote(nfoXML.get('file'))
    


    to

    path1 = String.Unquote(nfoXML.get('file')).encode('utf-8')
    
  • cristianofigueiracristianofigueira Posts: 4Members
    Thank you for your scrapper. Do you have any plans for adding external subtitles support? When I use the "XBMC .nfo importer" option, my Plex app doesn't recognize .srt subtitles...
  • cristianofigueiracristianofigueira Posts: 4Members
    edited August 2012
    I used this old version of your scrapper before and it supports .srt subtitles. However, it didn't support series (only movies)...
  • gboudreaugboudreau Posts: 89Members, Plex Pass Plex Pass

    Thank you for your scrapper. Do you have any plans for adding external subtitles support? When I use the "XBMC .nfo importer" option, my Plex app doesn't recognize .srt subtitles...

    Metadata agents don't handle subtitles. Subtitles are handled separately, using the settings that you configure in the Plex Media Server preferences.
    You should start a new thread in the appropriate forum to get help with your subtitles. I'd guess here: http://forums.plexapp.com/index.php/forum/2-plex-media-server/
  • cristianofigueiracristianofigueira Posts: 4Members

    Metadata agents don't handle subtitles. Subtitles are handled separately, using the settings that you configure in the Plex Media Server preferences.
    You should start a new thread in the appropriate forum to get help with your subtitles. I'd guess here: http://forums.plexapp.com/index.php/forum/2-plex-media-server/

    Thank you for your help. I think the 9.6.7 update broke the subtitles support, as reported by other users. I will reinstall an older version until that issue is fixed.
  • cristianofigueiracristianofigueira Posts: 4Members
    edited August 2012
    One more thing: could you please add support to the "Local Media Assets (TV)" and "Local Media Assets" options into the "XBMC .nfo importer" settings in Plex Server? I think it could help too...
  • myhtpcmyhtpc Posts: 96Members, Plex Pass Plex Pass
    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:
    2012-09-15 08:35:05,750 (18e0) : INFO (logkit:16) - Looking for Movie NFO file at F:\Videos\Filme\Eineinhalb Ritter\Eineinhalb Ritter.nfo
    2012-09-15 08:35:05,753 (18e0) : CRITICAL (core:561) - Exception in the search function of agent named 'XBMC .nfo Importer', called with keyword arguments {'openSubtitlesHash': 'dfea512ab562a354', 'name': 'Eineinhalb Ritter', 'filename': 'F:%5CVideos%5CFilme%5CEineinhalb%20Ritter%5CEineinhalb%20Ritter%2Emkv', 'plexHash': '053c36957a6db73b5a7710fe3482d639839a283e', 'duration': '6913792', 'id': '837'} (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 918, 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 25, in search
    if not os.path.exists(nfoFile):
    AttributeError: 'module' object has no attribute 'path'

    2012-09-15 08:35:05,756 (18e0) : DEBUG (runtime:843) - Response: [200] str, 16 bytes


    The file exists.

    Do you have any ideas?
Sign In or Register to comment.