ZeroQI / YouTube-Agent.bundle

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

CRITICAL (agentkit:1018) - Exception in the search function of agent named 'YouTubeSeries', called with keyword arguments #149

Closed ntbritton closed 6 months ago

ntbritton commented 8 months ago

I am seeing the following in the log : com.plexapp.agents.youtube.log

It does not look like it should be normal.

2024-03-05 22:09:40,726 (7fadb79e9b38) : CRITICAL (agentkit:1018) - Exception in the search function of agent named 'YouTubeSeries', called with keyword arguments {'openSubtitlesHash': 'db7400311f17e936', 'name': 'how-vertebrates-got-teeth-and-lost-them-again--2022-02-08--eons--IHMHPjPZIUI-- -vp09-opus-- --1080p', 'episodic': '1', 'show': None, 'released_at': '2022-02-08', 'season': '2022', 'plexHash': '37275e23a07a6ebda7e2bb424fe84d18b6d96800', 'filename': '%2Fdata%2Fmedia%2Ftubesync%2Fdownloads%2Fvideo%2Ftest2%2Fhow-vertebrates-got-teeth-and-lost-them-again--2022-02-08--eons--IHMHPjPZIUI--1080p-vp09-opus--WEBDL--1080p%2Emkv', 'year': '2022', 'duration': '580408', 'id': '88181'} (most recent call last): File "/usr/lib/plexmediaserver/Resources/Plug-ins-c29d4c0c8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1011, in _search agent.search(*f_args, **f_kwargs) File "/apps/plex/plexmediaserver/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/init.py", line 617, in search def search (self, results, media, lang, manual): Search (results, media, lang, manual, False) File "/apps/plex/plexmediaserver/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/init.py", line 158, in Search displayname = sanitize_path(os.path.basename(media.name if movie else media.show)) File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/posixpath.py", line 114, in basename i = p.rfind('/') + 1 AttributeError: 'NoneType' object has no attribute 'rfind'

ZeroQI commented 8 months ago

File "/apps/plex/plexmediaserver/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/init.py", line 158, in Search displayname = sanitize_path(os.path.basename(media.name if movie else media.show))

Media.show is None triggering an error, and should not be empty

Replace line 158 with the below and repirt sanitize_path(os.path.basename((media.name if movie else media.show) or "") )

ZeroQI commented 6 months ago

Did it work?