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
LGOGDownloader is open source downloader to GOG.com for Linux users.
It uses the same GOG Galaxy API as the official GOG Galaxy which doesn't have Linux support at the moment.
It is licenced under WTFPL licence

Current features:
- Listing available games (simple and detailed list)
- Batch downloading
- Repair downloaded installers/extras
- Resume unfinished downloads
- Perl regular expressions for filtering games
- Download speed limiting
- Checking for update notifications
- Listing/downloading updated files
- Checking for orphaned files
- Checking status of files
- Blacklisting files
- Downloading individual files by id number
- Installing games using Galaxy API

Cookies and config files are saved to $XDG_CONFIG_HOME/lgogdownloader
Created GOG XML files are saved to $XDG_CACHE_HOME/lgogdownloader/xml
By default all downloads are saved to current working directory
Subdirectories for games are automatically created

Compiling and installing the downloader:

sudo apt-get install build-essential libcurl4-openssl-dev libboost-regex-dev libjsoncpp-dev librhash-dev libtinyxml2-dev libhtidy-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-date-time-dev libboost-iostreams-dev cmake pkg-config zlib1g-dev qtwebengine5-dev
wget https://github.com/Sude-/lgogdownloader/releases/download/v3.15/lgogdownloader-3.15.tar.gz
tar -xvzf lgogdownloader-3.15.tar.gz
cd lgogdownloader-3.15
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_QT_GUI=ON
make
sudo make install

Donations:
Since people have been asking about donations I've set up Paypal and Ko-fi which you can use.
Paypal
Ko-fi

Links:
Git repository @ Github
Website
PKGBUILD for Arch Linux users
PKGBUILD for Arch Linux users (git version)

Usage examples:

Login to create cookies and config files
lgogdownloader --login

List all available games
lgogdownloader --list

List all games beginning with "t"
lgogdownloader --list --game '^t.*'

List details for all Witcher games
lgogdownloader --list details --game witcher

Download all games
lgogdownloader --download

Download all games beginning with "t"
lgogdownloader --download --game '^t.*'

Using exclude option to not download extras and language packs
lgogdownloader --download --include all --exclude extras,languagepacks

Download extras for all games beginning with "t" to /media/sdb1/GOG/ and limit download speed to 500 kB/s and download threads to 1
lgogdownloader --download --directory /media/sdb1/GOG/ --limit-rate 500 --include extras --threads 1

Repair installer files for all Witcher games (base game and dlc)
lgogdownloader --repair --include installers,dlcs --game witcher

Create GOG XML for a file with 2MB chunks
lgogdownloader --create-xml /path/to/file.ext --chunk-size 2

Download all games and automatically create GOG XML for extras
lgogdownloader --download --automatic-xml-creation

Check for orphaned files (files found on local filesystem that are not found on GOG servers)
lgogdownloader --check-orphans

Downloading individual files
lgogdownloader --download-file gamename/fileid or --download-file gamename/dlcname/fileid
for example: lgogdownloader --download-file the_witcher/en1installer0

Show Galaxy builds for a game
lgogdownloader --galaxy-show-builds product_id
or
lgogdownloader --galaxy-show-builds gamename
where gamename is regular expression and product_id is numerical product id (can be determined with "--list details" option)
Example: show builds for Witcher 1
lgogdownloader --galaxy-show-builds 1207658924
lgogdownloader --galaxy-show-builds '^the_witcher$'

Install game using Galaxy depots
lgogdownloader --galaxy-install product_id/build_index
or
lgogdownloader --galaxy-install gamename/build_index
--galaxy-show-builds will display available build_index numbers, the default is "0" which should be the newest build
Post edited August 23, 2024 by Sude
high rated
A note for Archers trying to build this.

Install jsoncpp-fixed from the AUR and then modify $lgogsrcdir/include/api.h line 18 to read #include <jsoncpp/json.h> rather than #include <jsoncpp/json/json.h>.

This might be necessary on other distros, too.

