ZeroQI / YouTube-Agent.bundle

Plex Metadata Agent for Movies and TV Series libraries
463 stars 44 forks source link

Error updating metadata on mac #18

Closed Goluff closed 6 years ago

Goluff commented 6 years ago

I had an error with the agent writing the metadata, this was the error

2018-09-23 02:06:02,063 (70000d4c5000) : CRITICAL (agentkit:1078) - Exception in the update function of agent named 'YouTube', called with guid 'com.plexapp.agents.youtube://youtube|PL8dPuuaLjXtO4A_tL6DLZRotxEb114cMR|Engineering [PL8dPuuaLjXtO4A_tL6DLZRotxEb114cMR]?lang=xn' (most recent call last): File "/Applications/Plex Media Server.app/Contents/Resources/Plug-ins-10d48da0d/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1076, in _update agent.update(obj, media, lang, **kwargs) File "/Users/ericvachon/Library/Application Support/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 433, in update def update (self, metadata, media, lang, force ): Update (metadata, media, lang, force, False) File "/Users/ericvachon/Library/Application Support/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 225, in Update library, root, path = GetLibraryRootPath(dir) File "/Users/ericvachon/Library/Application Support/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 76, in GetLibraryRootPath with open(filename, 'r') as file: line=file.read() TypeError: bad argument type for built-in operation

This as been fixed by changing line 76 with open(filename, 'r') as file: line=file.read() with with open(filename, 'rb') as file: line=file.read()

If it helps someone. Now the agent is working correctly on mac.

ZeroQI commented 6 years ago

@Goluff Thanks a lot for the bug report and also for the fix. I will replace the line "with open(filename, 'rb') as file: line=file.read()" with simpler and more correct "line = Core.storage.load(filename)" which I should have used originally, discovered it after writing YouTube Agent, during Lambda agent more precisely. Please test and report as if this fails, will have to use your code however.