LGOGDownloader

repository·master·Indexed 21 days ago

https://github.com/sude-/lgogdownloader

An unofficial open-source downloader for GOG.com that utilizes the GOG Galaxy API to list, download, and manage game libraries. It provides functionality for Linux users to download games, repair files, and manage Galaxy builds and cloud saves via a command-line interface.

Tokens
5K
Snippets
18
Records
26
Agent score
74%

What's inside LGOGDownloader

  1. Install dependencies on Debian/Ubuntu

    master

    To build LGOGDownloader on Debian or Ubuntu-based systems, install the required development libraries and build tools using apt:

    apt install build-essential libcurl4-openssl-dev libboost-regex-dev \
    libjsoncpp-dev librhash-dev libtinyxml2-dev libtidy-dev \
    libboost-system-dev libboost-filesystem-dev libboost-program-options-dev \
    libboost-date-time-dev libboost-iostreams-dev cmake \
    pkg-config zlib1g-dev qtwebengine5-dev ninja-build
    apt install build-essential libcurl4-openssl-dev libboost-regex-dev \
    libjsoncpp-dev librhash-dev libtinyxml2-dev libtidy-dev \
    libboost-system-dev libboost-filesystem-dev libboost-program-options-dev \
    libboost-date-time-dev libboost-iostreams-dev cmake \
    pkg-config zlib1g-dev qtwebengine5-dev ninja-build
  2. Install dependencies on Fedora

    master

    To build LGOGDownloader on Fedora, install the necessary development packages using dnf:

    sudo dnf install cmake make gcc gcc-c++ glibc tinyxml2-devel rhash-devel \
    libtidy-devel tinyxml-devel jsoncpp-devel libcurl-devel \
    boost-devel
    sudo dnf install cmake make gcc gcc-c++ glibc tinyxml2-devel rhash-devel \
    libtidy-devel tinyxml-devel jsoncpp-devel libcurl-devel \
    boost-devel
  3. Build and install LGOGDownloader on Debian/Ubuntu

    master

    Use cmake with the Ninja generator to configure the build with Qt GUI support enabled, then use ninja to install it to the system prefix.

    Note: This example sets the install prefix to /usr and uses Release build type.

    cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_QT_GUI=ON -GNinja
    ninja -Cbuild install
  4. Configure platform and language priorities

    master

    LGOGDownloader supports priority-based selection for platforms and languages.

    Platform Selection

    Use --platform with identifiers:

    • w / win / windows: Windows
    • m / osx / mac: Mac
    • l / lin / linux: Linux

    Language Selection

    Use --language with identifiers like en, de, fr, etc.

    Priority Logic

    • Combination (+): Downloads both. Example: --language de+en downloads both German and English if available.
    • Priority (,): Downloads the first available. Example: --language de,en downloads German if available; otherwise, it downloads English.
    • Stacking: You can combine these. Example: --language es+fr,en downloads both Spanish and French if available; if neither is found, it downloads English.
    lgogdownloader --download --platform "l,w+m" --language "de,en+fr"
  5. How to use priority and combination syntax for platforms and languages

    master

    When selecting platforms or languages via --platform or --language, you can specify a preference order and fallback logic using specific characters:

    • Priority (,): Separate values with a comma to define a preference order. The downloader will try the first option, and if unavailable, move to the next.
    • Combination (+): Combine options using a plus sign. This means "this option OR that option".

    Examples:

    • l,w+m: Try Linux first. If not available, try Windows or Mac.
    • de,en+fr: Try German first. If not available, try English or French.
  6. Galaxy installation subdirectory templates

    master

    When using --subdir-galaxy-install, you can use the following templates to define the installation path:

    • %install_dir%: The installation directory from the Galaxy API response.
    • %gamename%: The game name.
    • %title%: The game title.
    • %product_id%: The product ID of the game.
    • %install_dir_stripped%: %install_dir% with non-alphanumeric characters (except space, -, _, ., (, ), [, ], {, }) removed.
    • %title_stripped%: %title% with non-alphanumeric characters (except space, -, _, ., (, ), [, ], {, }) removed.
  7. Login to GOG.com

    master

    To download purchased games, you must first authenticate with your GOG account. Use the following options:

    • --login: Standard login.
    • --gui-login: Forces a GUI login (implies --enable-login-gui).
    • --browser-login: Forces login via a web browser.
    • --check-login-status: Verifies if you are currently logged in.
    lgogdownloader --login
  8. Download games and extras

    master

    The --download flag initiates the download process. You can refine what is downloaded using several filters:

    Filtering by Game

    • --game <regex>: Filter games using a Perl-syntax regular expression. This takes precedence over --game-list.
    • --game-list <file>: Use a file containing a list of Perl-syntax regular expressions to filter games.
    • --tag <tag1,tag2>: Filter by specific GOG tags (comma-separated).

    Filtering by Content Type

    Use --include or --exclude with the following identifiers:

    • bi / basegame_installers: Base game installers.
    • be / basegame_extras: Base game extras.
    • bp / basegame_patches: Base game patches.
    • bl / basegame_languagepacks: Base game language packs.
    • di / dlc_installers: DLC installers.
    • de / dlc_extras: DLC extras.
    • dp / dlc_patches: DLC patches.
    • dl / dlc_languagepacks: DLC language packs.
    • b / basegame: All base game content.
    • d / dlc: All DLC content.
    • i / installers: All installers.
    • e / extras: All extras.
    • p / patches: All patches.
    • l / languagepacks: All language packs.
    • all: Everything.
    lgogdownloader --download --game "Witcher" --include=bi,di
  9. Repair downloaded files

    master

    If files are corrupted or versions have changed, use --repair in conjunction with --download. This will redownload files where the size does not match. Note that redownloaded files will have .old appended to their original filenames.

    lgogdownloader --download --repair --game "Some Game"
  10. Check for orphaned files

    master

    Orphaned files are files found on your local filesystem that are no longer found on GOG servers.

    • --check-orphans [regex]: Checks for orphans using a Perl-syntax regex. If no regex is provided, it defaults to: '.*\.(zip|exe|bin|dmg|old|deb|tar\.gz|pkg|sh|mp4)$'.
    • --delete-orphans: Deletes the orphaned files found during the check or during a --galaxy-install.
  11. Manage Blacklists and Ignorelists

    master

    You can prevent specific files from being downloaded or flagged as orphans using text files.

    Blacklist

    Purpose: Prevents files from being downloaded or mentioned as orphans. Location: $XDG_CONFIG_HOME/lgogdownloader/blacklist.txt.

    Ignorelist

    Purpose: Prevents files from being mentioned as orphans during an orphan check. Location: $XDG_CONFIG_HOME/lgogdownloader/ignorelist.txt.

    Formatting

    Both files use a specific format where each line must start with Rp (for Regular Expression) followed by a space and the Perl-syntax expression. Expressions are matched against the file path relative to the --directory option.

    Example:

    # Ignore a specific manual folder
    Rp ^[^/]*/manual/.*
    
    # Ignore a specific file in a specific game
    Rp divinity_2_developers_cut/extras/divinity_2_ladymageknight\.zip