ping / odmpy

A simple command line manager for OverDrive/Libby loans. Download your library loans from the command line.
GNU General Public License v3.0
288 stars 19 forks source link

Intermittenly, odmpy libby has time data value error #53

Closed joshuatly closed 1 year ago

joshuatly commented 1 year ago

Describe the problem Intermittenly, odmpy libby has the following error: It shows up sometimes, but fine when I rerun it.

Traceback (most recent call last):
  File "/home/joshua/.local/bin/odmpy", line 8, in <module>
An unexpected error has occurred
Traceback (most recent call last):
  File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/odm.py", line 1005, in run
    expiry_date = parse_datetime(loan["expireDate"])
  File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/utils.py", line 67, in parse_datetime
    dt = datetime.strptime(value, fmt)
  File "/usr/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
:    sys.exit(main())
  File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/__main__.py", line 27, in main
    run()
  File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/odm.py", line 1005, in run
    expiry_date = parse_datetime(loan["expireDate"])
  File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/utils.py", line 67, in parse_datetime
    dt = datetime.strptime(value, fmt)
  File "/usr/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/lib/python3.9/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2023-09-14T07:20:30+00:00' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

To Reproduce Please include the full command used, for example odmpy libby

Version/Environment odmpy 0.8.0 [Python 3.9.2-linux]

ping commented 1 year ago

This should be fixed if you update from master or with for the next release.

joshuatly commented 1 year ago

Thanks a lot!