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

×
Works perfectly. Thanks a lot!
the function for downloading the dvd covers is almost ready, but will need a bit of test. I think it will have some problems with the punctuatin of some game titles...
Post edited January 22, 2011 by WrathOfTheAngels
A friend of mine, Xenon1170, is hosting the script file on his web site. Now you don't need to do cut and paste anymore :)
I think it would be better to save the cookies to user's home directory instead of current working directory
Users tend to run scripts from different directories so they'll end up having multiple copies of cookie file in different directories

PATH_TO_COOKIE=~/.GOGDownloader/cookies.txt

edit: also you can read the password without showing the input by using this
stty -echo
read -p "Password: " PASSWORD; echo
stty echo

edit2: this should also work
read -s -p "Password: " PASSWORD
Post edited January 23, 2011 by Sude
avatar
Sude: I think it would be better to save the cookies to user's home directory instead of current working directory
Users tend to run scripts from different directories so they'll end up having multiple copies of cookie file in different directories

PATH_TO_COOKIE=~/.GOGDownloader/cookies.txt

edit: also you can read the password without showing the input by using this
stty -echo
read -p "Password: " PASSWORD; echo
stty echo

edit2: this should also work
read -s -p "Password: " PASSWORD
Thank you a lot :) I tryed to find a way for quieting "read", but I didn't read well the man page. I'll apply this modifications as soon as possible. In this days I'm having problems at work, because of the snow, so I don't have time for working on the script...
Thanks to MinGW/MSYS and GnuWin projects I present to you a modified GOGDownloader script which supports Windows

http://www.mediafire.com/?cv0czkqw56ss0cm

Changes to original script
- Save cookies to user's home directory ~/.GOGDownloader
- Don't echo password
- Use aria2 for downloading if installed (split file to 4 parts and use 4 connections to download)
- Windows support with MSYS

Requirements for Windows
MSYS: http://www.mingw.org/
wget binary: http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-bin.zip
wget dependencies: http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-dep.zip
CA certificates for wget (automatically downloaded from CURL project when running the script for the first time)

Optionaly you can use aria2 for downloading
aria2: http://aria2.sourceforge.net/

from wget binary extract
- wget.exe
- etc
somewhere in your PATH or add the directory to PATH

from wget dependencies extract
- libeay32.dll
- libiconv2.dll
- libintl3.dll
- libssl32.dll
to the same directory with wget.exe

I don't currently have access to Linux computer so I don't know if the script still works on Linux.
It would be great if someone could confirm if it works.

edit: there were couple of small errors in the script which prevented it from working on Linux but those are now fixed
Attachments:
gog_msys.png (15 Kb)
Post edited January 30, 2011 by Sude
I use the Opera browser to download GOG games via browser - without any downloader. I also have a slow connection and sometimes breakups. No problem for opera: I can even reboot my computer and Opera continues downloading the last download (just select the broken download and click "continue"). The built in downloader of Opera is pretty good and I use it now for many years (where we had much slower internet connections). Try it! Opera is available for several OSes like WIndows and Linux.
Well, I have updated the script.
These the changes
- Save cookies to user's home directory ~/.GOGDownloader (thanks to Sade)
- Don't echo password (thanks to Sade)
- DVD covers download, after downloading setup files and additional content
- Download with aria2, if it is installed, because aria2c seems more reliable than wget for big files (thanks to Sade)
- Some little changes here and there...

Waiting for you and your requests :)
Post edited January 30, 2011 by WrathOfTheAngels
echo $LINE | grep -v '.*\[.*\].*' | awk -F'-' '{print $2}' | grep '.*<a.*' | awk -F'>' '{print $2}' | awk -F'<' '{print $1}' | sed "s/'//g" | sed 's/://g' | sed 's/;//g' | sed 's/ /_/g'
haven't tested yet but I think those multiple sed commands can be replaced with single sed
sed -e "s/'//g" -e "s/://g" -e "s/;//g" -e "s/ /_/g"
NAME=`echo "$SPIDER_RESULT" | grep '.*: http://.*\?.*' | tail -n 1 | rev | cut -f1 -d/ | rev | cut -f1 -d'?'`
can be simplified with sed
NAME=`echo "$SPIDER_RESULT" | grep '.*: http://.*\?.*' | tail -n 1 | sed -e "s/.*\/\(.*\)?.*/\1/"`
download_cover function seems to be hard coded to use png file extension so when it downloads jpg some image viewers might have problems viewing the image (for example Eye of GNOME)
this is easily fixed by taking the file extension from the link used for downloading it
we can use bash substring removal for this
${var##Pattern} Remove from $var the longest part of $Pattern that matches the front end of $var.

change line 174 to
wget -c -O "$PATH_WHERE_SAVE/$1/cover_$ID.${LINE##*.}" "$LINE" && echo -e "$GREEN""Cover downloaded in $PATH_WHERE_SAVE/$1/""$Z"
Post edited February 01, 2011 by Sude
Thank you :) I'm learning a lot :)
I'll add another little change

wget -c -O "$PATH_WHERE_SAVE/$1/$1_cover_$ID.${LINE##*.}" "$LINE" && echo -e "$GREEN""Cover downloaded in $PATH_WHERE_SAVE/$1/""$Z"

I'll soon update the script with this new lines... I have also found some little bugs that I fixed (sorry :( )
Play games and only play games with Windows. For working, internet browsing, music listening, video watching, and just about everything else, I use Linux, so thanks much for the Linux downloader! :-)
Post edited February 01, 2011 by tarangwydion
Doesn't really matter as all the jpg links are on the same line but still I think it would be good idea to change the grep statements in download_cover from
grep '.*png.*'
to accept jpg
grep '.*\(png\|jpg\).*'
if for some reason all the jpg links won't be on the same line
I'll apply the fixes posted by Sude and then put on the site the new script. then I'll stop working on it (momentary) for starting to work on a crossplatform downloader written in Java.
Sude, are you also an expert in java programming?
upped the last version of the script...