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

×
high rated
github project / download here:

https://github.com/eddie3/gogrepo

v0.3 changelog:
- update gogrepo.py to work with new GOG APIs
- add OS type validation check (must be one or more of 'windows', 'linux', or 'mac')
- MD5 data requests are now done immediately after file name/size request, rather than
running through another loop of product data
- command line parameter -skipbonus now called -skipextras

Hi GOG Community!

I've been a long time GOG customer and I've recently created a Python script that allows you to save all your GOG content locally for complete offline enjoyment. I am a big fan of their DRM-free practices and love the feeling of OWNING my collection that I paid for (just like big box game days)... of being able to download and keep my entire collection at home, offline. I wanted to contribute my script I used for personal use to regularly keep my complete collection up to date with GOG's latest updates, and my latest purchases. Steam is great, but I feel I'm renting $1000s worth of games from them with no real solution should steam disappear or at go temporarily offline (has happened tons of time during my only free time window for gaming...)

gogrepo.py Features
---
* Ability to download all games and optional bonus files based on combinations of OS (win, linux, osx) and language (en, fr, etc...)
* Saves a !info.txt in each game folder with information about each game/bonus item.
* Creates a !serial.txt if the game has a special serial/cdkey (I know, not 100% DRM-free, is it?). Sometimes coupon codes are hidden here!
* Verify your downloaded collection with full MD5, zip integrity, and expected file size checking. MD5 data comes from GOG itself
* Auto retrying of failed fetch/downloads. Sometime GOG servers report temporary errors.
* Ability to import your already existing local collection.
* Easy to throw into a daily cronjob to get all the latest updates and newly added content!
* Clear logging prints showing update/download progress and HTTP errors. Easy to pipe or tee to create a log file.

Usage and example output:
---
$ ./gogrepo.py login # to login and save your authenticated cookie
enter username:
enter password:
00:45:19 | attempting gog login as 'xxx@youremail.com' ...
00:45:22 | login successful!

$ ./gogrepo.py update # to fetch game info from GOG servers

23:10:55 | (187 / 793) fetching game info for divine_divinity...
23:10:56 | (188 / 793) fetching game info for divinity_2_developers_cut...
23:10:58 | (189 / 793) fetching game info for divinity_dragon_commander...
23:11:00 | (190 / 793) fetching game info for divinity_original_sin...
23:11:02 | (191 / 793) fetching game info for door_kickers...
23:11:04 | (192 / 793) fetching game info for downfall...
...

$ ./gogrepo.py download # to download all windows english game and bonus files

02:09:38 | {divinity_original_sin}
02:09:38 | download setup_divinity_original_sin_2.14.0.26.exe
02:09:38 | download setup_divinity_original_sin_2.14.0.26-1.bin
02:09:38 | download setup_divinity_original_sin_2.14.0.26-2.bin
02:09:38 | download patch_divinity_original_sin_2.13.0.24.exe
02:09:38 | download patch_divinity_original_sin_2.14.0.25.exe
02:09:38 | download divinity_original_sin_wallapers.zip
02:09:38 | download divinity_original_sin_avatars.zip
02:09:38 | download divinity_original_sin_artworks.zip
02:09:38 | download divinity_original_sin_manual.zip
02:09:38 | download setup_the_divinity_engine_2.8.0.14.exe

$ ./gogrepo.py verify # to verify your collection against MD5, zip, and expected file size

03:53:05 | verifying divinity_original_sin/setup_divinity_original_sin_2.14.0.26.exe...
03:53:05 | verifying divinity_original_sin/setup_divinity_original_sin_2.14.0.26-1.bin...
03:53:18 | verifying divinity_original_sin/setup_divinity_original_sin_2.14.0.26-2.bin...
03:53:27 | verifying divinity_original_sin/patch_divinity_original_sin_2.13.0.24.exe...
03:53:27 | verifying divinity_original_sin/patch_divinity_original_sin_2.14.0.25.exe...
03:53:28 | verifying divinity_original_sin/divinity_original_sin_wallapers.zip...
03:53:28 | verifying divinity_original_sin/divinity_original_sin_avatars.zip...
03:53:28 | verifying divinity_original_sin/divinity_original_sin_artworks.zip...
03:53:28 | verifying divinity_original_sin/divinity_original_sin_manual.zip...
03:53:28 | verifying divinity_original_sin/setup_the_divinity_engine_2.8.0.14.exe...
...
04:47:16 | --totals------------
04:47:16 | items in manifest... 4689
04:47:16 | have items.......... 4689
04:47:16 | missing items....... 0
04:47:16 | md5 mismatches...... 0
04:47:16 | size mismatches..... 0
04:47:16 | zipfile failures.... 0

