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

×
This thread should be sticky. I just found about this :D. Cool! I'll try this with my next d/l :)
Link to the project (this is not linked with each release notes): https://github.com/Sude-/lgogdownloader
Hi,
Got a crash with 2.7, end of debug version output:
...
URL: https://api.gog.com/downloader2/game/battle_isle_platinum/installer_win_en
DEBUG INFO (API::getResponse)
URL: https://api.gog.com/downloader2/game/battle_isle_platinum/installer_win_en?oauth_consumer_key=....&oauth_nonce=....&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1375896537&oauth_token=....&oauth_version=1.0&oauth_signature=....%3D
DEBUG INFO (API::getGameDetails)

{
"game" :
{
"en1patch1" :
{
"comment" : "",
"id" : "en1patch1",
"link" : "/battle_isle_platinum/pc/patch/patch_battle_isle_platinum_2.1.0.19.exe",
"name" : "Universal update (2.0.0 -> 2.1.0)",
"notificated" : "1",
"size" : "84",
"version_from" : "",
"version_to" : ""
},
"extras" : [],
"icon" : "/upload/images/2011/03/fb8d7fdc6c67c129b83d3a380c2b475b8da36294.jpg",
"installer_win_en" :
[

{
"id" : "en1installer0",
"link" : "/battle_isle_platinum/pc/setup_battle_isle_platinum_2.1.0.19.exe",
"name" : "Windows Installer, English",
"notificated" : "1",
"registry_key" : "",
"silent" : 0,
"size" : "1200"
}
],
"title" : "Battle Isle Platinum (includes Incubation)"
},
"result" : "ok",
"timestamp" : 1375896537
}

