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

×
0.15
- Added repair mode

https://sites.google.com/site/gogdownloader/gogdownloader-0.15.tar.gz


sude@MintDebian ~ $ gogdownloader -r http://www.gog.com/en/download/game/beneath_a_steel_sky/0
Getting XML data... OK
MD5: 4fd340f1e4a2f973a163addeec866639
Chunks: 8
Size: 75176395 bytes
Verifying chunks
Chunk 0: Failed - downloading chunk
100% [========================================] 10.00/10.00MB 4764.55kB/s
Chunk 0: OK
Chunk 1: OK
Chunk 2: Failed - downloading chunk
100% [========================================] 10.00/10.00MB 6204.80kB/s
Chunk 2: OK
Chunk 3: OK
Chunk 4: OK
Chunk 5: OK
Chunk 6: OK
Chunk 7: OK
0.16
- Use getopt for command line interface
- Merged repairFile() with getFile()

https://sites.google.com/site/gogdownloader/gogdownloader-0.16.tar.gz

gogdownloader [options] URL
-h, --help Show help
-s, --show Show URLs
-b, --batch Batch download, use -f to filter
-f, --filter <string> Show/download URLs containing <string> [""]
-l, --login Login
-d, --directory <string> Download directory [""]
(with trailing slash; directory must exist)
-c, --cookie <string> Path to cookies ["~/.gogdownloader/cookies.txt"]
-v, --verify Calculate md5 for downloaded files
-r, --repair Repair files by downloading corrupted chunks again
--verbose Print lots of information. Useful for debugging
0.17
- Added "--xml" to read XML data from file or create XML data for file
- Added "--xml-dir" to set path for local XML storage (default: ~/.gogdownloader/xml/)
- Try reading XML data from user specified XML file, then try remote file and finally try local file from xml-dir
- Added "--no-remote-xml" to skip trying to get XML data from GOG
- Added "--chunk-size" to use custom size for chunks when creating XML

Creating your own XML data with smaller chunk size might be useful if you want to minimize the amount of data needed to download in case your files become corrupted

https://sites.google.com/site/gogdownloader/gogdownloader-0.17.tar.gz
0.18
- Rewrite some parts of code (mainly curl stuff)
- Login function now checks if login was successful

Hopefully the rewrite didn't introduce any bugs. I didn't encounter bugs in my tests but if you find any report them here.

https://sites.google.com/site/gogdownloader/gogdownloader-0.18.tar.gz
avatar
Sude: 0.18
I just tried it with
./gogdownloader -s https://www.gog.com/en/download/game/commandos_ammo_pack/0

and I got an error:

Filename:
Getting XML data
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::insert
Trying remote file...Aborted

[edit for further info]

I tried then with --no-remote-xml and it reaches the CDN but then seg faults:

