Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: time data '2018-05-04T17:42:11Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ' #62

Open
pep7 opened this issue Mar 19, 2021 · 1 comment

Comments

@pep7
Copy link
Contributor

pep7 commented Mar 19, 2021

04:02:37 AM - Executor - INFO: Retrieving information from the YouTube API for https://www.youtube.com/watch?v=1jDBhdMMhWM.
Exception in thread Executor:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/gnunix/gorillabot/executor.py", line 65, in loop
msg.trigger(*msg.args)
File "/home/gnunix/gorillabot/plugins/link.py", line 63, in link
message = youtube(m, url)
File "/home/gnunix/gorillabot/plugins/link.py", line 143, in youtube
raw_time = datetime.strptime(blob["snippet"]["publishedAt"],
File "/usr/local/lib/python3.8/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "/usr/local/lib/python3.8/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2018-05-04T17:42:11Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

!link youtube command fails even with proper API key

@Lvl4Sword
Copy link

Your string is missing the microseconds at the end. %f is 000000 - 999999 according to https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants