GithubHelp home page GithubHelp logo

sude- / lgogdownloader Goto Github PK

View Code? Open in Web Editor NEW
682.0 682.0 66.0 1.23 MB

LGOGDownloader is unofficial downloader to GOG.com for Linux users. It uses the same API as the official GOG Galaxy.

Home Page: https://sites.google.com/site/gogdownloader/

License: Do What The F*ck You Want To Public License

C++ 98.35% CMake 1.65%

lgogdownloader's People

Contributors

0-wiz-0 avatar bensuperpc avatar bwrsandman avatar carstene1ns avatar chewi avatar darktjm avatar ddonatek avatar erikfleischer avatar eroux avatar eschguy avatar gbiggs avatar haphi avatar huancz avatar itoijala avatar janisozaur avatar jetomit avatar kilobug42 avatar kreudom avatar loki-47-6f-64 avatar mdhowle avatar nathanel23 avatar nerdspice avatar nramsbottom avatar pkerling avatar rouanth avatar skitt avatar sude- avatar susnux avatar thoreas avatar timo-42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lgogdownloader's Issues

hang during --status

I get a hang during the following.

./bin/Release/lgogdownloader --no-deb --directory ~/gog/ --platform 4 --language 1 --game wasteland --status

The output prior to the hang is (long numbers removed. Let me know if they matter)

user@host:lgogdownloader$ ./bin/Release/lgogdownloader --no-deb --directory ~/gog/ --platform 4 --language 1 --game wasteland --status
WARNING: gnome-keyring:: couldn't connect to: /home/user/.cache/keyring-mNLVXi/pkcs11: No such file or directory
Getting game info 1 / 1
OK wasteland_2_kickstarter gog_wasteland_2_1.7.0.11.tar.gz [code] [code]
OK wasteland_2_kickstarter wasteland_2_manual.zip [code] [code]
OK wasteland_2_kickstarter wasteland_2_reference_card.zip [code] [code]
OK wasteland_2_kickstarter wasteland_2_map.zip 94517311 [code] [code]
OK wasteland_2_kickstarter wl2_choir_songs_flac.zip [code] [code]
OK wasteland_2_kickstarter wl2_choir_songs_mp3.zip [code] [code]
^C

At the time of the hang strace show only line repeating

read(7, 0x17ade80, 8192) = -1 EISDIR (Is a directory)
read(7, 0x17ade80, 8192) = -1 EISDIR (Is a directory)
read(7, 0x17ade80, 8192) = -1 EISDIR (Is a directory)
.
.
.

/proc shows the the following open file handes

user@host:~$ ls -l /proc/4015/fd
total 0
lrwx------ 1 user user 64 Dec 26 12:51 0 -> /dev/pts/1
lrwx------ 1 user user 64 Dec 26 12:51 1 -> /dev/pts/1
lrwx------ 1 user user 64 Dec 26 12:51 2 -> /dev/pts/1
lr-x------ 1 user user 64 Dec 26 12:51 3 -> /dev/urandom
lrwx------ 1 user user 64 Dec 26 12:51 4 -> socket:[1906477]
lrwx------ 1 user user 64 Dec 26 12:51 5 -> socket:[1906482]
lrwx------ 1 user user 64 Dec 26 12:51 6 -> socket:[1906967]
lr-x------ 1 user user 64 Dec 26 12:51 7 -> /home/user/gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_deluxe_edition_upgrade/extras

The contents of the wasteland_2_kickstarter directory are

user@host:~$ find gog/wasteland_2_kickstarter/
gog/wasteland_2_kickstarter/
gog/wasteland_2_kickstarter/dlc
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_classic_edition_upgrade
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_classic_edition_upgrade/extras
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_classic_edition_upgrade/extras/wasteland_2_soundtrack_mp3.zip
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_classic_edition_upgrade/extras/wasteland_2_wallpapers.zip
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_classic_edition_upgrade/extras/wl2_choir_songs_flac.zip
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_classic_edition_upgrade/extras/wl2_choir_songs_mp3.zip
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_classic_edition_upgrade/extras/wasteland_2_soundtrack_flac.zip
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_classic_edition_upgrade/extras/wasteland_2_artbook.zip
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_deluxe_edition_upgrade
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_deluxe_edition_upgrade/extras
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_deluxe_edition_upgrade/extras/wasteland_2_book_two.zip
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_deluxe_edition_upgrade/extras/wasteland_2_book_one.zip
gog/wasteland_2_kickstarter/dlc/wasteland_2_digital_deluxe_edition_upgrade/extras/wasteland_2_book_three.zip
gog/wasteland_2_kickstarter/gog_wasteland_2_1.5.0.9.tar.gz
gog/wasteland_2_kickstarter/extras
gog/wasteland_2_kickstarter/extras/wasteland_2_reference_card.zip
gog/wasteland_2_kickstarter/extras/wl2_choir_songs_flac.zip
gog/wasteland_2_kickstarter/extras/wasteland_2_map.zip
gog/wasteland_2_kickstarter/extras/wl2_choir_songs_mp3.zip
gog/wasteland_2_kickstarter/extras/wasteland_2_manual.zip
gog/wasteland_2_kickstarter/gog_wasteland_2_1.7.0.11.tar.gz

HTTP Login: Failed

I have just built from source and it seems that I am coming across a 'HTTP Login: Failed' each time I try and log in. I have built the debug source and below is the entire output.

DEBUG INFO (API::getResponse)
URL: https://api.gog.com/downloader2/status/stable/
DEBUG INFO (API::getAPIConfig)

{
    "config" : 
    {
        "error_log_endpoint" : "https://api.gog.com/downloader2/errorlog",
        "get_extra_link" : "https://api.gog.com/downloader2/extra",
        "get_game_details" : "https://api.gog.com/downloader2/game",
        "get_installer_link" : "https://api.gog.com/downloader2/installer",
        "get_user_details" : "https://api.gog.com/downloader2/user",
        "get_user_games" : "https://api.gog.com/downloader2/user_games",
        "oauth_authorize_temp_token" : "https://api.gog.com/oauth/login",
        "oauth_get_temp_token" : "https://api.gog.com/oauth/initialize",
        "oauth_get_token" : "https://api.gog.com/oauth/token",
        "set_app_status" : "https://api.gog.com/downloader2/set_app_status"
    },
    "current_timestamp" : 1439252891,
    "current_version" : 
    {
        "mac_length" : false,
        "mac_signature" : false,
        "mac_sparkle_bundle" : false,
        "url" : "http://static.gog.com/download/d3/stable/Setup_Downloader_3.6.0_stable.exe",
        "version" : "3.6.0"
    },
    "link_expiration" : 600000,
    "status" : "OK",
    "status_update_timer" : 180000
}

Email: [email protected]
Password: 
DEBUG INFO (Downloader::HTTP_Login)
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Login ● GOG.com</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
                            <link rel="stylesheet" href="//static-login.gog.com/css/a6336e8-6346a3c.css"/>
                    </head>
<body class="_modal "
  data-content-type="loginForm"
