nicohman / wyvern

A simple CLI client for installing and maintaining linux GOG games
GNU General Public License v3.0
87 stars 5 forks source link

Session Credentials timeout. #30

Closed clort81 closed 4 years ago

clort81 commented 5 years ago

Logging in with user/pass and downloading one 4GB+ game part, (witcher 3) my session times out with GOG.com and subsequent file retreivals in the set all faill, creating files named e1installer [18-23] the files contain the text: {"error":"invalid_grant","error_description":"The access token provided has expired."}

Subsequent redownload of the game results in wyvern creating another copy of the first file.

Hoped-for behavior: 1) wyvern tests session active before requesting next file in a set, 2) wyvern tests for existince of files before redownloading them (either by length or md5sum/etc)

Cheers!

nicohman commented 5 years ago

First of all, sorry for the wait. I pushed a commit to master that implements 2 there, and should fix 1 if it's due to the GOG token expiring instead of something else like the download response. Could you see about reproducing the error with the current master and see if it still happens, if that's not too much trouble?

Void-025 commented 1 year ago

I'm also having the problem where the token expires after downloading one file. Re-downloading seems to work, though it'll expire again after downloading the next one in the list. This more or less means it can only download one file at a time, and it generates a bunch of useless error files every time as well.

What seems weird to me is that re-downloading doesn't give the error (at least on the first file) so it seems like something it does before starting the download is what gives it its access token, so maybe that could be done for every file rather than just once at the beginning? Or just check whether the file being downloaded is a "real" file or an error, and do whatever it is that gets you the token every time it expires, then restart the download at that particular file.

Something else, after failing to download something due to the token timing out, attempting to do anything else in the interactive menu causes a crash, presumably due to the token now being invalid. It looks like whatever updates the token happens when interactive mode is first started, not when the download begins.