Special thanks to evenpowers and his gog-backup github project. I consider gogrepo to be somewhat of a fork and spiritual successor of gog-backup with some features added and removed. If there is any feature you miss from gog-backup, let me know and I will probably add it.

Happy GOGing!
Post edited July 30, 2015 by woolymethodman
This looks very helpful, thank you.
avatar
woolymethodman: snip....
Interesting. Although I won't use it, I suppose there is a feature to download only a specific game in the librabry because for those of us with 100+ games and largely beyond, it would just take days to download our entire library with bonus included (and I don't even think a 2To hard drive could handle it)
Great. Two questions:

1. If from a former run there is already some content, does it skip it or redownload it? In other words: does it updates of a collection?

2. Could it maybe also download the whole account pages (library, wishlist) to have a complete offline archive?
I'll use it after pouring over the code for a bit. You have low rep, no offense and I'm not putting my credentials into anything that goes to the net until I'm sure it only goes where I want. But thanks for this!! I will look it over then test it.
avatar
woolymethodman: github project / download here:

github.com/eddie3/gogrepo
this looks great. Gonna give this a try when I'm back home.

from a quick glance just two suggestions:
- ability to download only a specific game. just filter the game name against a user-supplied string when you are creating the download list, or something
- remove the option to give the password as a cmdline parameter. always ask the user to enter it. If given as an argument it will end up being stored in your .bash_history(or similar), which is just generally a bad idea for passwords ;)
avatar
Trilarion: 1. If from a former run there is already some content, does it skip it or redownload it? In other words: does it updates of a collection?
from glancing at the code, it seems it skips the download if the file is already present and the file size matches.
high rated
Hi all. Thanks for the feedback! You're right, I will add ability to download single game items. I'll try to do that by this weekend :)

Yes it does skip files that it already downloaded (by doing a simple size check). This is much faster than MD5. Ideally, you should once in a while do a "gogrepo.py verify" if you want to do full MD5 validation. I felt this was a good strategy and a compromise for speed vs accuracy.

Regarding my low rep.. totally understand :) I've had this account for 5 years but have not been very social (and haven't needed game support as GOG games just work for me!).

Any questions feel free to ask me! I'll be more responsive tonight after work :)
high rated
avatar
woolymethodman: snip....
avatar
catpower1980: Interesting. Although I won't use it, I suppose there is a feature to download only a specific game in the librabry because for those of us with 100+ games and largely beyond, it would just take days to download our entire library with bonus included (and I don't even think a 2To hard drive could handle it)
Yes it takes a long time especially with hundreds and hundreds of games. I have 700+ games and like to download windows and linux clients. This eats up slightly more than 1TB of space!
avatar
Trilarion: Great. Two questions:

1. If from a former run there is already some content, does it skip it or redownload it? In other words: does it updates of a collection?

2. Could it maybe also download the whole account pages (library, wishlist) to have a complete offline archive?
1. It skips based on file size. To do real validation I suggest you run the 'verify' command once in a while which will do MD5 verification and zip integrity checking as well!

2. It does download your entire library data (and creates !info.txt in the gamedir) to save whatever information looks interesting. I have not explored wishlist yet. I would like to add 'movie' support too if there's interest.
avatar
paladin181: I'll use it after pouring over the code for a bit. You have low rep, no offense and I'm not putting my credentials into anything that goes to the net until I'm sure it only goes where I want. But thanks for this!! I will look it over then test it.
No worries! Totally understand. I would do the exact same thing regardless of rep/karma/whatever :) Any questions let me know. The login code is pretty basic and all URLs point to gog as you should see.