><div data-content-type="loginForm" class="_modal__box js-modal-box"><button class="_modal__control js-close-modal" data-action="close"><i class="icn icn--close"></i></button><form name="login" method="post" action="/login_check" data-form-type="loginForm" class="form form--login"><h2 class="form__title"><i class="icn icn--logo"></i>Log in</h2><ol class="form__fieldset"><li class="form__field field "><label for="login_username" class="required">Email</label><input type="email" id="login_username" name="login[username]" required="required" type="email" placeholder="Email" class="field__input" autocomplete="on" required="required" data-error="error_login_username" data-input-type="user" value="[email protected]" /><span id="error_login_username" class="js-error-msg field__msg is-hidden">Incorrect email</span></li><li class="form__field field "><label for="login_password" class="required">Password</label><input type="password" id="login_password" name="login[password]" required="required" placeholder="Password" class="field__input" autocomplete="on" required="required" maxlength="4096" data-error="error_login_password" data-input-type="user" /><span id="error_login_password" class="js-error-msg field__msg is-hidden">Password required</span></li><script src='https://www.google.com/recaptcha/api.js?hl=en' async defer></script><div class="g-recaptcha" data-sitekey="6LdcuggTAAAAAG82zmXLRAe3ZUCbiYfTK62e0OCh" style="margin-left: 13px"></div><li class="form__field field btn-slot"><button type="submit" id="login_login" name="login[login]" class="btn btn--main">Log in now</button></li></ol><div class="form__footer"><div class="l-section"><a class="btn js-normal-link" data-content-type="requestPasswordForm"
           href="/password/request">Reset password</a></div><div class="l-section"><a class="btn js-change-content" data-content-type="registerForm">I’m new here</a></div></div><input type="hidden" id="login__token" name="login[_token]" value="yyzCymWjTw-Mw5KzU4TVnCi6NUOa0xob-HT_lCU6qAA" /></form></div><div data-content-type="registerForm" class="_modal__box js-modal-box"><button class="_modal__control js-close-modal" data-action="close"><i class="icn icn--close"></i></button><form name="register" method="post" action="/register" data-form-type="registerForm" class="form"><h2 class="form__title"><i class="icn icn--logo"></i> Sign-up</h2><ol class="form__fieldset"><li class="form__field field "><label for="register_username" class="required">Username</label><input type="text" id="register_username" name="register[username]" required="required" placeholder="Username" class="field__input" autocomplete="on" required="required" data-error="error_register_username" data-input-type="user" /><span id="error_register_username" class="js-error-msg field__msg is-hidden">Username required</span><span data-error-type="exists" class="js-ajax-error-msg field__msg is-hidden">Username already taken</span><span data-error-type="illegal_chars" class="js-ajax-error-msg field__msg is-hidden">Forbidden special characters</span><span data-error-type="short" class="js-ajax-error-msg field__msg is-hidden">Username too short</span><span data-error-type="long" class="js-ajax-error-msg field__msg is-hidden">Username too long</span></li><li class="form__field field "><label for="register_email" class="required">Email</label><input type="email" id="register_email" name="register[email]" required="required" class="field__input" autocomplete="on" required="required" placeholder="Email" data-error="error_register_email" data-input-type="user" /><span id="error_register_email" class="js-error-msg field__msg is-hidden">Incorrect email</span><span data-error-type="exists" class="js-ajax-error-msg field__msg is-hidden">Email address already used</span><span data-error-type="invalid" class="js-ajax-error-msg field__msg is-hidden">Incorrect email</span></li><li class="form__field field "><label for="register_password" class="required">Password</label><input type="password" id="register_password" name="register[password]" required="required" placeholder="Password" class="field__input" autocomplete="on" required="required" data-error="error_register_password" data-input-type="user" /><span id="error_register_password" class="js-error-msg field__msg is-hidden">Password required</span></li><li class="form__field field btn-slot"><button type="submit" id="register_register" name="register[register]" class="btn btn--main">Sign up now</button></li></ol><p class="form__description">
        By signing up you acknowledge that you are 13 or older and accept <a href="http://www.gog.com/support/policies" target="_top"><strong>GOG User Agreement and GOG Privacy Policy</strong></a>.
    </p><div class="form__footer"><div class="l-section"><a class="btn js-change-content" data-content-type="loginForm">I already have an account</a></div></div><input type="hidden" id="register__token" name="register[_token]" value="9z2mrcfkVLDUKQdS_fsa7OimgWcE2lZQY0lpfB6ZkT0" /></form></div><script type="text/javascript" src="//static-login.gog.com/js/2c420b1-95c0205.js"></script><script type="text/javascript" src="//static-login.gog.com/js/69925ca-1da9f68.js"></script></body></html>  

HTTP: Login failed

32bit version breaks off on files bigger than 2GB

the downloader 32bit version breaks off on files bigger than 2GB. It just leaves them at whatever percent they were when it has downloaded 2GB. And starts downloading anew the next time.

The filesystem (ext4) does support files bigger than 2GB, even on 32bit.

To test:
lgogdownloader --platform 4 --download --game flatout_2
To test on 64bit, you might be able to install the 32bit version (apt-get install lgogdownloader:i386) and start it prefixed with linux32

compile problems on modern systems

I guess my boost 1.58.0.1 is too new:

g++ obj/Debug/main.o obj/Debug/src/api.o obj/Debug/src/downloader.o obj/Debug/src/progressbar.o obj/Debug/src/util.o obj/Debug/src/blacklist.o obj/Debug/src/gamedetails.o obj/Debug/src/gamefile.o -lcurl -loauth -ljsoncpp -lhtmlcxx -lboost_system -lboost_filesystem -lboost_regex -lboost_program_options -lboost_date_time -ltinyxml -lrhash -o bin/Debug/lgogdownloader
obj/Debug/src/util.o: In function Util::createXML(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': /usr/src/git/lgogdownloader/src/util.cpp:137: undefined reference toTiXmlElement::SetAttribute(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/src/git/lgogdownloader/src/util.cpp:139: undefined reference to TiXmlElement::SetAttribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/src/git/lgogdownloader/src/util.cpp:180: undefined reference toTiXmlElement::SetAttribute(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/src/git/lgogdownloader/src/util.cpp:181: undefined reference to TiXmlElement::SetAttribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/src/git/lgogdownloader/src/util.cpp:197: undefined reference toTiXmlElement::SetAttribute(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
collect2: error: ld returned 1 exit status
Makefile:76: recipe for target 'out_debug' failed
make[1]: *** [out_debug] Error 1
make[1]: Leaving directory '/usr/src/git/lgogdownloader'

lgogdownloader segfaults on downloading game

Hi, the current build 61e0c31 segfaults on downloading any game with this command line:

$HOME/bin/lgogdownloader --download --directory "$HOME/gog" --report --platform 1 --language 3 --no-unicode --no-deb --no-duplicate-handling --cover --create-xml automatic --wait 3 --game "aqua"

The download directory does exist and is accessible.

Output from debug release:
DEBUG INFO (API::getResponse)
URL: https://api.gog.com/downloader2/status/stable/
DEBUG INFO (API::getAPIConfig)

{
"config" :
{
"error_log_endpoint" : "https://api.gog.com/downloader2/errorlog",
"get_extra_link" : "https://api.gog.com/downloader2/extra",
"get_game_details" : "https://api.gog.com/downloader2/game",
"get_installer_link" : "https://api.gog.com/downloader2/installer",
"get_user_details" : "https://api.gog.com/downloader2/user",
"get_user_games" : "https://api.gog.com/downloader2/user_games",
"oauth_authorize_temp_token" : "https://api.gog.com/oauth/login",
"oauth_get_temp_token" : "https://api.gog.com/oauth/initialize",
"oauth_get_token" : "https://api.gog.com/oauth/token",
"set_app_status" : "https://api.gog.com/downloader2/set_app_status"
},
"current_timestamp" : 1417952082,
"current_version" :
{
"mac_length" : false,
"mac_signature" : false,
"mac_sparkle_bundle" : false,
"url" : "http://static.gog.com/download/d3/stable/Setup_Downloader_3.6.0_stable.exe",
"version" : "3.6.0"
},
"link_expiration" : 600000,
"status" : "OK",
"status_update_timer" : 180000
}

....

DEBUG INFO (API::getResponseOAuth)
URL: https://api.gog.com/downloader2/extra/aqua_kitty_milk_mine_defender/25853/
DEBUG INFO (API::getResponse)
URL: https://api.gog.com/downloader2/extra/aqua_kitty_milk_mine_defender/25853/?oauth_consumer_key=XXXXXXXXXXXXXXXXXX&oauth_nonce=XXXXXXXXXXXXXXXX&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1417952145&oauth_token=XXXXXXXXXXXXXXXXXXX&oauth_version=1.0&oauth_signature=XXXXXXXXX
DEBUG INFO (API::getExtraLink)

{
"file" :
{
"available" : 1,
"link" : "http://wpc.11DF.edgecastcdn.net/0011DF/secure/aqua_kitty/extras/aqua_kitty_instructions.zip?23fb43868c5f174d699ac9533ffcf61b4c0533ab11514a15fa724c4b5b5146298ae5bc95c1c5cece89b42d18d388c2642dde4fdde92a143c616ed32f13e7c2303838f112ce43edb2a515fe50b79d64f810feea9b64adda686ca43131e6e4ee73fd34930c9a5194417b73&fileExtForIe=.exe",
"message" : "",
"name" : "Manual",
"type" : "bonus"
},
"result" : "ok",
"timestamp" : 1417952147
}

20088 Segmentation fault $HOME/bin/lgogdownloader --download --directory "/home/gog" --report --platform 1 --language 3 --no-unicode --no-deb --no-duplicate-handling --cover --create-xml automatic --wait 3 --game "aqua"

last lines of strace:
[{WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV}], 0) = 20398
brk(0x82a5000) = 0x82a5000
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77a8000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2570
brk(0x82a6000) = 0x82a6000
brk(0x82a7000) = 0x82a7000
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb77a8000, 4096) = 0
open("/usr/share/locale/en_US/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or
directory)