lgogdownloader: src/lib_json/json_value.cpp:1072: Json::Value& Json::Value::operator[](Json::Value::ArrayIndex): Assertion `type_ == nullValue || type_ == arrayValue' failed.
[1] 3017 abort ~/src/lgogdownloader/bin/Debug/lgogdownloader --download --platform 1 1
Backtrace:
Program received signal SIGABRT, Aborted.
0x00007ffff59981e5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type.
(gdb) bt
#0 0x00007ffff59981e5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff599b398 in __GI_abort () at abort.c:90
#2 0x00007ffff5991272 in __assert_fail_base (fmt=0x7ffff5ace900 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x7ffff775a840 "type_ == nullValue || type_ == arrayValue", file=file@entry=0x7ffff775a368 "src/lib_json/json_value.cpp",
line=line@entry=1072, function=function@entry=0x7ffff775ab00 "Json::Value& Json::Value::operator[](Json::Value::ArrayIndex)") at assert.c:92
#3 0x00007ffff5991322 in __GI___assert_fail (assertion=0x7ffff775a840 "type_ == nullValue || type_ == arrayValue", file=0x7ffff775a368 "src/lib_json/json_value.cpp",
line=1072, function=0x7ffff775ab00 "Json::Value& Json::Value::operator[](Json::Value::ArrayIndex)") at assert.c:101
#4 0x00007ffff774ea46 in Json::Value::operator[](unsigned int) () from /usr/lib/libjsoncpp.so.0
#5 0x000000000042484f in API::getGameDetails (this=0x6803f0, game_name=..., type=@0x7fffffffd9f8: 1, lang=@0x7fffffffd9fc: 1) at src/api.cpp:357
#6 0x000000000042a870 in Downloader::getGameDetails (this=0x7fffffffd970) at src/downloader.cpp:218
#7 0x000000000042a716 in Downloader::getGameList (this=0x7fffffffd970) at src/downloader.cpp:204
#8 0x0000000000429ead in Downloader::init (this=0x7fffffffd970) at src/downloader.cpp:81
#9 0x00000000004131d1 in main (argc=12, argv=0x7fffffffe028) at main.cpp:190

Moving previous ~/.gogdownloader aside didn't help, so I assume this is something unexpected in this game's description?
Edit: interestingly, 2.6 crashes too, so I guess it's a change in server's reply, not a regression
Post edited August 08, 2013 by petchema
avatar
petchema: Hi,
Got a crash with 2.7, end of debug version output:
...
Moving previous ~/.gogdownloader aside didn't help, so I assume this is something unexpected in this game's description?
Edit: interestingly, 2.6 crashes too, so I guess it's a change in server's reply, not a regression
It seems GOG changed the JSON for patches in API. I'll fix this on the weekend when I get back home.
avatar
petchema: ...
This should be fixed in git
I'll bump the version number to 2.8 if there aren't any problems with it

I also fixed a bug that caused some patches to be ignored
It will still miss some patches because GOG doesn't always start the file numbers from 0.
Detecting available patches needs a different solution. I could try to do a regex match (Boost::Regex) but I'd rather keep the dependencies for the API implementation as low as possible (if someone actually uses the API implementation in their own projects)

Apparently extras aren't returned by the API
Could be a bug in the API or they were disabled for some reason. Reported this in the GOG Downloader thread and waiting for a reply
https://secure.gog.com/forum/general/introducing_the_beta_release_of_the_new_gogcom_downloader/post2000
Post edited August 09, 2013 by Sude
Sude: Oh, thanks for pointing to the existence of https://secure.gog.com/forum/ ! I found it annoying that there was no clear https option visible from the main site. Even https://secure.gog.com works! (Though you need to set up HTTPS everywhere redirects to fix links to the unsecure parts).
Post edited August 09, 2013 by shmerl
I added support for downloading language packs in git version
Also improved patch detection by brute forcing the patch ids (limited to 64 ids per language)
Language pack ids are also detected with brute force (limited to 16 ids per language)
Brute forcing may not be the most elegant solution but it works
Just reporting that lgogdownloader doesn't crash anymore, and indeed found and downloaded patches that it probably didn't "see" before...
LGOGDownloader 2.8
- Fixed crash caused by a change in API response for patches
- Better patch detection
- Added support for listing/downloading language packs
* use --no-language-packs to disable listing/downloading language packs

http://sites.google.com/site/gogdownloader/lgogdownloader-2.8.tar.gz

sha256: 2f33724ffe78651fe9e03792896a4b6dd52a109968361904a899963d3055a1a4
md5: 42cf171e99f87017ac01d43bf402b386

Extras are not listed/downloaded at the moment. After the recent changes the API does not return necessary details. Either it's a bug in the API or GOG deliberately removed it. I reported this problem here.
Post edited August 11, 2013 by Sude
I wonder if GOG has ever secretly implemented API changes to thwart LGOGDownloader and similar programs. With they attitude to Linux, I wouldn't put it past them.
avatar
Kristian: I wonder if GOG has ever secretly implemented API changes to thwart LGOGDownloader and similar programs. With they attitude to Linux, I wouldn't put it past them.
If they wanted to thwart unofficial downloaders or API usage they could simply revoke the current OAuth keys, encrypt the new keys and obfuscate the code of official downloader so it would be much harder to get the keys. Also they could simply ask me to stop using the API.
Hi,

I get this error when compiling:

[code]
#make
test -d bin/Debug || mkdir -p bin/Debug
test -d obj/Debug || mkdir -p obj/Debug
test -d obj/Debug/src || mkdir -p obj/Debug/src
g++ -std=c++0x -Wall -fexceptions -g -DDEBUG -DVERSION_STRING="\"LGOGDownloader 2.8\"" -Iinclude -c main.cpp -o obj/Debug/main.o
In file included from include/downloader.h:11:0,
from main.cpp:7:
include/api.h:107:42: sorry, unimplemented: non-static data member initializers
include/api.h:107:42: error: in-class initialization of static data member 'CONSUMER_KEY' of non-literal type
include/api.h:108:45: sorry, unimplemented: non-static data member initializers
include/api.h:108:45: error: in-class initialization of static data member 'CONSUMER_SECRET' of non-literal type
include/api.h:109:43: sorry, unimplemented: non-static data member initializers
include/api.h:110:40: sorry, unimplemented: non-static data member initializers
include/api.h:111:41: sorry, unimplemented: non-static data member initializers
make: *** [obj/Debug/main.o] Error 1
[/code] - oh btw. it would be cool if this forum would support more tags. Would make threads more readable. Hope some mod is reading this ...

This is the 2.8 release tarball. And I'm on Gentoo. Some of the libraries might not be the same vesrion as on *buntu. Any idea what is wrong?

Cheers!
avatar
Wild_Penquin: include/api.h:107:42: sorry, unimplemented: non-static data member initializers
include/api.h:107:42: error: in-class initialization of static data member 'CONSUMER_KEY' of non-literal type
include/api.h:108:45: sorry, unimplemented: non-static data member initializers
include/api.h:108:45: error: in-class initialization of static data member 'CONSUMER_SECRET' of non-literal type
include/api.h:109:43: sorry, unimplemented: non-static data member initializers
include/api.h:110:40: sorry, unimplemented: non-static data member initializers
include/api.h:111:41: sorry, unimplemented: non-static data member initializers
make: *** [obj/Debug/main.o] Error 1
It seems that the compiler doesn't support initializing the variables inside the class definition in header file. What version of gcc/g++ are you using?

This should fix the issue
http://pastie.org/pastes/8227193/text

edit: that patch is kind of an ugly way of doing things. I probably should implement a better fix for this in git at some point.

edit2: here's a better patch
http://pastie.org/pastes/8227248/text
Post edited August 11, 2013 by Sude
I think gcc supports in-class non static member initializers only starting from version 4.7. So you can just try building it with newer compilers. It's part of the C++11 standard, and gcc 4.6 is not fully compliant. 4.7 should probably be available in Gentoo.

Non static in-class member initializers are cleaner definition, and should be preferred I think:
http://www.stroustrup.com/C++11FAQ.html#member-init
Post edited August 11, 2013 by shmerl
Hi,

Yes, indeed gcc-4.6 is the version in use. That is also the latest stable one in Gentoo (4.7 is still keyworded ~amd64). Also, compiling gcc is a huge one, and also I'm not quite sure how to choose a different gcc version for different ebuilds, and don't want to switch the whole systems compiler just because of lgogdownloader. So I will use the patch for now since it works ;-). Thanks!

Also, you may want to know that jsoncpp header files are installed in a different directory (at least the ebuild I'm using) - there's no jsoncpp directory. So I need to change "#include <jsoncpp/json/json.h>" to "#include <json/json.h>" in downloader.cpp and api.cpp.

Cheers!