Optionally, you might create the dir /usr/include/jsoncpp/json and symlink /usr/include/jsoncpp/*.h to that dir.

I'll look into making a PKGBUILD later, but I'll need to figure out how to make a patch file to make that change.
high rated
Alright I've made a PKGBUILD and I intend to upload to the AUR soonish. But right now, lgogdownloader doesn't work!

I've run lgogdownloader --login and entered my password, but at every attempt I just get "HTTP: Login failed".

Not sure if I'm missing a dependency or if something is going crazy at the GOG servers or something, but I'm definitely connected and should be able to make a connection.
This is very, very cool! I might try this when I redownload Witcher 2 again.
avatar
TheJoe: Not sure if I'm missing a dependency or if something is going crazy at the GOG servers or something, but I'm definitely connected and should be able to make a connection.
Nothing to blame here but my stupidity
While cleaning up the sources to remove commented out old code that wasn't working I managed to somehow delete some part of the code for the login
I accidentally deleted the part that sends the POST to login form

I should have tested the login one more time before first releasing it :\

anyway here's a fixed source
http://sites.google.com/site/gogdownloader/lgogdownloader-1.1.tar.gz
avatar
Sude: sneep
Haha, thanks very much for the update. It works fine now it seems.

The PKGBUILD for Arch users can be found here.

Now to download some games! Thanks a bunch, Sude!
Well apparently there was a small bug caused by copy/pasting code and forgetting to change it.
--update-check didn't actually show the number of new forum replies but the number of new private messages

http://sites.google.com/site/gogdownloader/lgogdownloader-1.2.tar.gz
Just taken it for a spin downloading a game and it's great!

The automatic folder structure is clean, making offline archiving easy and efficient; since I accidentally wiped the drive all my GOGs were on this is going to be really handy.

It didn't grab the cover art, though. I downloaded Beneath a Steel Sky and did not use the --no-cover flag, but it didn't seem to grab it.

Additionally, I'm not big on the --filter option. When searching through --list you should use grep to single out individual lines. I wonder if instead it should be --game and accept an 'all' parameter; lgogownloader --download --game all would download everything.
avatar
TheJoe: It didn't grab the cover art, though. I downloaded Beneath a Steel Sky and did not use the --no-cover flag, but it didn't seem to grab it.
That's weird, Beneath a Steel Sky does download the cover for me at the moment
sude@lmde:~ $ lgogdownloader --download --game beneath --no-extras
Getting game info 1 / 1
Downloading cover beneath_a_steel_sky/cover_0.jpg
100% [==========================] 0.98/0.98MB @ 143.26kB/s
beneath_a_steel_sky/setup_beneath_a_steel_sky.exe
100% [==========================] 71.69/71.69MB @ 9176.81kB/s

I did update the cover list recently though, perhaps something was broken on the cover list before I updated it
avatar
TheJoe: Additionally, I'm not big on the --filter option.When searching through --list you should use grep to single out individual lines. I wonder if instead it should be --game and accept an 'all' parameter; lgogownloader --download --game all would download everything.
--filter isn't exactly a good name for it
it's now renamed to --game

lgogdownloader --list | grep 'something' == lgogdownloader --list --game 'something'

I added two regex aliases to it:
"--game all" == "--game .*" and downloads all games
"--game free" is a list of free games

http://sites.google.com/site/gogdownloader/lgogdownloader-1.3.tar.gz
Post edited August 02, 2012 by Sude
avatar
Sude: sneep
avatar
TheJoe: Haha, thanks very much for the update. It works fine now it seems.

The PKGBUILD for Arch users can be found here.

Now to download some games! Thanks a bunch, Sude!
Thanks for the PKGBUILD. Works perfectly.
First of alll, a big thank you for your work!

I also would like to add that there was some trouble with the build dependencies on my Ubuntu 12.04 system. libcurl4-openssl-dev and liboauth-dev cannot coexist, so I skipped libcurl4-openssl-dev and it seemed to work fine. My line for installing the prerequisites (for easy copy + paste):

sudo apt-get install build-essential liboauth-dev libjsoncpp-dev libhtmlcxx-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libboost-program-options-dev libtinyxml-dev librhash-dev
Well, I do feel rather stoopid right now. I can get it to compile, but not to download anything. Login works fine, --list works fine, but --download does not work.

lgogdownloader --download --game beneath_a_steel_sky
* Line 1, Column 1
Syntax error: value, object or array expected.

It's gogAPI->error_message that is being printed. Any suggestions?
avatar
gthornblad: Well, I do feel rather stoopid right now. I can get it to compile, but not to download anything. Login works fine, --list works fine, but --download does not work.

lgogdownloader --download --game beneath_a_steel_sky
* Line 1, Column 1
Syntax error: value, object or array expected.

It's gogAPI->error_message that is being printed. Any suggestions?
I have exactly the same error, I'm on Ubuntu 12.04 (64-bit), too. I've installed all dependencies that I could (I've also experienced your error message).
I just installed Ubuntu in a VM and was able to reproduce the error

Breakpoint 1, API::getGameDetails (this=0x656b60, game_name=...)
at src/api.cpp:316
316 return game;
(gdb) print json
$10 = {static npos = <optimized out>,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
_M_p = 0x6604a8 "<h1>Error 403 - Access Forbidden (Array)</h1>\n\n"}}
Well there's the problem, for some reason the request doesn't get authorized

edit:

Breakpoint 2, API::getResponseOAuth (this=0x656b60, url=...) at src/api.cpp:251
251 return response;
(gdb) print url
$12 = {static npos = <optimized out>,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
_M_p = 0x6572a8 "https://api.gog.com/en/downloader2/game/beneath_a_steel_sky/?oauth_consumer_key=1f444d14ea8ec776585524a33f6ecc1c413ed4a5&amp;oauth_nonce=", 'a' <repeats 15 times>, "&oauth_signature_method=HMAC-SHA1&oauth_timestamp=13"...}}
And there's the reason it doesn't get authorized: "'a' <repeats 15 times>"

edit2:
I think there's something wrong with the liboauth package in Ubuntu
This can be fixed by adding lhw's ppa and updating liboauth

sudo add-apt-repository ppa:lhw/packages
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
Post edited August 17, 2012 by Sude
I am not getting the same error on Arch. I would guess that this is an issue caused by those two conflicting libraries in Ubuntu.