UncleGoogle / galaxy-integration-humblebundle

Humble Bundle integration for GOG Galaxy 2.0
GNU General Public License v3.0
185 stars 19 forks source link

Silent connection lost #141

Open UncleGoogle opened 3 years ago

UncleGoogle commented 3 years ago

Describe the bug Connection lost but plugin does not communicate this to Galaxy.

Expected behavior Either do not lost connection (reassign _simpleauth cookie when SetCookie in header ??) or just raised Connection Lost properly.

Currently there is 302 to login page, not 403 or similar as was assumed in the code.

Possible solution

Maybe we should base on hbflush SetCookie header that stores have error reason (need to use redirect=False) or just assume when there is 302 (but the first seems more valid)

Provide logs

aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://www.humblebundle.com/login?goto=/api/v1/user/order&qs=')
2020-09-07 20:48:20,649 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "32975", "error": {"code": 0, "message": "Unknown error", "data": "0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', 

-> from get_owned_games