$ uname -a
Linux debby 3.2.0-4-686-pae #1 SMP Debian 3.2.63-2+deb7u1 i686 GNU/Linux

$ locale -a
C
C.UTF-8
en_US.utf8
POSIX

I think lgogdownloader does not gracefully handle locale support, if it cannot load missing locale files... it just crashes if it cannot load locale files. I do not have any problems with other tools though.

JSON for patches seems to have changed

The JSON for patches has changed. Basically, you need to get rid of the for-loop on line 355 in api.cpp. There is no longer an array in the patch node.

pt_br support

For Dragon Lore, lgogdownloader does not download all languages even if --language=524287 (current value for "All") is given.
In particular, the "portugues do brasil" versions of mac and windows setups are not downloaded.
It seems pt_BR and pt are different languages, please add support for both.

can not build using Codeblocks

||=== Build: Release in lgogdownloader (compiler: GNU GCC Compiler) ===|
include\downloader.h||In member function 'void Timer::reset()':|
include\downloader.h|20|error: 'gettimeofday' was not declared in this scope|
include\downloader.h||In member function 'double Timer::getTimeBetweenUpdates()':|
include\downloader.h|24|error: 'gettimeofday' was not declared in this scope|
include\boost\system\error_code.hpp|222|warning: 'boost::system::posix_category' defined but not used [-Wunused-variable]|
include\boost\system\error_code.hpp|223|warning: 'boost::system::errno_ecat' defined but not used [-Wunused-variable]|
include\boost\system\error_code.hpp|224|warning: 'boost::system::native_ecat' defined but not used [-Wunused-variable]|
||=== Build failed: 2 error(s), 3 warning(s) (0 minute(s), 2 second(s)) ===|

Add support for movies

GOG recently started selling movies; however, it seems lgogdownloader doesn't support downloading them: I added the two free movies into my account, but they don't appear when using lgogdownloader --list.

Would it be possible to add support for them, or would that be outside of the scope of the tool? I'd understand skipping that if it requires extensive work; I assume most people are still going to use GOG exclusively for games.

Add lgogdownloader version in .cache/lgogdownloader/gamedetails.json

Hi,

I'm working on Debian's game-data-packager project that aims to automate commercial game assets installation.

https://github.com/a-detiste/game-data-packager

I just added extensive support for lgogdownloader.

To speed up operations, I read .cache/lgogdownloader/gamedetails.json
directly. I don't know if you'll find this is an awesome or awfull idea. 😓

Would it be possible to add lgogdownloader's version a the top level of the json data ?

This way old cache info could be discarded. This is maybe usefull for lgogdownloader itself.

lgogdownloader

"Found nothing in " .... during updating the cache

Is this related to the current ongoing unbundling of the GOG installer or a bug in lgogdownloader?

$ lgogdownloader --version

LGOGDownloader 2.21 git d978498

$ lgogdownloader --update-cache
( I inserted some blanks for better readability and censored the OAuth )

