DevilXD / TwitchDropsMiner

An app that allows you to AFK mine timed Twitch drops, with automatic drop claiming and channel switching.
MIT License
1.61k stars 158 forks source link

ValueError: time data '2023-10-08T19:38:07.667Z' does not match format '%Y-%m-%dT%H:%M:%SZ' #311

Closed Totesfleisch closed 11 months ago

Totesfleisch commented 11 months ago

22:25:40: Fatal error encountered: 22:25:40: 22:25:40: Traceback (most recent call last): 22:25:40: File "main.py", line 158, in main 22:25:40: File "twitch.py", line 765, in run 22:25:40: File "twitch.py", line 807, in _run 22:25:40: File "twitch.py", line 1604, in fetch_inventory 22:25:40: File "twitch.py", line 1605, in 22:25:40: File "utils.py", line 112, in timestamp 22:25:40: File "_strptime.py", line 568, in _strptime_datetime 22:25:40: File "_strptime.py", line 349, in _strptime 22:25:40: ValueError: time data '2023-10-08T19:38:07.667Z' does not match format '%Y-%m-%dT%H:%M:%SZ' 22:25:40: 22:25:40: Exiting... 22:25:41: 22:25:41: Application Terminated. 22:25:41: Close the window to exit the application.

Not sure what the Issue is, i ran this bot normally less than 6 hours ago and suddenly i keep getting this on Launch. I already tried reinstalling it, but no Change.

RainOne commented 11 months ago

Same - I noticed I was "idling" for the Mercy skin in Overwatch for about 2 days (it's a 2 hour drop) and I wasn't getting any progression on the drop. Closed the app, rebooted the machine it runs on (for good measure) and i'm getting the exact same error now.

Weird that the pattern of the data actually matches the format, so I don't know what is wrong - maybe it's expecting 2 case seconds and getting 3?

binggunyan commented 11 months ago

This problem arose yesterday.Yes, I also encountered the same problem.Before this issue arise,although the progress bar of ow2 shows growth, it is not recorded on the webpage.However,like other games, R6, will accumulate progress normally.

mdk25 commented 11 months ago

Weird that the pattern of the data actually matches the format, so I don't know what is wrong - maybe it's expecting 2 case seconds and getting 3?

The date does not match the pattern - there are milliseconds that it's not expecting. The pattern %Y-%m-%dT%H:%M:%S.%fZ would work in this case. Unfortunately, it seems that there are still dates without milliseconds as well, so both need to be supported.

secretsoup commented 11 months ago

I don't have this issue so I can't reproduce, but I've added a try for the timestamp values into a fork. Can someone having this issue test before I do a pull req?

https://github.com/spuukii/TwitchDropsMiner/

RainOne commented 11 months ago

Yup, the new timestamp try works. It went back into idling for drops without any error message. If you want any more debugging, lemme know (you will mostly need to tell me how to get to it :D)

mdk25 commented 11 months ago

I don't have this issue so I can't reproduce, but I've added a try for the timestamp values into a fork. Can someone having this issue test before I do a pull req?

This is similar to the change I made to get my local copy working. I'm just not familiar enough with the code to know whether returning None is more appropriate than throwing the error.

secretsoup commented 11 months ago

There was no exception raising that I could see in the original code so I didn't bother to put it in. It probably should just be a return rather than return None to act as a break.

DevilXD commented 11 months ago

Hello. This looks like another one of those problematic changes that Twitch introduced. It looks like #314 should solve this quite easily though.

DevilXD commented 11 months ago

This should be solved now. Please let me know if it works.