Unable to use YouTube add-on due to Python errro

I have the YouTube add-on installed, I am logged in with the proper API keys in place. Everything was working fine for at least 10 days after setup and then I started getting errors whenever I use any feature of YouTube. I cannot do searches, watch content saved to Watch Later or videos in History. I saved the error log and I have pasted the portion I thought was relevant below. I dont see a way to attach the entire error log or I would have.

T:1542447840 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<–

  • NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
    Error Type: <type ‘exceptions.ValueError’>
    Error Contents: time data u’2020-04-18T02:29:28Z’ does not match format ‘%Y-%m-%dT%H:%M:%S.%fZ’
    Traceback (most recent call last):
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/default.py”, line 15, in
    runner.run(provider)
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/runner.py”, line 60, in run
    RUNNER.run(provider, context)
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/impl/xbmc/xbmc_runner.py”, line 33, in run
    results = provider.navigate(context)
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/abstract_provider.py”, line 100, in navigate
    result = method(context, re_match)
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/register_provider_path.py”, line 19, in wrapper
    return func(*args, **kwargs)
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/provider.py”, line 464, in _on_channel_playlist
    result.extend(v3.response_to_items(self, context, json_data))
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/v3.py”, line 269, in response_to_items
    result.extend(_process_list_response(provider, context, json_data))
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/v3.py”, line 253, in _process_list_response
    live_details=is_upcoming, use_play_data=use_play_data)
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/utils.py”, line 292, in update_video_infos
    video_item.set_aired_utc(utils.datetime_parser.strptime(snippet[‘publishedAt’]))
    File “/home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/utils/datetime_parser.py”, line 176, in strptime
    return datetime(*time.strptime(s, fmt)[:6])
    File “/usr/lib/python2.7/_strptime.py”, line 478, in _strptime_time
    return _strptime(data_string, format)[0]
    File “/usr/lib/python2.7/_strptime.py”, line 332, in _strptime
    (data_string, format))
    ValueError: time data u’2020-04-18T02:29:28Z’ does not match format ‘%Y-%m-%dT%H:%M:%S.%fZ’
    –>End of Python script error report<–

Do you have the latest version of the addon ? Is your osmc up to date ? If only YouTube gives you trouble then it’s best to report it to the addon developer

1 Like

I have updated all the software yet it gives the error.

To get a better understanding of the problem you are experiencing we need more information from you. The best way to get this information is for you to upload logs that demonstrate your problem. You can learn more about how to submit a useful support request here.

Depending on the used skin you have to set the settings-level to standard or higher, in summary:

  • enable debug logging at settings->system->logging

  • reboot the OSMC device twice(!)

  • reproduce the issue

  • upload the log set (all configs and logs!) either using the Log Uploader method within the My OSMC menu in the GUI or the ssh method invoking command grab-logs -A

  • publish the provided URL from the log set upload, here

Thanks for your understanding. We hope that we can help you get up and running again shortly.

OSMC skin screenshot:

I have downloaded the log and I have pasted a part of it in my problem statement. I’m unable to find a way to attach the log file to this message.

That is not a debug enabled log.
Use the log uploader as explained in the post above.

Thanks for your patience and your detailed instructions. I have uploaded the error log.

http://paste.osmc.tv/nipuzugeki

Thanks

There seems to be some inconsistency regarding the date-time format of the addon youtube plugin and the still cached information of this addon (perhaps from a previous version?).

Try to rename or remove the SQLite files *.sqlite in /home/osmc/.kodi/userdata/addon_data/plugin.video.youtube/kodion and afterwards restart the mediacenter.

Thankyou, that worked like a charm and everythings working fine.

Much obliged!

1 Like

… just wanted to note that I’ve seen the exact same problem on my OSMC Vero 4k, and the solution worked perfectly for me, too.

Many thanks from me as well! :slight_smile:

Regards

Getting the same error when trying to access History in the plugin and found this thread.

Alternative way of clearing the cache:
In Kodi go to
YouTube plugin settings > Maintenance > Delete data cache database

Resolved it for me. :slightly_smiling_face:

3 Likes