Home

Awesome

GOG2_Fanatical_Plugin

GOG Galaxy 2.0 Connector to Fanatical Platform

WARNING: this project is highly dependant from the Fanatical Site structure/updates and the GOG2 Plugin Library. Currently the Fanatical site is no more compatible with the internal web browser part of the GOG2 plugin library, so the initial authentication process (see "Accessing your Fanatical account library" chapeter below) remains stucked when rendering the login page. This means you can no more connect the Fanatical Store from scratch because the initial authentication is not working, but you can continue to use the plugin if you already connected in the past. In this case please do not disconnect!

Overview

This plugin was written to let you see in the Gog Galaxy 2.0 UI all those owned-but-not-redeemed games that you purchased from Fanatical.

Note: this is an experimental project (no guarantee of any type) because, even if I'm quite experienced with different programming languages, this really it's my first phyton-based project. So if you're a coder please do not look for the perfect phyton/js implementation in this, even if I did my best I'm not a phyton pro.

But if your're a gamer or a collector that loves seeing all that game covers in the GOG2 grid then this plugin can be cool as it is for me :)

Example of the resulting GOG 2.0 grid

Features

* See chapter "Advanced Configuration"

Due to the nature of Fanatical, this integration does not support tags, start, game time and other amenities, it just list owned unredeemed games.

Installation

Installation of a plugin is an easy procedure, consisting in the following steps

You can download the last tested and packaged release build or even use the last (untested and unpackaged) available code.

[Update] If you have already used the Galaxy Plugin Downloader by Slashbunny, now you can also download and install this plugin with that tool, getting it here. Currently still not released, so you have to do by running the last src code.

1. (recommended) Downloading the last release

You can find the last release zip here (only windows 10 tested, but it may work also on other platforms).

1. (alternative) Downloading the last code available

Download all the src folder content here in a local directory.

2. Create plugin folder

You have to create a new folder where GOG Galaxy looks for plugins when starting.

<new-plugin-folder> may be simply the release zip name (recommended) or any other still non existing name you like.

Help for unexperienced windows users: %LOCALAPPDATA% is a folder located under the hidden AppData folder that is itself under your user folder. You can reach %LOCALAPPDATA% by one of this ways:

3. Copy plugin in just created folder

Unpack downloaded release zip to the just created folder (or copy all src contents if you downloaded the src code)

4. Restart GOG 2 Galaxy Client (and check if installation was successful)

You have to restart GOG Galaxy to let it see the new plugin. Please note that closing the window will not exit GOG Galaxy, you have to use the exit menu in the "gear" drop down (top left of the window)

GOG Exit Menu

After (really) exiting, re-start GoG Galaxy normally. When you get to the interface you still will not see anything changed, but the plugin should be installed. Let check this going in to the same "gear" drop down menu and opening this time the Setting sub-menu

Fanatical Plugin Installed

If a "Fanatical store" plugin is present in the integrations list, you made it! Please note that the plugin status is disconnected (see next section to make your first connection).

Accessing your Fanatical account library

To get the list of all your unredeemed games, the plugin needs to have access to you account.

If you're not already on the settings dialog, click the "gear" drop down menu and open it via the Settings sub-menu. If the plugin is correctly installed you see a Connect button corresponding the installed Fanatical plugin (see check if installation was successful section).

Click the Connect button and another dialog pops-up giving you information about the Fanatical Plugin's enabled capabilities (only Library will be enabled - see "Features" section for clarifications).

Connection Dialog

Click on the Connect button on this last dialog and the GOG embedded browser will open right on the Fanatical home page. After some seconds the sing-in dialog will automatically pop-up, asking for your credentials.

Sing-In Dialog

Check the "Keep me singed in" flag, and then proceed normally through all the steps of authentication (also Google challenge and so on). If login is succesfull, you will get to the standard successful login message, and after some seconds the browser window will close automatically.

You can verify if connection was successfull, checking the new status of the plugin.

Settings Dialog When Connected

Now GOG Galaxy will get a list of all your owned and unredeemed games, and in some time you will get covers and a new "Fanatical" collection on the Interface.

Sometimes (expecially if you have many games, and if importing them is happening while other big libraries are updating their lists) it will take some minutes to import all your games and have their cover image ready. The plugin will check for updates every 15 minutes.

Normally after the first complete a login, another authenticaton will be needed no more, because the Plugin will remember your credentials (as a normal browser would do). Anyway you can always disconnect and re-connect with the same procedure we just described if something strange happens (e.g. Fanatical plugin disconnects or gets a error when starting), or if you simply change your Fanatical credentials.

Advanced Configuration

Game name mapping and game exclusions

Sometines it is useful to map "unusual" Fanatical game names to more common ones, with the goal to get correct correspondance with cover and metadata taken by GOG Galaxy from the IGDB database.

You can force this type of mapping simply editing the games_name_mapping.json file located in the folder that contains the plugin.

The structure of such json file is the following:

{
    "Azura": "Azura",
    "GRID - 2019": "GRID (2019)",
    "DLC": "__FORCE_EXCLUSION__",
}

Each couple of strings separated by a column will cause a tentative name substitution/exclusion.

The string at the left of the column will be matched with the "original" name of the game given by Fanatical. If the given string is contained in the name (regular expressions can be used), then the name at the right of the column will subtituite the original one.

If the special value "__FORCE_EXCLUSION__" is used, the corresponding game matched will not be returned to GOG Galaxy. Current configuration excludes all games that have "DLC" in the Fanatical name.

If you have more mapping to suggest as default substitutions/exclusions, please submit a pull request or raise an issue on the GitHub repository.

Scraping Mode

If for some reason games can not be retrieved by Fanatical using direct queries, as it happens by default, you can try a second way to extract the unredeemed games, enabling "Scraping Mode".

Using this mode, authentication is equally necessary, but there is no need of all the security involved in direct queries after authentication: the plugin simply makes a copy of the game names that can be "seen" browsing through the library pages (this is called scraping in other contexts). The bad side of this featured mode is that it is higly dependant form details of the page, and it turns out to be not as reliable as the default mode in some cases. Anyway there could be some users that can benefit of this mode if the default one fails for some reason.

To enable "scraping mode" you have to change the fanatical_configuration.py

SCRAPED_GAMES_MODE = True

Then GOG Galaxy has to be restarted.

During scraping of the library (done when authentication happens) a progress bar will appear indicating how much scraping work was be done as percentage of the total work needed to finish.

GOG Scraping Mode

Only after all the games have been scraped the embedded browser window will close.

Because of structural limitations, refresh time cannot be forced in Scraping Mode. Real re-scraping (and so updates) of the owned games happens only when the GOG Galaxy Application calls for a full refresh.

Issue reporting

I wrote this plugin during my scarce free time (usally at night): no support is granted but you can try :) Along with your detailed problem description, you may need to attach plugin log files located at:

Windows: %programdata%\GOG.com\Galaxy\logs

MacOS: /Users/Shared/GOG.com/Galaxy/Logs

The right log file simply contains "fanatical" :)