It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
lupineshadow: Your script seems kind of like overkill for what is already possible with -ids and xargs. For example

grep "'title':" gog-manifest.dat | sed "s/\s*'title':\s*'\([a-z0-9_]*\)'.*$/\1/g" | sort | grep -E "^[a-e].*" | xargs echo gogrepoc.py download -ids

will download all your games from A to E.
avatar
MarS666: Not everyone uses Linux.

@solar_dome: Thanks for the script. I will give it a try.
You can do the same on Windows, using cygwin.
Pushed a couple of fixes to dev

So import should work properly again now.

And the XML MD5 generation should no longer crash and properly issue warnings about the offworld_trading_company situation. Also incidentally fixed 2 loops that were looping more than they should which should improve the efficiency of the MD5 XML clean up a fair bit while doing that.
Hmmm, some interesting results from double checing extras against server side date modified:

I have a lot of games and 0 of them had extras that weren't detected just by the pre-existing name / file size checks (as confirmed by letting the strict extra check remove and redownload pretty much everything and then checking every files MD5 against the pre-existing files ), it seems like there just aren't enough extras that run up against the file size limit for this to be a realistic problem at the moment.

On the other hand it does catch stuff with the GameData archives that some games on Mac use for their installers (though it would be much preferable for GOG to provide MD5s than to rely on this heuristic because it's also my experience that some GameData files being change doesn't mean they all actually have their contents change (sometimes a files name and content is unchanged and sometimes the name changes but not the content but GOG marks the entire set as having their last update time changed if any file changes. .
Got an error trying to login, I've used both python 2.7 and python 3

21:46:27 | attempting gog login as 'edited' ...
21:46:28 | fatal...
Traceback (most recent call last):
File "F:\GoG\gogrepo.py", line 1166, in <module>
main(process_argv(sys.argv))
File "F:\GoG\gogrepo.py", line 1138, in main
cmd_login(args.username, args.password)
File "F:\GoG\gogrepo.py", line 550, in cmd_login
with request(login_data['auth_url'], delay=0) as page:
File "F:\GoG\gogrepo.py", line 167, in request
req = Request(url, data=enc_args)
File "C:\Python27\lib\urllib2.py", line 229, in __init__
self.__original = unwrap(url)
File "C:\Python27\lib\urllib.py", line 1079, in unwrap
url = url.strip()
AttributeError: 'NoneType' object has no attribute 'strip'

Anyone knows what could be? I don't find something like it on a search.
Post edited August 17, 2024 by anarion321
avatar
anarion321: Got an error trying to login, I've used both python 2.7 and python 3

21:46:27 | attempting gog login as '...' ...
You should remove your E-Mail address from this line.
avatar
anarion321: Got an error trying to login, I've used both python 2.7 and python 3

21:46:27 | attempting gog login as '*@*.com' ...
21:46:28 | fatal...
Traceback (most recent call last):
File "F:\GoG\gogrepo.py", line 1166, in <module>
main(process_argv(sys.argv))
File "F:\GoG\gogrepo.py", line 1138, in main
cmd_login(args.username, args.password)
File "F:\GoG\gogrepo.py", line 550, in cmd_login
with request(login_data['auth_url'], delay=0) as page:
File "F:\GoG\gogrepo.py", line 167, in request
req = Request(url, data=enc_args)
File "C:\Python27\lib\urllib2.py", line 229, in __init__
self.__original = unwrap(url)
File "C:\Python27\lib\urllib.py", line 1079, in unwrap
url = url.strip()
AttributeError: 'NoneType' object has no attribute 'strip'

Anyone knows what could be? I don't find something like it on a search.
This indicates the URL response was effectively empty. I'm downloading stuff now but once I'm done , I'll logout and check if this is a communication issue on your side or if GOG has changed something which is my problem.

ETA - This is probably a me problem. Looks like GOG has changed the login page to allow logging in with a Gmail or Discord account directly, rather than a GOG account. I don't think I can support those but I'll see what I can do about getting the GOG account log in working again.
Post edited August 16, 2024 by Kalanyr
Okay, so after some testing this appears to be a you issue, the login still works correctly for GOG accounts and doesn't do anything silly like try to redirect you to the Gmail or Discord logins , I'll add in some text to make clear that you must have an actual GOG / Galaxy account to login and I'll put adding Gmail / Discord login support onto the Look Into list.

If you can provide me some more info about what you're trying I can look into it more closely but at least for the moment it seems like you're getting non-standard responses from GOG which I can't troubleshoot, *hmm* maybe GOG was down or overloaded ? I dont' think the login code is super robust but I can't crash GOG to test that theory ( this is a joke :P) .
Post edited August 16, 2024 by Kalanyr
avatar
anarion321: Got an error trying to login, I've used both python 2.7 and python 3

21:46:27 | attempting gog login as '...' ...
avatar
Geralt_of_Rivia: You should remove your E-Mail address from this line.
Not a difficult one to guess, but you are right, I did not notice, thanks.
avatar
Kalanyr: Okay, so after some testing this appears to be a you issue, the login still works correctly for GOG accounts and doesn't do anything silly like try to redirect you to the Gmail or Discord logins , I'll add in some text to make clear that you must have an actual GOG / Galaxy account to login and I'll put adding Gmail / Discord login support onto the Look Into list.

If you can provide me some more info about what you're trying I can look into it more closely but at least for the moment it seems like you're getting non-standard responses from GOG which I can't troubleshoot, *hmm* maybe GOG was down or overloaded ? I dont' think the login code is super robust but I can't crash GOG to test that theory ( this is a joke :P) .
Thanks for the pretty quick response.

I just downloaded the last version from here: https://github.com/eddie3/gogrepo

I had python3 installed (3.10.6), but as requirements says 2.7 is needed I downloaded it from official website (2.7.18), changed the path and installed the required libreries with "pip install html5lib html2text·"

After that, I just launched "gogrepo.py login" and introduced my user and password, ending in that error, that's it.

It does not really matter if it's the correct password or not, same error. I search a bit online and saw tutorials of people using python3, so I switched to it, but same result.

If it's just me, maybe there's something on my PC that it's not working fine. I used to do a lot of scripting years ago and maybe something in my Python is bad? Dunno

If I can I'll try it in other PC.

Thanks again.
Post edited August 17, 2024 by anarion321
avatar
anarion321: I just downloaded the last version from here: https://github.com/eddie3/gogrepo
That's a really old version. You want Kalanyr's fork:

https://github.com/Kalanyr/gogrepoc
avatar
anarion321: I just downloaded the last version from here: https://github.com/eddie3/gogrepo
avatar
Geralt_of_Rivia: That's a really old version. You want Kalanyr's fork:

https://github.com/Kalanyr/gogrepoc
Thanks, with that I get a different error though, syntax error. I've downloaded the file directly, and the raw, tried both Python 2,7 and 3.... I don't really see bad indentation or anything



[i]SyntaxError: invalid syntax]
File "F:\GoG\gogrepoc.py", line 220
a = "." + f'{n:03}'
^
SyntaxError: invalid syntax[/i]



Will try using a different PC with all reinstalled when I can.
avatar
Geralt_of_Rivia: That's a really old version. You want Kalanyr's fork:

https://github.com/Kalanyr/gogrepoc
avatar
anarion321: Thanks, with that I get a different error though, syntax error. I've downloaded the file directly, and the raw, tried both Python 2,7 and 3.... I don't really see bad indentation or anything

[i]SyntaxError: invalid syntax]
File "F:\GoG\gogrepoc.py", line 220
a = "." + f'{n:03}'
^
SyntaxError: invalid syntax[/i]

