jabba1971: More details for the 509 errors
To me your findings seem similar to mine, ie. the GOG servers allow only a certain amount of requests per hour. To you the errors start coming earlier than for me, but it could be simply that you generate more requests per game and faster, depending on the game type or if you are getting more language and/or OS versions of games? Just my assumption...
So far it appears to me the point would be mainly to limit how many requests are made per hour. When a certain limit is reached, apparently the script just needs to wait until one hour has passed since the start of the script, before continuing?
People with less games will apparently be unaffected by this, people start seeing this when they have well over one thousand games (>1300 or so), but again I don't know if the limit is reached earlier with trying to get several language and OS versions at the same time. I might just as well try running update with all language and OS versions to see if the limit is reached earlier, but right now I am running verify on my GOG collection...
jabba1971: Some of them fetch after a few retries, and some of them give a failed and are not in the manifest
Did you change the HTTP_RETRY_DELAY and HTTP_RETRY_COUNT values? As said, I have set both to 30 (30 seconds delay before a retry, and retrying up to 30 times if needed), and I think I got all the game data. I think the default values are quite low for this type of thing, they were probably originally meant for something else.
HTTP_RETRY_DELAY = 30 # in seconds
HTTP_RETRY_COUNT = 30
With these settings, for a couple of games it took up to 12 retries before GOG gave the data (30 seconds delay in between requests), while for some one retry was enough. I have no idea how that works, it is just about luck or does it depend on how many items (files) there are for a game (a game with only few files + extras will need less retries more likely?)
Either way, after one hour has passed, then this become irrelevant. I don't know if it makes sense to try to get the data during the ban period, or just wait it out. In my case I could get data for seven games during the ban period which doesn't really save much of time compared to just waiting.
I wish some cyber security expert or backend developer would comment on these as these are all just my assumptions on how things seem to be working on the server side (e.g. how are the number of http requests normally limited on the server side, and why does it still give data after several retries, is that intentional?).