jdaymude / xbox2local

A command line utility for downloading Xbox screenshots and game clips to local storage
MIT License
8 stars 2 forks source link

Datetime processing fails on microseconds #20

Closed ktiedt closed 1 year ago

ktiedt commented 1 year ago

Just downloaded and set things up, really straight forward, so thanks for a great project so far, however, I did run into this error which seems new here...

My python is a bit rusty, but, if I find a work around, I'll append an PR to address it, if it makes sense.

Scanning the Xbox network for screenshots...
Scanning the Xbox network for game clips...
Traceback (most recent call last):
  File "/Users/ktiedt/repos/2023/xbox2local/xbox2local.py", line 179, in <module>
    capture_dt=fmt_datetime(clip['contentSegments'][0]['recordDate']),\
  File "/Users/ktiedt/repos/2023/xbox2local/xbox2local.py", line 73, in fmt_datetime
    raise ValueError('ERROR: No valid date format for \'' + datestr + '\'')
ValueError: ERROR: No valid date format for '2023-03-16T03:39:09.432Z'
ktiedt commented 1 year ago

Looks like this can be fixed (potentially... still waiting on the run to finish to check the output, but its running now) by updating line 68 to read:

for fmt in ['%Y-%m-%d %H:%M:%SZ', '%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%dT%H:%M:%S.%fZ']:

Once I can verify everything, I'll open up a pull request if things check out.

ktiedt commented 1 year ago

Looks like it worked... incoming PR shortly.

Downloaded 34 screenshots (26 HDR) and 87 game clips to /Users/ktiedt/Downloads/xbox-live
You are using 10.0GiB/10GiB (100.0%) of your Xbox network storage:
  Screenshots: 226.9MiB
  Game Clips:  9.8GiB
Writing metadata of downloaded media to skip next time...