Will try using a different PC with all reinstalled when I can.
f-strings require python 3.6 or later, can you run python -v (or python3 -v) to confirm your version of python?
avatar
anarion321: Thanks, with that I get a different error though, syntax error. I've downloaded the file directly, and the raw, tried both Python 2,7 and 3.... I don't really see bad indentation or anything

[i]SyntaxError: invalid syntax]
File "F:\GoG\gogrepoc.py", line 220
a = "." + f'{n:03}'
^
SyntaxError: invalid syntax[/i]

Will try using a different PC with all reinstalled when I can.
avatar
lupineshadow: f-strings require python 3.6 or later, can you run python -v (or python3 -v) to confirm your version of python?
I got 3.10.6


[i]C:\Users>python --version
Python 3.10.6
[/i]
Hmm, there shouldn't be a dependency on f-string without an import for 2.7 since it doesn't exist in python 2. So I'm confused now

ETA - That's a mistake on my part. I need to fix that. But it should still work fine on Python 3.10
Post edited August 18, 2024 by Kalanyr
Replacing a = "." + f'{n:03}' on line 220 with a = "." + "%03d"%n should be compatible with python 2.7 and all versions of Python 3, I'll upload that to dev soon.
avatar
Kalanyr: Hmm, there shouldn't be a dependency on f-string without an import for 2.7 since it doesn't exist in python 2. So I'm confused now

ETA - That's a mistake on my part. I need to fix that. But it should still work fine on Python 3.10
Apologies, I don't think it's your mistake, I just uninstall all of my python and reinstalled only 3.10, seems to work now, so it must've been something bad at my end.

Only issue now it's that I have to reinstall multiple libreries and the OpenSSL must be a thrid party of another or something, cause pip don't find it


F:\GoG>pip3 install OpenSSL
ERROR: Could not find a version that satisfies the requirement OpenSSL (from versions: none)
ERROR: No matching distribution found for OpenSSL


But that's an issue about reinstalling libraries and such, I'll manage when I can.

Thanks a lot again and apologies for the trouble.