• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

README.mdH A D27-Jul-20196.8 KiB152105

gogrepo.pyH A D03-May-202245.6 KiB1,180936

README.md

1gogrepo
2-------
3Python-based tool for downloading your GOG.com game collections and extras to your local computer for full offline enjoyment.
4
5It is a clean standalone python script that can be run from anywhere. It requires a typical Python 2.7 installation and html5lib.
6
7By default, game folders are saved in the same location that the script is run in. You can also specify another
8directory. Run gogrepo.py -h to see help or read more below. Each game has its own directories with all game/bonus files saved within.
9
10License: GPLv3+
11
12Features
13--------
14* Ability to choose which games to download based on combinations of OS (windows, linux, mac) and language (en, fr, de, etc...)
15* Saves a !info.txt in each game folder with information about each game/extra item.
16* Creates a !serial.txt if the game has a special serial/cdkey (I know, not 100% DRM-free, is it?). Sometimes coupon codes are hidden here!
17* Verify your downloaded collection with full MD5, zip integrity, and expected file size checking.
18* Auto retrying of failed fetch/downloads. Sometime GOG servers report temporary errors.
19* Ability to import your already existing local collection.
20* Easy to throw into a daily cronjob to get all the latest updates and newly added content!
21* Clear logging prints showing update/download progress and HTTP errors. Easy to pipe or tee to create a log file.
22
23
24Quick Start -- Typical Use Case
25----------------
26
27* Login to GOG and save your login cookie for later commands. Your login/pass can be specified or be prompted. You generally only need to do this once to create a valid gog-cookies.dat
28
29  ``gogrepo.py login``
30
31* Fetch all game and bonus information from GOG for items that you own and save into a local manifest file. Run this whenever you want to discover newly added games or game updates.
32
33  ``gogrepo.py update -os windows linux mac -lang en de fr``
34
35* Download the games and bonus files for the OS and languages you want for all items known from the saved manifest file.
36
37  ``gogrepo.py download``
38
39* Verify and report integrity of all downloaded files. Does MD5, zip integrity, and expected filesize verification. This makes sure your game files can actually be read back and are healthy.
40
41  ``gogrepo.py verify``
42
43Advanced Usage -- Common Tasks
44----------------
45
46* Add new games from your library to the manifest.
47
48  ``gogrepo.py update -os windows -lang en de -skipknown``
49
50* Update games with the updated tag in your libary.
51
52  ``gogrepo.py update -os windows -lang en de -updateonly``
53
54* Update a single game in your manifest.
55
56  ``gogrepo.py update -os windows -lang en de -id trine_2_complete_story``
57
58* Download a single game in your manifest.
59
60  ``gogrepo.py download -id trine_2_complete_story``
61
62Commands
63--------
64
65``gogrepo.py login`` Authenticate with GOG and save the cookie locally in gog-cookies.dat file. This is needed to do
66update or download command. Run this once first before doing update and download.
67
68    login [-h] [username] [password]
69    -h, --help  show this help message and exit
70    username    GOG username/email
71    password    GOG password
72
73--
74
75``gogrepo.py update`` Fetch game data and information from GOG.com for the specified operating systems and languages. This collects file game titles, download links, serial numbers, MD5/filesize data and saves the data locally in a manifest file. Manifest is saved in a gog-manifest.dat file
76
77    update [-h] [-os [OS [OS ...]]] [-lang [LANG [LANG ...]]] [-skipknown | -updateonly | -id <title>]
78    -h, --help            show this help message and exit
79    -os [OS [OS ...]]     operating system(s) (ex. windows linux mac)
80    -lang [LANG [LANG ...]]  game language(s) (ex. en fr de)
81    -skipknown            only update new games in your library
82    -updateonly           only update games with the updated tag in your library
83    -id <title>           specify the game to update by 'title' from the manifest
84                          <title> can be found in the !info.txt of the game directory
85
86--
87
88``gogrepo.py download`` Use the saved manifest file from an update command, and download all known game items and bonus files.
89
90    download [-h] [-dryrun] [-skipextras] [-skipextras] [-skipgames] [-wait WAIT] [-id <title>] [savedir]
91    -h, --help   show this help message and exit
92    -dryrun      display, but skip downloading of any files
93    -skipextras  skip downloading of any GOG extra files
94    -skipgames   skip downloading of any GOG game files
95    -wait WAIT   wait this long in hours before starting
96    -id <title>  specify the game to download by 'title' from the manifest
97                 <title> can be found in the !info.txt of the game directory
98    savedir      directory to save downloads to
99
100--
101
102``gogrepo.py verify`` Check all your game files against the save manifest data, and verify MD5, zip integrity, and
103expected file size. Any missing or corrupt files will be reported.
104
105    verify [-h] [-skipmd5] [-skipsize] [-skipzip] [-delete] [gamedir]
106    gamedir     directory containing games to verify
107    -h, --help  show this help message and exit
108    -skipmd5    do not perform MD5 check
109    -skipsize   do not perform size check
110    -skipzip    do not perform zip integrity check
111    -delete     delete any files which fail integrity test
112
113--
114
115``gogrepo.py import`` Search an already existing GOG collection for game item/files, and import them to your
116new GOG folder with clean game directory names and file names as GOG has them named on their servers.
117
118    import [-h] src_dir dest_dir
119    src_dir     source directory to import games from
120    dest_dir    directory to copy and name imported files to
121    -h, --help  show this help message and exit
122
123--
124
125``gogrepo.py backup`` Make copies of all known files in manifest file from a source directory to a backup destination directory. Useful for cleaning out older files from your GOG collection.
126
127    backup [-h] src_dir dest_dir
128    src_dir     source directory containing gog items
129    dest_dir    destination directory to backup files to
130    -h, --help  show this help message and exit
131
132
133Requirements
134------------
135* Python 2.7 (Python 3 support coming soon)
136* html5lib 0.99999 (https://github.com/html5lib/html5lib-python)
137* html2text 2015.6.21 (https://pypi.python.org/pypi/html2text) (optional, used for prettying up gog game changelog html)
138
139I recommend you use `pip` to install the above python modules.
140
141  ``pip install html5lib html2text``
142
143TODO
144----
145* ~~add ability to update and download specific games or new-items only~~
146* add 'clean' command to orphan/remove old or unexpected files to keep your collection clean with only the latest files
147* support resuming manifest updating
148* ~~add support for incremental manifest updating (ie. only fetch newly added games) rather than fetching entire collection information~~
149* ability to customize/remap default game directory name
150* add GOG movie support
151* ... feel free to contact me with ideas or feature requests!
152