Skip to content
/ gogdl Public

yet another unofficial downloader for games and extras from gog.com

Notifications You must be signed in to change notification settings

asb/gogdl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

gogdl - yet another downloader for GOG.com

Description

gogdl is an unofficial downloader for games (both the setup files and the 'extras') purchased from GOG.com. It is currently written in Lua, though acts as just a thin wrapper around wget which does all the heavy lifting. I wrote it mainly for my own use, though others may find it helpful if not already satisfied by one of the many alternatives (listed below). It also supports retrieval of the XML files which contain md5sums for each setup file, as used by the official GOG downloader.

Requirements

wget and Lua 5.1. md5sum (part of GNU coreutils) is needed for verifying the md5 checksum provided by GOG.

Usage

The following (output from gogdl help should tell you enough to get started):

Usage: gogdl ACTION [ARGS...]
Valid actions are:

help:
  Shows this help message
login:
  Prompts for username and password and retrieves a login cookie
getlist:
  Retrieves the list of available downloads from your gog account
list [--all | FILE_LIST]:
  With no arguments, gives a list of the game names available to download. 
  When given `--all` will list all available URL fragments (i.e. setup and 
  extra files). Can also be given arguments as taken by `gogdl download` to 
  act as a preview for what files would be downloaded. See below for a 
  description of FILE_LIST
download [-D] [FILE_LIST]:
  Dowloads the specified file(s). See below for a description of FILE_LIST. If 
  the `-D` option is given then all game files are downloaded to an 
  appropriately named subdirectory (which is created if necessary).
check [FILE_LIST]:
  Querys the GOG download servers for the size of the specified file(s) and 
  verifies that a local file with the correct filename exists, and that the 
  length matches. Prints a summary of those files which match and those which 
  do not.
checksum [--convert] [XML_FILES]:
  Given a list of files containing md5 data in the XML format GOG uses, 
  extract the checksum for each file and check it. Input XML files can be 
  obtained using `gogdl download @gamename-checksums`. It is assumed that the 
  file described by the XML input is in the same folder as that input. i.e. 
  `gogdl checksumm gamename/setup_gamename.exe.xml` will look for 
  `gamename/setup_gamename.exe` to verify its md5 sum. If `--convert` is 
  specified, then checksums for each file will be extracted from the .xml 
  files and output to stdout in a form that can be recognised by coreutils 
  md5sum.

The FILE_LIST can take the form of:
1) @gamename-all to download all files from a certain game, @gamename-setup 
   for just the setup files, @gamename-extras for just the extras, and 
   @gamename-checksums for just the .xml files containing checksums for each 
   setup file.
2) A full URL of the form http://www.gog.com/en/download/*
3) An abbreviated url of the form /en/download/*

You will need to run gogdl getlist before @gamename-* can be matched, and
of course you'll want to gogdl login before anything else. Example
first-time usage:

    gogdl login
    gogdl getlist
    gogdl download @the_longest_journey-all
    gogdl checksum setup_tlj.exe.xml

You can also set the environment variable WGET_OPTS to specify extra options to you appended to the wget invocation to download each file (e.g.
WGET_OPTS="--limit-rate=250k" gogdl download /en/download/game/the_longest_journey/0).

wget is fairly verbose by default so keeps you well informed on what is going on. The -c option is passed to wget for downloads so the default behaviour is to resume any download that is incomplete. However if the remote file was updated since the downloaded was first started this will result in a broken file, as is the case with the other unofficial downloaders.

Possible future functionality

When performing checksums based on the GOG xml files, it would be nice to have the option to use the md5s given for each individual chunk so that if the file does not match the location of the error can be better pinpointed. The code could be cleaned up some more.

Alternatives

These are the other GOG downloader implementations I know of:

Contact

If you have any comments, suggestions, patches either submit them through the project's github page or email [email protected].

License

MIT license:

Copyright (c) 2011 Alex Bradbury

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

About

yet another unofficial downloader for games and extras from gog.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages