Closed Fribb closed 4 years ago
After the displaying of the thumb line [199] it seems a call is done to tge same dict using 'standard' key line [200] for the poster and 'standard' is not defined in the JSON. I would need the content of that log and/or the full log as this is all i can do on my phone at tge moment.
I've noticed this happening every once in a while too...can't find any rhyme or reason to it though. Whenever it fails on the video thumbnail, it also fails on the rating, tags, "director", genres and the year. However the title, summary and originally_available_at do manage to get pulled successfully.
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/u4DKKDS4k20/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/u4DKKDS4k20/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/u4DKKDS4k20/hqdefault.jpg",
"width": 480,
"height": 360
}
},
Need to use Dict(video_details, 'snippet', 'thumbnails', 'default', 'url') or Dict(video_details, 'snippet', 'thumbnails', 'high', 'url') or Dict(video_details, 'snippet', 'thumbnails', 'standard', 'url') on the line calling the 'standard' dict key on thumbnail or powter
The rest of my stuff matched up now...thanks for the fix!
changed that in line 445 but still get the error in a different line
Line 200: poster = video_details['snippet']['thumbnails']['standard']['url']; Log('poster: "{}"'.format(thumb))
@Fribb which line?
While looking through the log files, it seems that happens in different lines
__init__.py, line 257
2020-01-08 00:08:02,020 (149f8a639700) : CRITICAL (agentkit:1091) - Exception in the update function of agent named 'YouTubeMovie', called with guid 'com.plexapp.agents.youtube://youtube|Toa3Kk1fQkE|youtube?lang=xn' (most recent call last):
File "/usr/lib/plexmediaserver/Resources/Plug-ins-ac2afe5f8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1089, in _update
agent.update(obj, media, lang, **kwargs)
File "/config/Library/Application Support/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 484, in update
def update (self, metadata, media, lang, force ): Update (metadata, media, lang, force, True)
File "/config/Library/Application Support/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 257, in Update
else: Log.Info("Grouping folder not found or single folder, root: {}, path: {}, Grouping folder: {}, subdirs: {}, reverse_path: {}".format(root, path, os.path.basename(series_root_folder), subfolder_count, reverse_path))
File "/usr/lib/plexmediaserver/Resources/Plug-ins-ac2afe5f8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 108, in <lambda>
_getitem_ = lambda x, y: x.__getitem__(y),
KeyError: 'standard'
__init__.py, line 200
2020-01-07 20:16:13,069 (148bf3bfd700) : CRITICAL (agentkit:1091) - Exception in the update function of agent named 'YouTubeMovie', called with guid 'com.plexapp.agents.youtube://youtube|_xoMt4H4jjQ|youtube?lang=xn' (most recent call last):
File "/usr/lib/plexmediaserver/Resources/Plug-ins-ac2afe5f8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1089, in _update
agent.update(obj, media, lang, **kwargs)
File "/config/Library/Application Support/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 484, in update
def update (self, metadata, media, lang, force ): Update (metadata, media, lang, force, True)
File "/config/Library/Application Support/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 200, in Update
poster = video_details['snippet']['thumbnails']['standard']['url']; Log('poster: "{}"'.format(thumb))
File "/usr/lib/plexmediaserver/Resources/Plug-ins-ac2afe5f8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 108, in <lambda>
_getitem_ = lambda x, y: x.__getitem__(y),
KeyError: 'standard'
__init__.py, line 249
2020-01-07 17:07:18,929 (14bbcc85e700) : CRITICAL (agentkit:1091) - Exception in the update function of agent named 'YouTubeMovie', called with guid 'com.plexapp.agents.youtube://youtube|_xoMt4H4jjQ|youtube?lang=xn' (most recent call last):
File "/usr/lib/plexmediaserver/Resources/Plug-ins-ac2afe5f8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1089, in _update
agent.update(obj, media, lang, **kwargs)
File "/config/Library/Application Support/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 484, in update
def update (self, metadata, media, lang, force ): Update (metadata, media, lang, force, True)
File "/config/Library/Application Support/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 249, in Update
if rx!=SEASON_RX[-1] and len(reverse_path)>=2 and folder==reverse_path[-2]: season_folder_first = True
File "/usr/lib/plexmediaserver/Resources/Plug-ins-ac2afe5f8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 108, in <lambda>
_getitem_ = lambda x, y: x.__getitem__(y),
KeyError: 'standard'
Plex in unreliable when reporting offending lines.
You need to use Dict(video_details, 'snippet', 'thumbnails', 'default', 'url') or Dict(video_details, 'snippet', 'thumbnails', 'high', 'url') or Dict(video_details, 'snippet', 'thumbnails', 'standard', 'url')
on the lines calling the 'standard' dict key (lines 200, 336, 421, 444) instead of video_details['snippet']['thumbnails']['standard']['url']
line 200.
I have submitted a fix to solve. Please reply if issue not resolved.
You have committed a syntax error on that line.
You added
poster = Dict(video_details, 'snippet', 'thumbnails', 'default', 'url') or Dict(video_details, 'snippet', 'thumbnails', 'high', 'url') or Dict(video_details, 'snippet', 'thumbnails', 'standard', 'url')
on the lines calling the 'standard' dict key (lines 200, 336, 421, 444) instead of video_details['snippet']['thumbnails']['standard']['url']; Log('poster: "{}"'.format(thumb))
while it should have been
poster = Dict(video_details, 'snippet', 'thumbnails', 'default', 'url') or Dict(video_details, 'snippet', 'thumbnails', 'high', 'url') or Dict(video_details, 'snippet', 'thumbnails', 'standard', 'url'); Log('poster: "{}"'.format(thumb))
with that, I have no errors. Yet. I will monitor this and let you know if I get anything else.
Thanks for letting me know. That should be fixed now
The Agent is downloading date, description and title fine but seems to have troubles downloading the video thumbnail.