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

×
avatar
murasame: Many thanks for taking the time to answer me and for your explanations.

lgogdownloader --platform windows --language fr --download --game ^kholat$ actually works as well as lgogdownloader --platform windows --language fr --download --game kholat
avatar
ssokolow: Yes, but it expects a regular expression, so if you use "kholat" without the ^ (beginning of string) and $ (end of string) metacharacters, you're doing a substring match.

(eg. If you own two or three games in the Age of Wonders series and ask for "age_of_wonders", don't be surprised when it downloads more than one game)
Actually, I do and I only use th exact match e.g.: black_mirror_ii / black_mirror_3 / the_black_mirror and it works fine.

Are saying if I use a string like "black_mirror" the dowloader would download the whole series ? Even if I do not use a joker as in black_mirror* ?

Oh,and there's another one now : I can't download Grandia 2.

lgogdownloader --download --game ^grandia_ii_anniversary_edition$

Lists the game but then does nothing.

lgogdownloader --download-file gogdownloader://grandia_ii_anniversary_edition/installer_win_en

Gives me :

HTTP ERROR: 404 (https://api.gog.com/downloader2/installer/grandia_ii_anniversary_edition/installer_win_en/?oauth_consumer_key=[...]*
Found nothing in https://api.gog.com/downloader2/installer/grandia_ii_anniversary_edition/installer_win_en/

*I obviously haven't pasted here my authorisation key... :-)

I'm also a bit confused as for what the fileid is.

In the example provided page 1 we have :

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

Where to get the fileid ?
Post edited November 02, 2015 by murasame
avatar
murasame: Actually, I do and I only use th exact match e.g.: black_mirror_ii / black_mirror_3 / the_black_mirror and it works fine.
But you don't want to make a habit of it. Sooner or later, you'll write something that matches more than you intended.

My advice is to add this shell function to your .bashrc so you can just type "gogd game_name_1 game_name_2 game_name_3"

gogd () {
local IFS=\|
lgogdownloader --download --game "^($*)\$"
}

avatar
murasame: Are saying if I use a string like "black_mirror" the dowloader would download the whole series ? Even if I do not use a joker as in black_mirror* ?
Yes, it would download the whole series.

However, you're misunderstanding the meaning of * in this context.

The * is only a wildcard in shell glob syntax. In regular expressions, it means "any number (including zero) of the previous character" so you'd be doing a substring match for "black_mirro" followed by zero or more "r"s.

The regular expression equivalent to the "black_mirror*" glob is "^black_mirror.*$" (The period means "any character" and the asterisk after it means "zero or more of them")

avatar
murasame: Oh,and there's another one now : I can't download Grandia 2.

lgogdownloader --download --game ^grandia_ii_anniversary_edition$

Lists the game but then does nothing.
Usually that's a bug in either LGOGDownloader or GOG. Make sure it's come to Sude's attention and, if it's something that can either be fixed or worked around in LGOGDownloader, it shouldn't take too long.

avatar
murasame: I'm also a bit confused as for what the fileid is.

In the example provided page 1 we have :

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

Where to get the fileid ?
It's the installer_win_en in this URL:
gogdownloader://grandia_ii_anniversary_edition/installer_win_en

If just removing the gogdownloader:// part from the command you tried isn't enough, then it's also some kind of bug in either your version of LGOGDownloader or GOG itself. (Given that the --download --game approach did nothing, I'm suspecting a GOG bug that LGOGDownloader will need to work around.)
Post edited November 02, 2015 by ssokolow
avatar
murasame: Actually, I do and I only use th exact match e.g.: black_mirror_ii / black_mirror_3 / the_black_mirror and it works fine.
avatar
ssokolow: But you don't want to make a habit of it. Sooner or later, you'll write something that matches more than you intended.

My advice is to add this shell function to your .bashrc so you can just type "gogd game_name_1 game_name_2 game_name_3"

gogd () {
local IFS=\|
lgogdownloader --download --game "^($*)\$"
}
I very rarely use this bash feature and I realise how I should use it more instead of bash scripts in my /usr/loca/bin folder... Thanks !

avatar
murasame: I'm also a bit confused as for what the fileid is.

In the example provided page 1 we have :

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

Where to get the fileid ?
avatar
ssokolow: It's the installer_win_en in this URL:
gogdownloader://grandia_ii_anniversary_edition/installer_win_en

If just removing the gogdownloader:// part from the command you tried isn't enough, then it's also some kind of bug in either your version of LGOGDownloader or GOG itself. (Given that the --download --game approach did nothing, I'm suspecting a GOG bug that LGOGDownloader will need to work around.)
Not so sure about this one. In the example by Sude, we have :

lgogdownloader --download-file the_witcher/en1installer0

which works fine but the link provided by GOG for the same game is gogdownloader://the_witcher/installer_win_en

which doesn't work when you try: lgogdownloader --download-file the_witcher/installer_win_en

you get a 404 error (Found nothing in https://api.gog.com/downloader2/installer/the_witcher/installer_win_en/)

That's the reason why I said I'm a bit confused about where/how to get the fileid...

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

EDIT : Got it ! Files ID are to be found with the --list-details option:

In the case of Grandia II Anniversary edition that would be : lgogdownloader --list-details --game grandia_ii_anniversary_edition

which gives :

title: Grandia II Anniversary Edition
icon: http://static.gog.com/upload/images/2015/08/1e26f3e3d6d3375b41c01454cc64c4a5acc106a4.jpg
installers:

So, apparently, there's a reason why I can't download it using lgogdownloader : no installer available ? Or lgogdownloader not able to locate correctly the installer for this game ?
Post edited November 02, 2015 by murasame
avatar
murasame: Not so sure about this one. In the example by Sude, we have :

lgogdownloader --download-file the_witcher/en1installer0

which works fine but the link provided by GOG for the same game is gogdownloader://the_witcher/installer_win_en

which doesn't work when you try: lgogdownloader --download-file the_witcher/installer_win_en

you get a 404 error (Found nothing in https://api.gog.com/downloader2/installer/the_witcher/installer_win_en/)

That's the reason why I said I'm a bit confused about where/how to get the fileid...

PS: I use the latest 2.26 version on my ubuntu 15.04.
Point. I replied while I was tired and hadn't noticed that mismatch.

I remember a release note talking about --download-file gaining support for gogdownloader:// URLs so, if it doesn't support installer_win_en in URL form, then I'd say it's an "LGOGDownloader doesn't match official GOG Downloader" bug.

avatar
murasame: EDIT : Got it ! Files ID are to be found with the --list-details option:

In the case of Grandia II Anniversary edition that would be : lgogdownloader --list-details --game grandia_ii_anniversary_edition

which gives :

title: Grandia II Anniversary Edition
icon: http://static.gog.com/upload/images/2015/08/1e26f3e3d6d3375b41c01454cc64c4a5acc106a4.jpg
installers:

So, apparently, there's a reason why I can't download it using lgogdownloader : no installer available ? Or lgogdownloader not able to locate correctly the installer for this game ?
As I understand it, the GOG Downloader API has no call for getting a product list so LGOGDownloader has to parse your shelf page. It could be a GOG bug or it could be LGOGDownloader failing to parse the data on that particular game for some reason.
avatar
murasame: Not so sure about this one. In the example by Sude, we have :

lgogdownloader --download-file the_witcher/en1installer0

which works fine but the link provided by GOG for the same game is gogdownloader://the_witcher/installer_win_en

which doesn't work when you try: lgogdownloader --download-file the_witcher/installer_win_en

you get a 404 error (Found nothing in https://api.gog.com/downloader2/installer/the_witcher/installer_win_en/)

That's the reason why I said I'm a bit confused about where/how to get the fileid...

PS: I use the latest 2.26 version on my ubuntu 15.04.
avatar
ssokolow: Point. I replied while I was tired and hadn't noticed that mismatch.

I remember a release note talking about --download-file gaining support for gogdownloader:// URLs so, if it doesn't support installer_win_en in URL form, then I'd say it's an "LGOGDownloader doesn't match official GOG Downloader" bug.

avatar
murasame: EDIT : Got it ! Files ID are to be found with the --list-details option:

In the case of Grandia II Anniversary edition that would be : lgogdownloader --list-details --game grandia_ii_anniversary_edition

which gives :

title: Grandia II Anniversary Edition
icon: http://static.gog.com/upload/images/2015/08/1e26f3e3d6d3375b41c01454cc64c4a5acc106a4.jpg
installers:

So, apparently, there's a reason why I can't download it using lgogdownloader : no installer available ? Or lgogdownloader not able to locate correctly the installer for this game ?
avatar
ssokolow: As I understand it, the GOG Downloader API has no call for getting a product list so LGOGDownloader has to parse your shelf page. It could be a GOG bug or it could be LGOGDownloader failing to parse the data on that particular game for some reason.
I reported both issues on github. We'll see. Thank you again for help.
Hi guys,
I have a short question: I'd like to get lgogdownloader to run on my synology nas to have it periodically download all my new purchases and me having a full backup of all my games for any eventualities without having to work for it alot ;)

The thing is my synology nas is pretty closed up, I can ssh to it, but there's almost only prebuilt packages for it and no compile environment included. So to get it to run there I would have install a toolchain on my laptop (arch linux) for making a statically linked binary version of lgogdownloader for the exact processor architecture of the nas: Intel Atom C2538

So if anyone did anything similar some pointers would be nice (and to hear that it can be done.) seems like a waste to leave a computer running to run the downloader that just puts everything on the nas...
quick update:

Building Packages for your synology nas is pretty well documented: http://global.download.synology.com/download/Document/DeveloperGuide/DSM_Developer_Guide.pdf

All the toolchains you need are available from synology here: http://sourceforge.net/projects/dsgpl/files/

when I have time I'll try to get lgogdownloader compiled for my nas (ds1815+) which uses the "avoton" toolchain

but I guess I don't have the time / knowledge to build real packages for the different types of synology nas. If more people are interested in that maybe someone would be willing to provide those... but well maybe I'm the only one using these kinds of nas, so I'll be on my own...

Anyway I'll keep you guys updated, whether you want to or not ;)
Post edited November 08, 2015 by mchack
avatar
Sude: ping
ok first try failed horribly ;) and actually I'd love if any of you had a pointer at where I'm failing here (I'm no coder so maybe it's something little and obvious that I'm missing...)

So first I checked if lgogdownloader compiles for my system and it does and works flawlessly (arch linux)

Then I grabbed the correct toolchain for my nas here (just got the latest version with the latest gcc (473 but there's also gcc463 available if that should make a difference) and installed in /usr/local/

Then I tried to change the makefile to point to the right gcc for my nas like so: (guess there's the problem..)

...
CC = /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc
CXX = /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-g++
AR = /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ar
LD = /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-g++
WINDRES = windres

INC = -I/usr/local/x86_64-pc-linux-gnu/libc/include -I/usr/include/rhash -I/usr/include/jsoncpp
CFLAGS = -std=c++11 -Wall -fexceptions -D_FILE_OFFSET_BITS=64
RESINC =
LIBDIR = /usr/local/x86_64-pc-linux-gnu/libc/lib
...

And here's what a "make release" gives me then ;)

/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-g++ -std=c++11 -Wall -fexceptions -D_FILE_OFFSET_BITS=64 -O2 -DVERSION_STRING="\"LGOGDownloader 2.26\"" -I/usr/local/x86_64-pc-linux-gnu/libc/include -I/usr/include/rhash -I/usr/include/jsoncpp -c main.cpp -o obj/Release/main.o
x86_64-pc-linux-gnu-g++: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
Makefile:131: die Regel für Ziel „obj/Release/main.o“ scheiterte
make: *** [obj/Release/main.o] Abgebrochen (Speicherauszug erstellt)

So anyone know how it's done correctly?
Post edited November 09, 2015 by mchack
avatar
mchack: ...
loadlocale.c... this file is internal from glibc, not in any way related to lgogdl. This probably means that the toolchain is broken in some way (not compatible with your version of glibc - maybe different arch, or requires newer/older), or just plain bug in the toolchain. Can you try running just "/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-g++" -v, to see if crashes with the same error? And then repeat after export LC_ALL="C" (could skip locale stuff, in theory).

What system are you running on your notebook? Because if it is 64-bit, you may be able to simply copy lgogdownloader + all the libraries it uses into /usr/local/{bin,lib} on your NAS - you can find what libraries you need with ldd <filename>. If not, you could try to grab 64-bit packages for ubuntu with roughly same version of gcc. I would be much easier than what you are trying, crosscompiling stuff could take days even if you have rough idea what you are doing, and it doesn't make much sense trying to crosscompile from x86_64 to x86_64...

One more thing, if you want static build (good idea in this case, and could be more compatible than trying to copy lots of .so libraries), add -static to LDFLAGS_RELEASE, and hope you have static versions of needed libraries installed (my Gentoo box doesn't, I'd have to compile a lot of stuff with USE=static-libs).
Thanks for the answer :D

avatar
mchack: ...
avatar
huan: loadlocale.c... this file is internal from glibc, not in any way related to lgogdl. This probably means that the toolchain is broken in some way (not compatible with your version of glibc - maybe different arch, or requires newer/older), or just plain bug in the toolchain. Can you try running just "/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-g++" -v, to see if crashes with the same error? And then repeat after export LC_ALL="C" (could skip locale stuff, in theory).
ok:

"/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-g++" -v
x86_64-pc-linux-gnu-g++: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
Abgebrochen (Speicherabzug geschrieben)

ok you're right, same error here. with export LC_ALL="C":

Using built-in specs.
COLLECT_GCC=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-g++
COLLECT_LTO_WRAPPER=/usr/local/x86_64-pc-linux-gnu/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/yikai/Public/crosstool-ng-1.18.0/.build/src/gcc-linaro-4.7-2013.01/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=x86_64-pc-linux-gnu --prefix=/usr/local/x86_64-pc-linux-gnu --with-sysroot=/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root --enable-languages=c,c++ --with-pkgversion='crosstool-NG 1.18.0' --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --enable-libquadmath --enable-libquadmath-support --with-gmp=/home/yikai/Public/crosstool-ng-1.18.0/.build/x86_64-pc-linux-gnu/buildtools --with-mpfr=/home/yikai/Public/crosstool-ng-1.18.0/.build/x86_64-pc-linux-gnu/buildtools --with-mpc=/home/yikai/Public/crosstool-ng-1.18.0/.build/x86_64-pc-linux-gnu/buildtools --with-ppl=/home/yikai/Public/crosstool-ng-1.18.0/.build/x86_64-pc-linux-gnu/buildtools --with-cloog=/home/yikai/Public/crosstool-ng-1.18.0/.build/x86_64-pc-linux-gnu/buildtools --with-libelf=/home/yikai/Public/crosstool-ng-1.18.0/.build/x86_64-pc-linux-gnu/buildtools --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++ -lm -L/home/yikai/Public/crosstool-ng-1.18.0/.build/x86_64-pc-linux-gnu/buildtools/lib -lpwl' --enable-threads=posix --enable-target-optspace --disable-multilib --with-local-prefix=/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.7.3 20130102 (prerelease) (crosstool-NG 1.18.0)

it seems to work...
yet when I try to crosscompile now it just stops at another error (I still think the config in the makefile might not be correct):

/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-g++ -std=c++11 -Wall -fexceptions -D_FILE_OFFSET_BITS=64 -O2 -DVERSION_STRING="\"LGOGDownloader 2.26\"" -I/usr/local/x86_64-pc-linux-gnu/libc/include -I/usr/include/rhash -I/usr/include/jsoncpp -c main.cpp -o obj/Release/main.o
main.cpp:7:24: fatal error: downloader.h: No such file or directory
compilation terminated.
Makefile:131: recipe for target 'obj/Release/main.o' failed
make: *** [obj/Release/main.o] Error 1

avatar
huan: What system are you running on your notebook? Because if it is 64-bit, you may be able to simply copy lgogdownloader + all the libraries it uses into /usr/local/{bin,lib} on your NAS - you can find what libraries you need with ldd <filename>. If not, you could try to grab 64-bit packages for ubuntu with roughly same version of gcc. I would be much easier than what you are trying, crosscompiling stuff could take days even if you have rough idea what you are doing, and it doesn't make much sense trying to crosscompile from x86_64 to x86_64...
huh, never thought about that. Yes it's a 64bit arch and the processor is an intel i5 ... So you're saying the intel atom just has the same instruction set as the i5? that would be grand giving it a try...

oh ok ldd lgogdownloader gives about 22 libraries it depends on ... don't know if it's wise to put all of those onto the nas (I'd rather have them contained somewhere so they don't run the risk of somehow breaking the system on the NAS... guess I'll try that as a last resort. making sure they're all in /usr/local/

avatar
huan: One more thing, if you want static build (good idea in this case, and could be more compatible than trying to copy lots of .so libraries), add -static to LDFLAGS_RELEASE, and hope you have static versions of needed libraries installed (my Gentoo box doesn't, I'd have to compile a lot of stuff with USE=static-libs).
Yes that one :) I want that one...

this is the error it gives when trying with -static in LDFLAGS_RELEASE

/usr/bin/ld: cannot find -lcurl
/usr/bin/ld: cannot find -loauth
/usr/bin/ld: cannot find -ljsoncpp
/usr/bin/ld: cannot find -lhtmlcxx
/usr/bin/ld: cannot find -ltinyxml
/usr/bin/ld: cannot find -lrhash

guess that's the problem don't really know how to install all of those libraries as static ...
but a static build is the way to go I think because then it's easier to upgrade when a newer version of lgogdownloader needs newer libraries...

So do you think I'll need to compile those libraries myself as static? I just got them via pacman and haven't compiled any of it myself...
avatar
mchack: /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-g++ -std=c++11 -Wall -fexceptions -D_FILE_OFFSET_BITS=64 -O2 -DVERSION_STRING="\"LGOGDownloader 2.26\"" -I/usr/local/x86_64-pc-linux-gnu/libc/include -I/usr/include/rhash -I/usr/include/jsoncpp -c main.cpp -o obj/Release/main.o
main.cpp:7:24: fatal error: downloader.h: No such file or directory
You are missing -Iinclude. It's in the original makefile, it probably got lost when you modified it.

avatar
mchack: huh, never thought about that. Yes it's a 64bit arch and the processor is an intel i5 ... So you're saying the intel atom just has the same instruction set as the i5? that would be grand giving it a try...
They don't have the same instruction set, but unless you force it to, gcc uses only instructions present on all processors of given family. You are using x86_64 compiler, so by default resulting binary should work on any 64-bit x86 processor. -march=native or -mcpu=native flags is what would break it and make it run only on your laptop.

avatar
mchack: oh ok ldd lgogdownloader gives about 22 libraries it depends on ... don't know if it's wise to put all of those onto the nas (I'd rather have them contained somewhere so they don't run the risk of somehow breaking the system on the NAS... guess I'll try that as a last resort. making sure they're all in /usr/local/
Not all of them are missing on NAS. dl.so.1 and libstdc++.6 and few other should already be present. But you are right, it could create a mess. There is another way. Put then anywhere you like, and export LD_LIBRARY_PATH=/wherever/you/have/put/them before running.

avatar
mchack: this is the error it gives when trying with -static in LDFLAGS_RELEASE

/usr/bin/ld: cannot find -lcurl
/usr/bin/ld: cannot find -loauth
/usr/bin/ld: cannot find -ljsoncpp
/usr/bin/ld: cannot find -lhtmlcxx
/usr/bin/ld: cannot find -ltinyxml
/usr/bin/ld: cannot find -lrhash

guess that's the problem don't really know how to install all of those libraries as static ...
but a static build is the way to go I think because then it's easier to upgrade when a newer version of lgogdownloader needs newer libraries...

So do you think I'll need to compile those libraries myself as static? I just got them via pacman and haven't compiled any of it myself...
Looks about the same on my box, and I can't help you much with this, not an Arch user.

Side note here: if you were truly crosscompiling, you would HAVE to compile those yourself. Crosscompiling is hard mainly because you have to crosscompile every dependency, all the way down to libc. Some of the packages along the way may compile their own tools used during build, and those tools must run on the host, not the guest, so now the package must use two different compilers.

After you get through all that, you have to make the product you are trying to build to use the correct version. "-I/usr/include/rhash -I/usr/include/jsoncpp" are paths to your system-wide libraries during compile. Later you would run into the same problem with link path - to crosscompile, you would have to supply -L(path) with guest-specific libraries.

You can use that option to your advantage too. If you can't get pacman to install static libraries for you, you can get them from somewhere else, put them into temporary directory and point gcc there with -I in includes and -L in LDFLAGS_RELEASE (you are looking for libcurl.a, liboauth.a and so on...). Make sure you use includes from the same version as the libraries.
For some reason my "exclude"-settings in the config file aren't honored.
This works as intended:
lgogdownloader --download --include all --exclude covers, extras

But when I put these options into my config.cfg, they are ignored. Every other setting in the config file works as expected.

Edit: Ahh, no nevermind, I put a space between those arguments. As soon as I removed it, everything started to work as it should. :)
Post edited November 14, 2015 by InspMustache
I'm getting the following error after logging in (I'm using the latest git version):

API: Login successful
*** Error in `lgogdownloader': double free or corruption (fasttop): 0x00000000009ed230 ***
Aborted
Yes. i am also getting this double free or corruption error, does anyone have an idea on whats going on, and if and when we will see gog galaxy on linux?
avatar
itchanddino: I'm getting the following error after logging in (I'm using the latest git version):

API: Login successful
*** Error in `lgogdownloader': double free or corruption (fasttop): 0x00000000009ed230 ***
Aborted
avatar
The.Neotic.One: Yes. i am also getting this double free or corruption error, does anyone have an idea on whats going on, and if and when we will see gog galaxy on linux?
Does this fix the issue?
8780b9c Possible fix for crash after login