> GET /0011DF/secure/commandos_ammo_pack/setup_commandos_ammo_pack.exe?1223fb43868c5f174d699ac8593ffcf6aac26b7022fc5 196f192669a33d09fbbddd363ad2e7db811a15d75ec8d99e86ff8644f7a0f9d64b3b897ef362e41946df9b490eb39428e715fe871c2f52 3f55a650bb2597450730071b0fed34a10bf5a9a7b3d58285925bf55ac3a510efa4fc8&fileExtForIe=.exe HTTP/1.1
User-Agent: GOGDownloader/0.18 libcurl-agent
Host: wpc.11DF.edgecastcdn.net
Accept: */*

< HTTP/1.1 200 OK ] 0.00/0.00MB @ 0.00kB/s
< Accept-Ranges: bytes
< Cache-Control: max-age=604800
< Content-Type: application/octet-stream
< Date: Fri, 02 Sep 2011 21:02:16 GMT
< ETag: "1550332266"
< Expires: Fri, 09 Sep 2011 21:02:16 GMT
< Last-Modified: Tue, 06 Oct 2009 08:07:16 GMT
< Server: ECAcc (ams/48BF)
< X-Cache: HIT
< Content-Length: 648196751
<
Segmentation fault

[UPDATE]
After some debugging I found out that if gogdownloader is used with the URL using HTTPS (instead of HTTP), which is what we get with a copy link from GOG, there is an extra redirect (from https to http) and as a consequence the filename will be empty which will lead to the errors above.

So, using url with http, gogdownlader works fine.

BTW, before I realised there was a redirect from https to http, I tried to setopt curl to accept exactly one redirect. However, the getinfo would then return a NULL pointer with the redirect location. Any idea why this happens?
Post edited September 02, 2011 by fmartins
avatar
fmartins: After some debugging I found out that if gogdownloader is used with the URL using HTTPS (instead of HTTP), which is what we get with a copy link from GOG, there is an extra redirect (from https to http) and as a consequence the filename will be empty which will lead to the errors above.

So, using url with http, gogdownlader works fine.
Thanks for reporting that. It's fixed now :)

0.19
- Change progressbar in createXML to use the same progressbar as progress_callback
- Fixed bug where specifying cookie location created/updated 2 cookie files
- Fixed bug when using https urls to download single file

https://sites.google.com/site/gogdownloader/gogdownloader-0.19.tar.gz
Post edited September 03, 2011 by Sude
Hi, I get this error when I try to download a file:

$ gogdownloader --verbose http://www.gog.com/en/download/file/the_witcher_2/1077
...
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
Aborted
Post edited September 14, 2011 by Dihldrek
avatar
Dihldrek: Hi, I get this error when I try to download a file:

$ gogdownloader --verbose http://www.gog.com/en/download/file/the_witcher_2/1077
...
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
Aborted
That's weird, it's working fine for me
Maybe something weird happens with the redirect location curl is getting

Let's see what it is getting
Add this to getInfo function just before the while loop at line 200 and as the last line in that while loop
cout << location << endl;
Post edited September 14, 2011 by Sude
Here is the full output. There is a 404 error. Other links give the same result.

$ gogdownloader --verbose http://www.gog.com/en/download/file/the_witcher_2/1077
* About to connect() to www.gog.com port 80 (#0)
* Trying 70.38.122.100... * connected
* Connected to www.gog.com (70.38.122.100) port 80 (#0)
> GET /en/download/file/the_witcher_2/1077 HTTP/1.1
User-Agent: GOGDownloader/0.19 libcurl-agent
Host: www.gog.com
Accept: */*

< HTTP/1.1 404 Not Found
< Server: nginx/0.7.67
< Date: Thu, 15 Sep 2011 21:42:47 GMT
< Content-Type: text/html;charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
* Added cookie GOGcom="34ltpc4qbh5v0apvrj5q2r1lj5" for domain www.gog.com, path /, expire 1316727967
< Set-Cookie: GOGcom=34ltpc4qbh5v0apvrj5q2r1lj5; expires=Thu, 22-Sep-2011 21:46:07 GMT; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
* Added cookie GOGcom="34ltpc4qbh5v0apvrj5q2r1lj5" for domain gog.com, path /, expire 1333402967
< Set-Cookie: GOGcom=34ltpc4qbh5v0apvrj5q2r1lj5; expires=Mon, 02-Apr-2012 21:42:47 GMT; path=/; domain=.gog.com
* Added cookie cu="deleted" for domain gog.com, path /, expire 1284586966
< Set-Cookie: cu=deleted; expires=Wed, 15-Sep-2010 21:42:46 GMT; path=/; domain=.gog.com
< charset: utf-8
< Vary: Accept-Encoding
<
* Connection #0 to host www.gog.com left intact
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
Aborted
I don't know if it's relevant, but there is a warning during compilation:

