Plex PLAY_MEDIA

Yeah that’s the variable throwing the error; looks like this doesn’t have one for some reason?. I cut out the identical dict output just before the newly added print line:

Traceback (most recent call last):
  File "./cb-dump", line 16, in <module>
    print(f"Library Section: {episode.librarySectionID}")
  File "/usr/local/lib/python3.8/site-packages/plexapi/base.py", line 308, in __getattribute__
    self.reload()
  File "/usr/local/lib/python3.8/site-packages/plexapi/base.py", line 213, in reload
    self._loadData(data[0])
  File "/usr/local/lib/python3.8/site-packages/plexapi/video.py", line 712, in _loadData
    self.markers = self.findItems(data, media.Marker)
  File "/usr/local/lib/python3.8/site-packages/plexapi/base.py", line 186, in findItems
    item = self._buildItemOrNone(elem, cls, initpath)
  File "/usr/local/lib/python3.8/site-packages/plexapi/base.py", line 88, in _buildItemOrNone
    return self._buildItem(elem, cls, initpath)
  File "/usr/local/lib/python3.8/site-packages/plexapi/base.py", line 73, in _buildItem
    return cls(self._server, elem, initpath)
  File "/usr/local/lib/python3.8/site-packages/plexapi/base.py", line 49, in __init__
    self._loadData(data)
  File "/usr/local/lib/python3.8/site-packages/plexapi/media.py", line 711, in _loadData
    _tag, _id = self.filter.split('=')
AttributeError: 'NoneType' object has no attribute 'split'

To confirm, the “good” shows don’t throw this error with the test script?

That’s right - the other properly working ones return library sections IDs (“4”, to be specific) and don’t dump a traceback.

Okay, so that shows the root of the issue where incomplete data is being returned by the Plex server. This seems specific to the media itself, and probably not the API. However, it might be necessary to add a safeguard in the library in case this happens again.

Can you see if running “Refresh Metadata” on the show has any effect?

Yeah that’s what I suspected. Refreshed both the entire series and the specific episode, still missing the library section ID.

I’m not quite sure what might cause this. I’ve raised an issue in the plexapi repo to see if anyone else has an idea: https://github.com/pkkid/python-plexapi/issues/550.

@lidocaineus would you be able to help troubleshoot over on the github issue?

Yeah for sure, I’ll keep tabs on the GitHub issue and toss in as necessary; subscribing to it now.

1 Like

@lidocaineus this should (hopefully) be fixed in HA 0.115 with a bump to plexapi 4.1.0.