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

×
There was a login bug that caused problems when using --insecure because CURLOPT_SSL_VERIFYPEER wasn't being set before getting api config
It is now fixed in git version
Is it possible to include some scripting support, ie return different status codes and produce (via command-line) a more parse-friendly output?

I' d like to script an update check script that does the following, but currently it is nearly impossible to parse the output properly and react accordingly to status codes (the --repair option only returns 0, regardless of its actions and results).

It would be neat to have some sort of status command for some / all (controlled via --game) games with --status like:

$ lgogdownloader --game septerra_core --status

OK septerra_core_legacy_of_the_creator septerra_core_artworks.zip 6002632434 58 22839e19bc5c8db
NDL septerra_core_legacy_of_the_creator septerra_core_artworks.zip
MD5 septerra_core_legacy_of_the_creator septarra_core_avatars.zip 184672 1 23442342342342342

fields are separated by a single space

OK = file successfully downloaded, file is ok
NDL = file not downloaded
MD5 = MD5 mismatch, perhaps update

2nd field is game name, 3rd field filename, 4th field is file size (if applicable), 5th is number of chunks (if applicable) and the last field contains MD5 of the local file

This would help greatly in building an automatic update / notifier. Going all days through games and sifting through the forum thread is a great pain in the butt. My intent is not to download / repair the local files on the spot, only to check for differences from local and the official GOG files.

Other files contained in the directory of local repository should be ignored though and output should just display the official contents.
Post edited November 02, 2013 by coffeecup
avatar
coffeecup: It would be neat to have some sort of status command for some / all (controlled via --game) games with --status like:
Here's a patch for status check, it needs some testing before I commit it
https://sites.google.com/site/gogdownloader/status_check.diff

status codes:
OK = file exists (file is ok)
ND = file doesn't exist (file is not downloaded)
MD5 = MD5 mismatch (different version)

output format:
status_code gamename filename local_filesize local_filehash

this patch also changes Downloader::downloadFile so that it's possible to do version check without local xml data (it takes some time because it calculates md5 for the file)
The patch seems to work with the current github version, it does provide the output.

Only problem is that the scanning is very slow through about my 150 games, but that is expected due the checksumming.

My current script will be available soon (when it has run through my games some times) which outputs all game files which are not updated and is intended for further processing and / or cronjob output.
Added check script at https://github.com/shakeyourbunny/gog-check-games for your pleasure.

Note that you need the patched lgogdownloader and you MUST edit the variables DLDIR, LGOGDOWNLOADER to the correct directory and lgogdownloader binary locations.

Executing it without parameters it will only spill out changes, with --verbose it's more chatty. Note that if you have a library of of more than some dozen games and you start the script repeatedly, GOG.com will error 503 on you and block your requests until you change IP address.
Post edited November 10, 2013 by coffeecup
Just found out about this project, thanks for all the work, I'll be using it a lot !! :D
Git version now has --status command
I also made createXML output easier to read

Version check before download now works without local XML data. However it is much slower without the XML data because it calculates MD5 for the files

Some changes to config.h
- Removed "bHelp" from config because it was not needed
- Changed "bNoColor" to "bColor"
- Changed "bNoUnicode" to "bUnicode"

Cover xml data is now located at
https://sites.google.com/site/gogdownloader/covers.xml
I think I encountered a bug with --status and --language on the github. If you use both parameters, the --language flag is ignored.

See also https://github.com/Sude-/lgogdownloader/issues/3

Why does not this line also download only the english game version (git lgogdownloader), it should do English + German:
$ lgogdownloader --language 3 --platform 1 --no-unicode --directory /blah/fasel --game "a_new_beginning" --download
avatar
coffeecup: I think I encountered a bug with --status and --language on the github. If you use both parameters, the --language flag is ignored.

See also https://github.com/Sude-/lgogdownloader/issues/3

Why does not this line also download only the english game version (git lgogdownloader), it should do English + German:
$ lgogdownloader --language 3 --platform 1 --no-unicode --directory /blah/fasel --game "a_new_beginning" --download
https://github.com/Sude-/lgogdownloader/issues/3#issuecomment-28647086
https://secure.gog.com/forum/general/introducing_the_beta_release_of_the_new_gogcom_downloader/post1483
Hi,
Talking about --language, I think I spotted a new issue:
I used --language 5 on "A New Beginning" to download both english and french versions, but it seems the same filenames are being downloaded twice.
So, either it's the same binaries that provide both english and french support (and then why isn't that detected and downloaded only once?), or those are different binaries overwriting each other :(
(need to investigate further)

Regards,
Pierre.

(Edit: ok, it seems it's the same binaries being downloaded twice)
Post edited November 17, 2013 by petchema
avatar
petchema: ...
Here's an untested patch that adds detection for duplicate installers and skips them
https://sites.google.com/site/gogdownloader/duplicate_installer_detection.diff
edit: don't use this patch, it is now unnecessary due to changes in git version
Post edited November 18, 2013 by Sude
Git version now better handles the case when single installer is used for multiple languages

API change: added duplicate handler for installers
API::getGameDetails now has a parameter to enable duplicate handling (default: false)
The duplicate handler applies a language id flag on the original installer so it shows support for multiple languages

Downloader uses duplicate handler by default
Added --no-duplicate-handling option to disable duplicate handler
That was fast :)
Thanks!
LGOGDownloader 2.10
- Fixed two login bugs
- Merged includes fix from Roman Kamyk
- Added --status command to show status of files
* Output format: statuscode gamename filename filesize filehash
* Status codes: OK (File is OK), ND (File is not downloaded), MD5 (MD5 mismatch, different version)
- Version check before download now works without local XML data
- Changed all "negative" variables to "positive" in config.h
- API change: added duplicate handler for installers
* It applies a language id flag on the original installer so it shows support for multiple languages when single installer is used for multiple languages
- Added --no-duplicate-handling option to disable duplicate handler
- Games are now sorted by title when using "--game free"
- Changed url for cover xml data
* New url: https://sites.google.com/site/gogdownloader/covers.xml
* The cover XML data no longer has "title" attribute because it wasn't used for anything
- Simplified the output of update check
- Downloader::getGameDetails() is now called from functions that need it instead of using conditions in Downloader::getGameList()
- Downloader class has two new member functions:
* Downloader::getLocalFileHash - Gets MD5 for a file from local XML data, if local XML data doesn't exist it uses Util::getFileHash to calculate MD5 for the file
* Downloader::getRemoteFileHash - Gets MD5 for a file from remote XML data

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

sha256: f5cfe01eab577614d62234d07ed1e41bb68fbc8a4132ab130b811a0a2f1e3d66
md5: 645b8e12b5620077325899889e48bf7f
Many thanks for the updates though the git version (I'm using) already has some, but two big thumbs up!