$ make
rm -f *~ gogdownloader
g++ -Wall -O2 -pipe -lhtmlcxx -lcurl -ltinyxml -lcrypto++ -o gogdownloader gogdownloader.cpp
gogdownloader.cpp: In function ‘void getFile(curlhandle*, SettingsStruct)’:
gogdownloader.cpp:417:43: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result
mkdir -p "/home/xxx/.gogdownloader/xml"
avatar
Dihldrek: Here is the full output. There is a 404 error. Other links give the same result.
It looks like it doesn't send the cookies to server
I can replicate the error by deleting ~/.gogdownloader/cookies.txt
I should probably add some kind of check for this error
Check that you have a valid cookies.txt located at ~/.gogdownloader/
it should look something like this
If not then create new cookie file by running "gogdownloader --login"

avatar
Dihldrek: I don't know if it's relevant, but there is a warning during compilation:
$ make
rm -f *~ gogdownloader
g++ -Wall -O2 -pipe -lhtmlcxx -lcurl -ltinyxml -lcrypto++ -o gogdownloader gogdownloader.cpp
gogdownloader.cpp: In function ‘void getFile(curlhandle*, SettingsStruct)’:
gogdownloader.cpp:417:43: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result
mkdir -p "/home/xxx/.gogdownloader/xml"
Shouldn't be related to this problem but that warning is easily silenced so I'll probably fix that in the next version
avatar
Sude: It looks like it doesn't send the cookies to server
I can replicate the error by deleting ~/.gogdownloader/cookies.txt
I should probably add some kind of check for this error
Check that you have a valid cookies.txt located at ~/.gogdownloader/
it should look something like this
If not then create new cookie file by running "gogdownloader --login"
Regenerating cookies.txt did the trick. It's working now, thank you.
0.20
- Check that cookie file exists
- Silence a warning about freopen
- Changed libcrypto++ to librhash which is much smaller library
- Some small code changes to make it easier use other hash algorithms if needed in the future

https://sites.google.com/site/gogdownloader/gogdownloader-0.20.tar.gz

the biggest change is using librhash instead of libcrypto++ so make sure you have librhash-dev installed before trying to compile
Hi,

I can not find any package tinyxml for OS X. I tried to build tinyxml from source, but it does not create a package. So I added the files to the gogdownloader directory, no luck.

Could anybody, please, compile this for OS X 10.6 Intel 32-bit (!). Thanks.
Post edited December 03, 2011 by amix
avatar
amix: Hi,

I can not find any package tinyxml for OS X. I tried to build tinyxml from source, but it does not create a package. So I added the files to the gogdownloader directory, no luck.

Could anybody, please, compile this for OS X 10.6 Intel 32-bit (!). Thanks.
try if this works
cd to gogdownloader-0.20 directory
wget http://sourceforge.net/projects/tinyxml/files/tinyxml/2.6.2/tinyxml_2_6_2.tar.gz
tar -xvzf tinyxml_2_6_2.tar.gz
cd tinyxml
wget https://sites.google.com/site/gogdownloader/tinyxml_static_lib.diff
patch -p0 < tinyxml_static_lib.diff
make
cd ..
wget https://sites.google.com/site/gogdownloader/gogdownloader_static_libtinyxml.diff
patch -p0 < gogdownloader_static_libtinyxml.diff
make
Thanks, that was very kind of you. However, the build broke, since it could not find rhash. I then downloaded rhash, which broke on built because of lacking libintl.h. I have libintl.h, however, it is part of the Homebrew install, and I need to investigate, how to add it to the include search path. I will report back tomorrow, since I am very tired now. Thaks a lot!

coca:gogdownloader-0.20 amix$ make
rm -f *~ gogdownloader
g++ -Wall -O2 -pipe -I/usr/local/Cellar/htmlcxx/0.84/include -L/usr/local/Cellar/htmlcxx/0.84/lib -lhtmlcxx -lcurl -lrhash -DTIXML_USE_STL -o gogdownloader gogdownloader.cpp tinyxml/libtinyxml.a
In file included from gogdownloader.cpp:14:
gogdownloader.h:27:25: error: rhash/rhash.h: No such file or directory