HTTP ERROR: 403 (https://api.gog.com/downloader2/game/interstate76/installer_win_en?oauth_consumer_key=1f)
Found nothing in https://api.gog.com/downloader2/game/interstate76/installer_win_en

HTTP ERROR: 403 (https://api.gog.com/downloader2/game/kings_quest_1_2_3/installer_win_en?oauth_consumer_key=1f)
Found nothing in https://api.gog.com/downloader2/game/kings_quest_1_2_3/installer_win_en

HTTP ERROR: 403 (https://api.gog.com/downloader2/game/kings_quest_4_5_6/installer_win_en?oauth_consumer_key=1f4)
Found nothing in https://api.gog.com/downloader2/game/kings_quest_4_5_6/installer_win_en

HTTP ERROR: 403 (https://api.gog.com/downloader2/game/m_a_x_m_a_x_2/installer_win_en?oauth_consumer_key=1f)
Found nothing in https://api.gog.com/downloader2/game/m_a_x_m_a_x_2/installer_win_en

HTTP ERROR: 403 (https://api.gog.com/downloader2/game/patrician_1_2/installer_win_en?oauth_consumer_key=1f)
Found nothing in https://api.gog.com/downloader2/game/patrician_1_2/installer_win_en

HTTP ERROR: 403 (https://api.gog.com/downloader2/game/the_penumbra_collection/installer_win_en?oauth_consumer_key=1f)
Found nothing in https://api.gog.com/downloader2/game/the_penumbra_collection/installer_win_en

HTTP ERROR: 403 (https://api.gog.com/downloader2/game/pirates_gold_plus/installer_win_en?oauth_consumer_key=1f4)
Found nothing in https://api.gog.com/downloader2/game/pirates_gold_plus/installer_win_en

HTTP ERROR: 403 (https://api.gog.com/downloader2/game/wallace_gromits_grand_adventures/installer_win_en?oauth_consumer_key=1f4)
Found nothing in https://api.gog.com/downloader2/game/wallace_gromits_grand_adventures/installer_win_en
Getting game info 649 / 649

All games are currently not unbundled and Wallace and Gromitt is a game which you cannot buy anymore. Other games seem to load fine.

Repeated progress bar

This is a funny bug.

On my terminal window, trying to download a large game with really low speed, the progress bar is longer than the default 80 characters. And starts to repeat itself, like this.

captura de pantalla de 2014-11-26 14 15 15

After making the terminal window a bit larger, the issue dissapears.

captura de pantalla de 2014-11-26 14 23 35

Git HEAD exits without doing anything

I just updated to revision c1e7ade and, now, when I try to download games, it just prints a blank line and exits:

ssokolow@monolith GOG Games % lgogdownloader --download --game '^(braveland|the_guild_2_renaissance|the_guild_2|the_guild_2_pirates_of_the_european_seas)$'      

ssokolow@monolith GOG Games % 

Please note that I know the command's not at fault because, I put that command together after this wrapper-based command failed the same way when it normally either works or results in lgogdownloader giving a meaningful message indicating incorrect input:

gogd braveland the_guild_2_renaissance the_guild_2 the_guild_2_pirates_of_the_european_seas

For the record, I'm still on Ubuntu 12.04 and using git stash and git stash pop to carry forward the patch you gave me for C++ initializers on GCC 4.6.3.

Provide a manpage

LGOGDownloader should have a manpage. help2man will do the heavy lifting for you and I've provided an --include file which both polishes up the regular output and provides a cleaner version of what diziet_sma added.

The command I use it with is:

 help2man -N --version-string=2.11 -i lgogdownloader.supplemental.groff -o lgogdownloader.1 lgogdownloader

...but you can omit the --version-string=2.11 if you implement --version in lgogdownloader. (help2man insists that you provide a version number somehow)

Current master with platform=7 only downloads one version of large files.

I'm trying to download Pillars of Eternity - I regularly multiple computers and want to try & get saves synched across linux, windows and mac.

Ran using --platform=7 and it seems to download the windows and mac versions, but then delete the mac one (maybe?)

Full command: lgogdownloader --subdir-game='%gamename%/%platform%' --platform=7 --directory=pwd--game=pillars_of_eternity --download

[Feature Request] dump wishlist

It would be really neat, if lgogdownloader would list all games (not download, obviously) which are wishlisted (see https://www.gog.com/account/wishlist), eg

$ lgogdownloader --wishlist

produces:

1954 Alcatraz
Bird Story
Aarklash: Legacy
Agarest: Generations of War - Collector’s Edition
Anomaly Warzone Earth
...

Store installer packages in subdirectories per OS

That would make it cleaner than current placing of all installers for all targets in one root directory.

I.e. for example instead of

the_witcher_2/setup_the_witcher2_ee_3.4.0.25.exe
the_witcher_2/setup_the_witcher2_ee_3.4.0.25-*.bin
the_witcher_2/gog_the_witcher_2_assassins_of_kings_1.0.0.3.tar.gz

It can be:

the_witcher_2/windows/setup_the_witcher2_ee_3.4.0.25.exe
the_witcher_2/windows/setup_the_witcher2_ee_3.4.0.25-*.bin
the_witcher_2/linux/gog_the_witcher_2_assassins_of_kings_1.0.0.3.tar.gz
the_witcher_2/osx/...

And so on.

[Feature Request] Option to download only .tar.gz

I don't know if I'm just blind and didn't find the option, but we have filters for pretty much everything, from patches to extras to covers. I'm missing a filter like --no-deb (or --only-tar, whatever), that lets me NOT download the .deb files for linux games.

I hope I make sense somehow.

HTTP: Login Failed

I'm trying to login with LGOGDownloader 2.18 git d098654 but I get an error everytime I try, even though --verbose only shows HTTP200. Might my mail-address be a problem? It contains a +.

Please let me know if you need more information!

lgogdownloader --login --verbose
* Hostname was NOT found in DNS cache
*   Trying 212.91.20.79...
* Connected to api.gog.com (212.91.20.79) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSL connection using TLSv1.0 / AES256-SHA
* Server certificate:
*    subject: C=CY; L=\U039B\U03B5\U03C5\U03BA\U03C9\U03C3\U03AF\U03B1; O=GOG Limited; CN=*.gog.com
*    start date: 2014-08-06 00:00:00 GMT
*    expire date: 2015-10-14 12:00:00 GMT
*    subjectAltName: api.gog.com matched
*    issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance CA-3
*    SSL certificate verify ok.
> GET /downloader2/status/stable/ HTTP/1.1
Host: api.gog.com
Accept: */*

< HTTP/1.1 200 OK
* Server nginx is not blacklisted
< Server: nginx
< Date: Sun, 19 Oct 2014 10:34:22 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< Vary: Accept-Encoding
< X-H: Y
< 
* Connection #0 to host api.gog.com left intact
Email: ***+***@***
Password: 
* Hostname was NOT found in DNS cache
*   Trying 176.58.90.165...
* Connected to www.gog.com (176.58.90.165) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
*    subject: C=CY; L=\U039B\U03B5\U03C5\U03BA\U03C9\U03C3\U03AF\U03B1; O=GOG Limited; CN=*.gog.com
*    start date: 2014-08-06 00:00:00 GMT
*    expire date: 2015-10-14 12:00:00 GMT
*    subjectAltName: www.gog.com matched
*    issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance CA-3
*    SSL certificate verify ok.
> GET / HTTP/1.1
User-Agent: LGOGDownloader 2.18 git d098654
Host: www.gog.com
Accept: */*
Cookie: Origin=57; uqid=wAolVQQpiELda9GF4QHbCo6Rmnx676RuBiT2irqt7%252F8Nqfw6lQPw3HDqaTFVBN%252BJj1M1QAEfgEzM1g3%252Bmx60VpMKU2l8wQIOirIUsB0%252BU0c%253D

< HTTP/1.1 301 Moved Permanently
* Server nginx is not blacklisted
< Server: nginx
< Date: Sun, 19 Oct 2014 10:34:39 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 365
< Connection: keep-alive
< Cache-Control: no-cache
< Location: http://www.gog.com/
< Accept-Ranges: bytes
< X-H: N
< 
* Ignoring the response-body
* Connection #0 to host www.gog.com left intact
* Issue another request to this URL: 'http://www.gog.com/'
* Found bundle for host www.gog.com: 0x1cf5000
* Hostname was NOT found in DNS cache
*   Trying 176.58.90.116...
* Connected to www.gog.com (176.58.90.116) port 80 (#1)
> GET / HTTP/1.1
User-Agent: LGOGDownloader 2.18 git d098654
Host: www.gog.com
Accept: */*
Cookie: Origin=57; uqid=wAolVQQpiELda9GF4QHbCo6Rmnx676RuBiT2irqt7%252F8Nqfw6lQPw3HDqaTFVBN%252BJj1M1QAEfgEzM1g3%252Bmx60VpMKU2l8wQIOirIUsB0%252BU0c%253D

< HTTP/1.1 200 OK
< Content-Type: text/html; charset=UTF-8
< Vary: Accept-Encoding
< Cache-Control: max-age=60, public, s-maxage=60
< Expires: Sun, 19 Oct 2014 10:34:30 GMT
< Last-Modified: Sun, 19 Oct 2014 10:33:30 GMT
< Transfer-Encoding: chunked
< Date: Sun, 19 Oct 2014 10:34:37 GMT
< Connection: keep-alive
< X-H: Y
< 
* Connection #1 to host www.gog.com left intact
* Rebuilt URL to: https://login.gog.com/
* Hostname was NOT found in DNS cache
*   Trying 176.58.90.116...
* Connected to login.gog.com (176.58.90.116) port 443 (#2)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
*    subject: C=CY; L=\U039B\U03B5\U03C5\U03BA\U03C9\U03C3\U03AF\U03B1; O=GOG Limited; CN=*.gog.com
*    start date: 2014-08-06 00:00:00 GMT
*    expire date: 2015-10-14 12:00:00 GMT
*    subjectAltName: login.gog.com matched
*    issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance CA-3
*    SSL certificate verify ok.
> GET / HTTP/1.1
User-Agent: LGOGDownloader 2.18 git d098654
Host: login.gog.com
Accept: */*
Cookie: galaxy-login-al=ttcU965yBIGyRRfNqPDUTubPK0UlnL5s7JecRN03eeG7goerTAdYrRzoQr92au2MBj3j9_81qJ_iv-c-Kw3a6deB2L01eDDVqv47dQrJpuPiXusdmvLkY4o8eaBDFle_; galaxy-login-s=p387dm1ab254mls05dav3ra107; Origin=57; uqid=wAolVQQpiELda9GF4QHbCo6Rmnx676RuBiT2irqt7%252F8Nqfw6lQPw3HDqaTFVBN%252BJj1M1QAEfgEzM1g3%252Bmx60VpMKU2l8wQIOirIUsB0%252BU0c%253D

< HTTP/1.1 301 Moved Permanently
* Server nginx is not blacklisted
< Server: nginx
< Date: Sun, 19 Oct 2014 10:34:37 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 397
< Connection: keep-alive
< Cache-Control: no-cache
< Location: https://login.gog.com/login
* Replaced cookie galaxy-login-al="sIACa0sio6XuKUsa5CeicNHeZGO-G_gaz2esiT5zqenvyrrH3zpucEevlEttPu-nxEv5Wx3hNwM6N677873zfKbGl9_M8tuL6HCaJ4_GWeHgFCXQya0x37M5qh58KI9D" for domain login.gog.com, path /, expire 1445250878
< Set-Cookie: galaxy-login-al=sIACa0sio6XuKUsa5CeicNHeZGO-G_gaz2esiT5zqenvyrrH3zpucEevlEttPu-nxEv5Wx3hNwM6N677873zfKbGl9_M8tuL6HCaJ4_GWeHgFCXQya0x37M5qh58KI9D; expires=Mon, 19-Oct-2015 10:34:40 GMT; Max-Age=31536000; path=/; secure; httponly
< Accept-Ranges: bytes
< Accept-Ranges: bytes
< X-H: N
< 
* Ignoring the response-body
* Connection #2 to host login.gog.com left intact
* Issue another request to this URL: 'https://login.gog.com/login'
* Found bundle for host login.gog.com: 0x1e18720
* Re-using existing connection! (#2) with host login.gog.com
* Connected to login.gog.com (176.58.90.116) port 443 (#2)
> GET /login HTTP/1.1
User-Agent: LGOGDownloader 2.18 git d098654
Host: login.gog.com
Accept: */*
Cookie: galaxy-login-al=sIACa0sio6XuKUsa5CeicNHeZGO-G_gaz2esiT5zqenvyrrH3zpucEevlEttPu-nxEv5Wx3hNwM6N677873zfKbGl9_M8tuL6HCaJ4_GWeHgFCXQya0x37M5qh58KI9D; galaxy-login-s=p387dm1ab254mls05dav3ra107; Origin=57; uqid=wAolVQQpiELda9GF4QHbCo6Rmnx676RuBiT2irqt7%252F8Nqfw6lQPw3HDqaTFVBN%252BJj1M1QAEfgEzM1g3%252Bmx60VpMKU2l8wQIOirIUsB0%252BU0c%253D

< HTTP/1.1 200 OK
* Server nginx is not blacklisted
< Server: nginx
< Date: Sun, 19 Oct 2014 10:34:37 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 5262
< Connection: keep-alive
< Vary: Accept-Encoding
< Vary: Accept-Encoding
< Cache-Control: no-cache
* Replaced cookie galaxy-login-al="OtjRQLvntQModfTv0go3BuqXv9xOGRZKmhFbAtMhb0AuRBQo0KhQdCQ1K6UCyIbVVvGHtZ8yAL4p8KgTkV9qQHQ1vG1ufPcbYfNViaRbnyN9WSMuQGaBLVXGx6PNlJqF" for domain login.gog.com, path /, expire 1445250878
< Set-Cookie: galaxy-login-al=OtjRQLvntQModfTv0go3BuqXv9xOGRZKmhFbAtMhb0AuRBQo0KhQdCQ1K6UCyIbVVvGHtZ8yAL4p8KgTkV9qQHQ1vG1ufPcbYfNViaRbnyN9WSMuQGaBLVXGx6PNlJqF; expires=Mon, 19-Oct-2015 10:34:39 GMT; Max-Age=31536000; path=/; secure; httponly
< Accept-Ranges: bytes
< Accept-Ranges: bytes
< X-H: N
< 
* Connection #2 to host login.gog.com left intact
* Found bundle for host login.gog.com: 0x1e18720
* Re-using existing connection! (#2) with host login.gog.com
* Connected to login.gog.com (176.58.90.116) port 443 (#2)
> POST /login_check HTTP/1.1
User-Agent: LGOGDownloader 2.18 git d098654
Host: login.gog.com
Accept: */*
Cookie: galaxy-login-al=OtjRQLvntQModfTv0go3BuqXv9xOGRZKmhFbAtMhb0AuRBQo0KhQdCQ1K6UCyIbVVvGHtZ8yAL4p8KgTkV9qQHQ1vG1ufPcbYfNViaRbnyN9WSMuQGaBLVXGx6PNlJqF; galaxy-login-s=p387dm1ab254mls05dav3ra107; Origin=57; uqid=wAolVQQpiELda9GF4QHbCo6Rmnx676RuBiT2irqt7%252F8Nqfw6lQPw3HDqaTFVBN%252BJj1M1QAEfgEzM1g3%252Bmx60VpMKU2l8wQIOirIUsB0%252BU0c%253D
Content-Length: 190
Content-Type: application/x-www-form-urlencoded

* upload completely sent off: 190 out of 190 bytes
< HTTP/1.1 302 Found
* Server nginx is not blacklisted
< Server: nginx
< Date: Sun, 19 Oct 2014 10:34:37 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 321
< Connection: keep-alive
* Replaced cookie galaxy-login-s="8icptphht0hd7qs130i439g585" for domain login.gog.com, path /, expire 1430994878
< Set-Cookie: galaxy-login-s=8icptphht0hd7qs130i439g585; expires=Thu, 07-May-2015 10:34:39 GMT; Max-Age=17280000; path=/; secure; HttpOnly
< Cache-Control: no-cache
< Location: /account
* Replaced cookie galaxy-login-al="OZeaeCfkzdikrQQKBiUc4mUOqtbLgeTJg4zZfMZHTLvPZdKSlsce1PgHL88qgB5A-JfnSQK9NFSU3EifFlaJXCgd0plS0E3IaQXzGjeUj0tv2zt18oLxJKJbAZlxcpRG" for domain login.gog.com, path /, expire 1445250878
< Set-Cookie: galaxy-login-al=OZeaeCfkzdikrQQKBiUc4mUOqtbLgeTJg4zZfMZHTLvPZdKSlsce1PgHL88qgB5A-JfnSQK9NFSU3EifFlaJXCgd0plS0E3IaQXzGjeUj0tv2zt18oLxJKJbAZlxcpRG; expires=Mon, 19-Oct-2015 10:34:39 GMT; Max-Age=31536000; path=/; secure; httponly
< Accept-Ranges: bytes
< Accept-Ranges: bytes
< X-H: N
< 
* Connection #2 to host login.gog.com left intact
* Found bundle for host login.gog.com: 0x1e18720
* Re-using existing connection! (#2) with host login.gog.com
* Connected to login.gog.com (176.58.90.116) port 443 (#2)
> GET /account HTTP/1.1
User-Agent: LGOGDownloader 2.18 git d098654
Host: login.gog.com
Accept: */*
Cookie: galaxy-login-al=OZeaeCfkzdikrQQKBiUc4mUOqtbLgeTJg4zZfMZHTLvPZdKSlsce1PgHL88qgB5A-JfnSQK9NFSU3EifFlaJXCgd0plS0E3IaQXzGjeUj0tv2zt18oLxJKJbAZlxcpRG; galaxy-login-s=8icptphht0hd7qs130i439g585; Origin=57; uqid=wAolVQQpiELda9GF4QHbCo6Rmnx676RuBiT2irqt7%252F8Nqfw6lQPw3HDqaTFVBN%252BJj1M1QAEfgEzM1g3%252Bmx60VpMKU2l8wQIOirIUsB0%252BU0c%253D

< HTTP/1.1 200 OK
* Server nginx is not blacklisted
< Server: nginx
< Date: Sun, 19 Oct 2014 10:34:38 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 1261
< Connection: keep-alive
< Vary: Accept-Encoding
< Vary: Accept-Encoding
< Cache-Control: no-cache
* Replaced cookie galaxy-login-al="Rp_mnzjeJ66fJOeZ88gnck8FBLmeojlmZhalTFtV5EVqgx8NkaE8ZMKqgVCR13UN3VjUHRHNBIA1lV-81itt7RZa1hEngxG727vELQ9GlEPsltbTK1GHJjVeT5QJHc72" for domain login.gog.com, path /, expire 1445250879
< Set-Cookie: galaxy-login-al=Rp_mnzjeJ66fJOeZ88gnck8FBLmeojlmZhalTFtV5EVqgx8NkaE8ZMKqgVCR13UN3VjUHRHNBIA1lV-81itt7RZa1hEngxG727vELQ9GlEPsltbTK1GHJjVeT5QJHc72; expires=Mon, 19-Oct-2015 10:34:39 GMT; Max-Age=31536000; path=/; secure; httponly
< Accept-Ranges: bytes
< Accept-Ranges: bytes
< X-H: N
< 
* Connection #2 to host login.gog.com left intact
* Found bundle for host www.gog.com: 0x1cf5000
* Re-using existing connection! (#0) with host www.gog.com
* Connected to www.gog.com (176.58.90.165) port 443 (#0)
> GET /account/settings HTTP/1.1
User-Agent: LGOGDownloader 2.18 git d098654
Host: www.gog.com
Accept: */*
Cookie: Origin=57; uqid=wAolVQQpiELda9GF4QHbCo6Rmnx676RuBiT2irqt7%252F8Nqfw6lQPw3HDqaTFVBN%252BJj1M1QAEfgEzM1g3%252Bmx60VpMKU2l8wQIOirIUsB0%252BU0c%253D

< HTTP/1.1 302 Moved Temporarily
* Server nginx is not blacklisted
< Server: nginx
< Date: Sun, 19 Oct 2014 10:34:40 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Location: http://www.gog.com/##openlogin
* Added cookie guc_al="deleted" for domain gog.com, path /, expire 1
< Set-Cookie: guc_al=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.gog.com
< charset: utf-8
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: Accept-Encoding, Cookie
< Accept-Ranges: bytes
< Accept-Ranges: bytes
< X-H: N
< 
* Connection #0 to host www.gog.com left intact
* Issue another request to this URL: 'http://www.gog.com/##openlogin'
* Found bundle for host www.gog.com: 0x1cf5000
* Re-using existing connection! (#1) with host www.gog.com
* Connected to www.gog.com (176.58.90.116) port 80 (#1)
> GET / HTTP/1.1
User-Agent: LGOGDownloader 2.18 git d098654
Host: www.gog.com
Accept: */*
Cookie: Origin=57; uqid=wAolVQQpiELda9GF4QHbCo6Rmnx676RuBiT2irqt7%252F8Nqfw6lQPw3HDqaTFVBN%252BJj1M1QAEfgEzM1g3%252Bmx60VpMKU2l8wQIOirIUsB0%252BU0c%253D

< HTTP/1.1 200 OK
< Content-Type: text/html; charset=UTF-8
< Vary: Accept-Encoding
< Cache-Control: max-age=60, public, s-maxage=60
< Expires: Sun, 19 Oct 2014 10:34:30 GMT
< Last-Modified: Sun, 19 Oct 2014 10:33:30 GMT
< Transfer-Encoding: chunked
< Date: Sun, 19 Oct 2014 10:34:38 GMT
< Connection: keep-alive
< X-H: Y
< 
* Connection #1 to host www.gog.com left intact
HTTP: Login failed

jsoncpp path change

At least on Arch jsoncpp moved to just /usr/include/json

It errors on compile until I change all the

#include <jsoncpp/json/json.h>

lines to

#include <json/json.h>

Program works great after compiling.

--backup option

A --backup option that download everything possible would be a killer feature.
I have a lot of games and I would love to have a simple way to backup my entire account.

Compiling problems on slackware-current gcc ++ 4.92

Hi,

I have some compiling problems with the current commit 9db2b8f .
OS is Slackware Linux Current, Compiler is GCC 4.92
Linux Kernel 3.10-7

It has some issues on building main.c, where it falls flat on basic IOlib. According to https://stackoverflow.com/questions/21138340/mismatched-c-header-versions it has something to do with the compiling command in the Makefile.

In file included from /usr/include/c++/4.9.2/i486-slackware-linux/bits/c++config.h:430:0,
from /usr/include/c++/4.9.2/iostream:38,
from include/config.h:10,
from include/downloader.h:24,
from main.cpp:7:
/usr/include/c++/4.9.2/i486-slackware-linux/bits/os_defines.h:44:19: error: missing binary operator before token "("
#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
^
In file included from /usr/include/c++/4.9.2/cwchar:44:0,
from /usr/include/c++/4.9.2/bits/postypes.h:40,
from /usr/include/c++/4.9.2/iosfwd:40,
from /usr/include/c++/4.9.2/ios:38,
from /usr/include/c++/4.9.2/ostream:38,
from /usr/include/c++/4.9.2/iostream:39,
from include/config.h:10,
from include/downloader.h:24,
from main.cpp:7:
/usr/include/wchar.h:74:43: error: missing binary operator before token "("

if defined __cplusplus && __GNUC_PREREQ (4, 4)

...

                      ^

In file included from /usr/include/libio.h:56:0,
from /usr/include/stdio.h:74,
from /usr/include/c++/4.9.2/cstdio:42,
from /usr/include/c++/4.9.2/ext/string_conversions.h:43,
from /usr/include/c++/4.9.2/bits/basic_string.h:2850,
from /usr/include/c++/4.9.2/string:52,
from /usr/include/c++/4.9.2/bits/locale_classes.h:40,
from /usr/include/c++/4.9.2/bits/ios_base.h:41,
from /usr/include/c++/4.9.2/ios:42,
from /usr/include/c++/4.9.2/ostream:38,
from /usr/include/c++/4.9.2/iostream:39,
from include/config.h:10,
from include/downloader.h:24,
from main.cpp:7:
/usr/include/stdio.h:942:1: error: expected declaration before '}' token
__END_DECLS
^
make: *** [obj/Debug/main.o] Error 1

Full error log on Pastebin:
http://pastebin.com/raw.php?i=yfH48Ev4

--language switch not honored with --status

Language selection seems to be ignored if used with status.

ls -R a_new_beginning/
a_new_beginning/:
cover_0.png
extras
setup_a_new_beginning_final_cut_2.1.0.6-1.bin
setup_a_new_beginning_final_cut_2.1.0.6-2.bin
setup_a_new_beginning_final_cut_2.1.0.6-3.bin
setup_a_new_beginning_final_cut_2.1.0.6.exe

a_new_beginning/extras:
a_new_beginning_artworks.zip     a_new_beginning_manual.zip
a_new_beginning_avatars.zip      a_new_beginning_soundtrack.zip
a_new_beginning_concept_art.zip  a_new_beginning_wallpapers.zip

Example output:

$ lgogdownloader --language 3 --game a_new_beginning --list-details
Getting game info 1 / 1
gamename: a_new_beginning
title: A New Beginning - Final Cut
icon: http://static.gog.com/upload/images/2012/12/84aa231ededa7348c007fe03d3efcc0a3ee4ced5.jpg
installers:
        id: en1installer3
        name: Windows Installer, English
        path: /new_beginning/pc/setup_a_new_beginning_final_cut_2.1.0.6.exe
        size: 1
        updated: False

        id: en1installer4
        name: Windows Installer, English
        path: /new_beginning/pc/setup_a_new_beginning_final_cut_2.1.0.6-1.bin
        size: 1500
        updated: False

        id: en1installer5
        name: Windows Installer, English
        path: /new_beginning/pc/setup_a_new_beginning_final_cut_2.1.0.6-2.bin
        size: 1500
        updated: False

        id: en1installer6
        name: Windows Installer, English
        path: /new_beginning/pc/setup_a_new_beginning_final_cut_2.1.0.6-3.bin
        size: 586.8
        updated: False

        id: de1installer3
        name: Windows Installer, German
        path: /new_beginning/pc/setup_a_new_beginning_final_cut_2.1.0.6.exe
        size: 1
        updated: False

        id: de1installer4
        name: Windows Installer, German
        path: /new_beginning/pc/setup_a_new_beginning_final_cut_2.1.0.6-1.bin
        size: 1500
        updated: False

        id: de1installer5
        name: Windows Installer, German
        path: /new_beginning/pc/setup_a_new_beginning_final_cut_2.1.0.6-2.bin
        size: 1500
        updated: False

        id: de1installer6
        name: Windows Installer, German
        path: /new_beginning/pc/setup_a_new_beginning_final_cut_2.1.0.6-3.bin
        size: 586.8
        updated: False

extras:
        id: 20103
        name: a_new_beginning_artworks.zip
        path: /a_new_beginning/extras/a_new_beginning_artworks.zip
        size:

        id: 20113
        name: a_new_beginning_avatars.zip
        path: /a_new_beginning/extras/a_new_beginning_avatars.zip
        size:

        id: 20123
        name: a_new_beginning_concept_art.zip
        path: /a_new_beginning/extras/a_new_beginning_concept_art.zip
        size:

        id: 20133
        name: a_new_beginning_manual.zip
        path: /a_new_beginning/extras/a_new_beginning_manual.zip
        size:

        id: 20143
        name: a_new_beginning_soundtrack.zip
        path: /a_new_beginning/extras/a_new_beginning_soundtrack.zip
        size:

        id: 20153
        name: a_new_beginning_wallpapers.zip
        path: /a_new_beginning/extras/a_new_beginning_wallpapers.zip
        size:

output is ok.

Now, running a check with --status:

$ lgogdownloader --language 3 --game a_new_beginning --status
Getting game info 1 / 1
OK a_new_beginning setup_a_new_beginning_final_cut_2.1.0.6.exe 809168 b9633cac4f7d6acfc950a45a86c78483
OK a_new_beginning setup_a_new_beginning_final_cut_2.1.0.6-1.bin 1565198720 e886c99679507122c613023ee76e387f
OK a_new_beginning setup_a_new_beginning_final_cut_2.1.0.6-2.bin 1566000000 afebbdb9ae9bed618f79e7b7ab8b2397
OK a_new_beginning setup_a_new_beginning_final_cut_2.1.0.6-3.bin 615300857 97ae1edf303d06275da33dd034f44ab8
OK a_new_beginning setup_a_new_beginning_final_cut_2.1.0.6.exe 809168 b9633cac4f7d6acfc950a45a86c78483
OK a_new_beginning setup_a_new_beginning_final_cut_2.1.0.6-1.bin 1565198720 e886c99679507122c613023ee76e387f
OK a_new_beginning setup_a_new_beginning_final_cut_2.1.0.6-2.bin 1566000000 afebbdb9ae9bed618f79e7b7ab8b2397
OK a_new_beginning setup_a_new_beginning_final_cut_2.1.0.6-3.bin 615300857 97ae1edf303d06275da33dd034f44ab8
OK a_new_beginning a_new_beginning_artworks.zip 8098452 41e23fea7485976119074ad294ff49bc
OK a_new_beginning a_new_beginning_avatars.zip 617190 ca22e45e7f90d9190792d2c4bffeff78
OK a_new_beginning a_new_beginning_concept_art.zip 6622156 4414c8a73995f56325e184be3987c6f9
OK a_new_beginning a_new_beginning_manual.zip 2913044 7fad9b3e1a6c268bea3fee61309cf449
OK a_new_beginning a_new_beginning_soundtrack.zip 77963093 c24e7652b54b0dfb0541f57f399b80be
OK a_new_beginning a_new_beginning_wallpapers.zip 8770736 bf64a86ef4e424d3d0d4a56e4ef4f34e

Note that only english version of installer are checked, but should check German + English (--language 3 = 1 + 2), output should provide ND for the missing de1installer*.

In addition, I'm not sure why the following command line only downloads the English version of the installer:

$ lgogdownloader --language 3 --platform 1 --no-unicode --directory /blah/fasel --game "a_new_beginning" --download

--status does not detect incomplete download on armv7

I have tried using my little odroid-c1 for big downloads from gog. One of the downloads got interrupted and running 'lgogdownloader --status' does not detect the incomplete download.

The actual size as reported by ls:

$ ls -al
3532570624 Jun 21 21:48 gog_the_book_of_unwritten_tales_2_1.0.0.1.tar.gz

The content of the xml file provided by gog:

$ more gog_the_book_of_unwritten_tales_2_1.0.0.1.tar.gz.xml
<file name="gog_the_book_of_unwritten_tales_2_1.0.0.1.tar.gz" available="1" notavailablemsg="" md5="b899f85f6cf15fde0e80a08b0a1429
17" chunks="475" timestamp="2015-02-23 18:04:45" total_size="4973333114">

The output of --status:

$ lgogdownloader --status --game the_book_of_unwritten_tales_2_almanac_edition
OK the_book_of_unwritten_tales_2_almanac_edition gog_the_book_of_unwritten_tales_2_1.0.0.1.tar.gz 3532570624 b899f85f6cf15fde0e80a08b0a142917

So lgogdownloader does not detect the difference between the size of downloaded file and the total size as stated by the gog api.

This problem seems to be specific to either 32bit platforms or even the armv7 platform: If I move these files to a x64 box, the size difference is detected and the download resumed accordingly.

Tested against current master.
Platform:
odroid-c1 running ArchLinuxARM

crashes on ubuntu 14.04

Hello,

I installed lgogdownloader from the webupd8-ppa (ppa:nilarimogard/webupd8 ).

My system is ubuntu 14.04.3.

Upon starting lgogdownloader the first time, I get:

Email: ...
Password: 
API: Login successful
Saving config: /home/max/.config/lgogdownloader/config.cfg
fish: Job 1, 'lgogdownloader' durch Signal SIGSEGV (Adressbereichsfehler) beendet

where the last line indicates a SIGSEGV. Running it a second time gives:

Email: [email protected]
Password: 
API: Login successful
*** Error in `lgogdownloader': double free or corruption (fasttop): 0x00000000007a5170 ***
fish: Job 1, 'lgogdownloader' durch Signal SIGABRT (Abbruch) beendet

Running it repeatedly will always give me the last error message.
Note that the program creates the file /home/max/.config/lgogdownloader/config.cfg. If /home/max/.config/lgogdownloader/ is deleted, a program run will again give the first error message.

backtracks from gdb:
first run (no .config/lgogdownloader):

#0  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:36
#1  0x00007ffff63133c0 in std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) () from /usr/local/lib/libstdc++.so.6
#2  0x00007ffff6313b7c in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /usr/local/lib/libstdc++.so.6
#3  0x00000000004182ac in ?? ()
#4  0x00007ffff598fec5 in __libc_start_main (main=0x413e20, argc=1, argv=0x7fffffffe408, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe3f8)
    at libc-start.c:287
#5  0x0000000000413ad9 in ?? ()

subsequent runs:

#0  0x00007ffff59a4cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff59a80d8 in __GI_abort () at abort.c:89
#2  0x00007ffff59e1394 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff5aefb28 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff59ed66e in malloc_printerr (ptr=<optimized out>, str=0x7ffff5aefcf0 "double free or corruption (fasttop)", action=1) at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840
#5  0x00007ffff6313c5f in std::string::assign(std::string const&) () from /usr/local/lib/libstdc++.so.6
#6  0x000000000042a80c in ?? ()
#7  0x00007ffff6bef1cb in boost::program_options::variables_map::notify() () from /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.54.0
#8  0x00000000004181d7 in ?? ()
#9  0x00007ffff598fec5 in __libc_start_main (main=0x413e20, argc=1, argv=0x7fffffffe408, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe3f8)
    at libc-start.c:287
#10 0x0000000000413ad9 in ?? ()

Interestingly, the program ends without errors, if the provided credentials are wrong.

those are my boost libraries:

ii  libboost-date-time1.54.0:amd64                        1.54.0-4ubuntu3.1                     amd64        set of date-time libraries based on generic programming concepts
ii  libboost-filesystem1.54.0:amd64                       1.54.0-4ubuntu3.1                     amd64        filesystem operations (portable paths, iteration over directories, etc) in C++
rc  libboost-iostreams1.49.0                              1.49.0-4                              amd64        Boost.Iostreams Library
rc  libboost-iostreams1.53.0:amd64                        1.53.0-6+exp3ubuntu8                  amd64        Boost.Iostreams Library
ii  libboost-iostreams1.54.0:amd64                        1.54.0-4ubuntu3.1                     amd64        Boost.Iostreams Library
ii  libboost-locale1.54.0:amd64                           1.54.0-4ubuntu3.1                     amd64        C++ facilities for localization
ii  libboost-program-options1.54.0:amd64                  1.54.0-4ubuntu3.1                     amd64        program options library for C++
ii  libboost-regex1.54.0:amd64                            1.54.0-4ubuntu3.1                     amd64        regular expression library for C++
ii  libboost-system1.54.0:amd64                           1.54.0-4ubuntu3.1                     amd64        Operating system (e.g. diagnostics support) library
ii  libboost-thread1.54.0:amd64                           1.54.0-4ubuntu3.1                     amd64        portable C++ multi-threading

my libc is version 2.19 and my libstdc++ is 4.8.4.

Will this do? I could also build a debug lgogdownloader and post its gdb here, if necessary.

"all" alias doesn't work anymore

"--game all" will only install games that contain the string "all" in its name. The regex .* will work. Either the program or the documentation needs to be fixed ;).

Cant Login.

there seems to be an issue that has appeared today. when i try to log in now is says

HTTP response code said error

  • Line 1, Column 1
    Syntax error: value, object or array expected.
    HTTP: Login failed

this was happening before when i was trying to update my collection with lgogdownloader as well.

i am using the current git version and been working all week till now. unsure if gog have changed something there end.

use-cache and update-cache options clash

Says it all. the trouble is, I had use-cache = true in my configfile with --save, and after that --update-cache did either not update it, or produced an empty cache file. It should at least give a warning (or perhaps better, override it).

Parsing error? * Line 1, Column 1 Syntax error: value, object or array expected.

On download/status I get the following message:
"* Line 1, Column 1
Syntax error: value, object or array expected."

It worked fine at the start of the summer sale, but I noticed this problem yesterday using v2.23 and it continued when I changed to c4c2f8c.
Debug build shows all the game info is there in a massive block of JSON so it seems like a parsing error.

lgogdownloader deletes partially downloaded files

When downloading a file, if the remote server prematurely closes the connection, resulting in a partial file download, then lgogdownloader deletes the partially downloaded file. On the next run of lgogdownloader, it attempts to download the file from the beginning instead of resuming from where it left off.

Servers prematurely ending the connection result in libcurl returning the CURLE_PARTIAL_FILE error code. lgogdownloader should probably check for this code and not delete a partially downloaded file.

Building on current Debian testing fails on help2man step

lcxx -lboost_system -lboost_filesystem -lboost_regex -lboost_program_options -lboost_date_time -ltinyxml -lrhash -o bin/Release/lgogdownloader
help2man -N -i man/lgogdownloader.supplemental.groff -o man/lgogdownloader.1 bin/Release/lgogdownloader
help2man: can't get `--help' info from bin/Release/lgogdownloader
Try `--no-discard-stderr' if option outputs to stderr
Makefile:101: recipe for target 'after_release' failed
make: *** [after_release] Error 1

Running ./lgogdownloader --help produces:

Error: unrecognised option 'no-cover'

Download hangs after forced 24h reconnect of ISP

In Germany our biggest internet company "Telekom" has a "nice" feature called "Zwangstrennung". That means that after 24h they do a forced disconnect and give you a new IP address.

When this happens lgogdownloader just hangs with an output like

77% [===============     ] 2803.53/3645.88MB @ 0.00kB/s ETA: 24855d 03h 14m 07s

and must be ^C/-ed (SIGINT) and restarted (after restart the download continues at the position I stopped it, that's cool)

lgogdownloader runs unsupervised on my RasPi. So I usually see this hang when I get home and nothing downloaded for hours :(. No I can't try to avoid this because my internet connection is really slow and some downloads take ages to finish.

Would it be possible for lgogdownloader to detect when a download hangs and try to continue it?

Getting rhash error

I seem to get a consistent error whan trying to update my entire collection.
I says that rhash has too many files open. Im no Linux guru so I dont know if this is a mistake im making or it is an issue.

I am using Debian 7.

I have a txt of the entire process if you want to see it.

Command line used was as follows:
lgogdownloader --repair --download --game all --platform 3 --language 16383 --no-installers --no-patches

It starts to fail about half way through the game list. I have 460+ games.

Anything else i can tell you, let me know. Sorry if it is not an issue with the app.

--platform has no effect on game listing

With the --platform option specified (both via config file and view command line), the --list command still lists all the games on the account, even those not supported on the specified platform(s).

It would be nice to be able to list only games supported on the specified platforms.

Segmentation fault when downloading covers

As I am still new to Linux, I did some research into what segmentation faults were and one of the possibilities was incorrect access of arrays in programs written in C.
I am consistently getting a segmentation fault when downloading covers for Broken Sword 5. I believe I have tracked down the problem to be that the covers.xml file labels the game as
"broken_sword_5_the_serpents_curse"
where as it should read
"broken_sword_5_the_serpents_curse_episode_1"
This would mean that when it looks in the array created by reading the xml, it looks for the entry "broken_sword_5_the_serpents_curse_episode_1", finds nothing, throws out a fault and quits the downloader.
I hope what I have said makes sense.

Game downloading without downloading sequels

Heyho regex are nice and all, but if I want to download the_witcher and I use
lgogdownloader --no-extras --download --game the_witcher
the first thing that gets downloaded is the_witcher_2/*
I don't know how the regex is implemented (didn't read the code) but it seems like a .+ is added to the end automaticly.

Fix using local xml for hashes

Downloader::downloadFile ist not passing gamename to getLocalFileHash, which then cannot find the xml-file.

Line 881
std::string localHash = this->getLocalFileHash(filepath);
should be fixed to
std::string localHash = this->getLocalFileHash(filepath, gamename);

Every other instance of getLocalFileHash passes it in already.

[feature suggestion] add more --list- options

When we want to list only installers for a given game, we need to use something like --list-details --no-extras --no-patches --no-dlc
It would be nice to have more options like --list-installers, --list-extras, etc. that would list only one type of files for a given game.

Support for the XDG Base Directory Specification

This is a feature request for supporting the XDG Base Directory Specification.

The specification works around a bug during the early UNIX v2 rewrite which caused files prepended with a '.' to be ignored from the output of ls.
While this "bug" has become a feature for some, it has also become a headache for users when developers continue to assume HOME is a great place to dump configuration files and local caches.

To address these issues XDG Basedir was formed to give developers a standard location for these files and giving the users control over where they are placed in their HOME.

If you were to support the XDG specification the following locations would change:

# XDG_CONFIG_HOME should expand to what the user set or fallback to "$HOME"/.config"
"$HOME"/.gogdownloader     → "$XDG_CONFIG_HOME"/gogdownloader

# XDG_CACHE_HOME should expand to what the user set or fallback to "$HOME"/.cache"
"$HOME"/.gogdownloader/xml → "$XDG_CACHE_HOME"/gogdownloader{,/xml}

# or
# XDG_DATA_HOME should expand to what the user set or fallback to "$HOME"/.local/share"
"$HOME"/.gogdownloader/xml → "$XDG_DATA_HOME"/gogdownloader{,/xml}

Thanks o/

Game listed but not downloaded

I've just bought a game (namely Grandia 2 anniversary edition) and the following command won't download it:

lgogdownloader --download --game ^grandia_ii_anniversary_edition$

The game gets listed but the download won't start. I don't get any error message. It just comes back to the prompt right after listing the game.

PS: I use the latest 2.26 version on my ubuntu 15.04

Priority list of OS and languages

Hello,

First, thanks for lgogdownloader, great tool :)

There is one feature I would like : the ability to specify a priority list of OS and languages, and have lgogdownloader only gets one per game, the highest priority possible. Like, if the game is available on Linux, get only the Linux version, if not, get the Windows version, but never download both the Linux and Windows version. Same for language : if the game has a French version, I would like the French one, else the English one, but never both.

Right now for some games (like, Baldur's Gate) it downloads the game 4 times : Linux French (the one I want), Linux English, Windows French and Windows English.

And the same apply within Linux for deb vs tgz, I would like .deb if available, .tgz else, but never both.

I can try to write a patch to implement that, but I would like first to know if it's a feature you would be ok to add "upstream", and if you've any preference on the syntax to use to configure that in the configuration file.

Regards,

Save CD keys if present

I use lgogdownloader to make sure I've got everything in my game backups in case GOG is ever forced to pull a game so thoroughly that it's removed from my account.

However, I still have to manually save any CD keys that may be present in the library expanders and that's awkward, error prone, and time-consuming. (especially given that the expanders close in response to a right-click)

If nothing else, LGOGDownloader should grab the expander body and save it, verbatim, in a file with a name like cd_keys.html (Though, ideally, I'd prefer to see it pared down to just the relevant bits and stored as cd_keys.txt instead)

check orphans: allow regex to match path

It would be useful to be able to match the whole path (starting after --directory) in the regex of --check-orphans.
I put folders with other (non-gog) files in the game folder, for example a folder 'mods' for mods or 'maps', etc.
I would like to use the regex
^.?/(|extras/|patches/|languagepacks/|dlc/).$
to match only files downloaded by the downloader.

This would mean changing line 1933 in downloader.cpp from
std::string filename = dir_iter->path().filename().string();
to
std::string filename = dir_iter->path().string();

The default regex should continue to work with this change.

boolean (0 and 1)

I do not understand why you use 0 for true and 1 for false (integer) in your code. Why not bool/boolean values? This confused me sometimes.

[enhancement] keeping files on --check-orphan

Would it be possible to define an additional switch for --check-orphan to define a regexp for files which are "orphaned" but should be ignored?

Reason for this is that I'd like to put a ".keep" directory where I store my bundled old installers which should not be deleted.

Syntax would be for this like
$ lgogdownload --keep-orphans ".keep" --check-orphans

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.