I've tried to make the code very readable.
Post edited May 06, 2015 by woolymethodman
avatar
catpower1980: Interesting. Although I won't use it, I suppose there is a feature to download only a specific game in the librabry because for those of us with 100+ games and largely beyond, it would just take days to download our entire library with bonus included (and I don't even think a 2To hard drive could handle it)
Have 144 games. Fit easily (including all extras and both windows and linux version where available) on a 1 TB drive that has plenty of other things on [loads of raw photos / some films / many other bits] with around 400GB still free.

A lot of the games here are well under 1gb each.
Post edited May 06, 2015 by Mnemon
high rated
avatar
woolymethodman: github project / download here:

github.com/eddie3/gogrepo
avatar
immi101: this looks great. Gonna give this a try when I'm back home.

from a quick glance just two suggestions:
- ability to download only a specific game. just filter the game name against a user-supplied string when you are creating the download list, or something
- remove the option to give the password as a cmdline parameter. always ask the user to enter it. If given as an argument it will end up being stored in your .bash_history(or similar), which is just generally a bad idea for passwords ;)
avatar
Trilarion: 1. If from a former run there is already some content, does it skip it or redownload it? In other words: does it updates of a collection?
avatar
immi101: from glancing at the code, it seems it skips the download if the file is already present and the file size matches.
I will add ability to specify specific games asap. I think this is a great idea, even though options (like gog galaxy) exist. You could slowly build up your collection as needed.

I probably wont' remove the password over cmd option. I agree it's not a good idea to use this, but I don't want to 100% force interactive usage. Also you generally need to run this once and only once. I could make the 'cmdline' security concern more apparent though. I"ll do that!
avatar
catpower1980: Interesting. Although I won't use it, I suppose there is a feature to download only a specific game in the librabry because for those of us with 100+ games and largely beyond, it would just take days to download our entire library with bonus included (and I don't even think a 2To hard drive could handle it)
avatar
Mnemon: Have 144 games. Fit easily on a 1 TB drive that has plenty of other things on [loads of raw photos / some films / many other bits] with around 400GB still free.

A lot of the games here are well under 1gb each.
Yeah some games are tiny! Others are very large :) This is mostly about "data hording" so it is what it is :) I will add ability to download specific titles though.
Post edited May 06, 2015 by woolymethodman
Cool program, thanks for sharing it with the community!

Just some info/thoughts - passwords passed on the commandline are inherently insecure because they will show up in a process listing on the machine by any software that looks at the process table. This includes local and remote user account logins from the commandline using utilities such as 'ps' and 'top' or their GUI equivalents or other software that examines the process table.

A safer way to handle passwords non-interactively is to create a config file containing the password, check for that file at startup and if it exists and parse it to read the password and it avoids the security issue of passwords on the commandline without requiring a user to type it in each time. ~/.myprogrc is a common type of name for such a config file in Linux for example. I'd further set the permissions on the file to 0700 so other UIDs can not read the file, and have the program do a security check by testing the file permissions do not have the group or other read bits set before parsing it for the password.

Just some hopefully useful suggestions. :) Anyhow, keep up the good work!
I'm more interested in the program itself than in using it.

Thanks!
avatar
woolymethodman: ...1. It skips based on file size. To do real validation I suggest you run the 'verify' command once in a while which will do MD5 verification and zip integrity checking as well! ...
Maybe one could also introduce a cleanup command, because sometimes they change the file names (new versions) and then one wants to delete the old versions.

So as a first step what about obtaining a list of files that should not be there because GOG does not offer them anymore for download (older versions). Then the user could decide himself if these files should be deleted or not.

P.S.: Thanks again for the nice programm. Maybe if I have time I could write a small GUI around it using PyQt. Then one could even freeze it and make it available. In principle it is a better downloader (with the update option) and since the GOG downloader will not be supported anymore...
Post edited May 08, 2015 by Trilarion
It took me longer than I care to admit to notice that the name probably isn't Go Grepo...
avatar
Smannesman: It took me longer than I care to admit to notice that the name probably isn't Go Grepo...
How about Go Grepo Pie...