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

×
Hi, is there any indication of game being present in my library on `/games/ajax/filtered`? Product list page seems to display "in library" labels even with all other XHR requests blocked, but I can't find which property it is in, there is an `availability.isAvailableInAccount` property, but it is always true for every game I have checked. I can check game id against `/user/data/games`, but maybe there is already a property I am missing?
avatar
Dmayak: Hi, is there any indication of game being present in my library on `/games/ajax/filtered`? Product list page seems to display "in library" labels even with all other XHR requests blocked, but I can't find which property it is in, there is an `availability.isAvailableInAccount` property, but it is always true for every game I have checked. I can check game id against `/user/data/games`, but maybe there is already a property I am missing?
Maybe the isVisibleInAccount property of /v2/games is what you are looking for? I don't see anything in the search data.
Hey folks, fantastic information so far in this thread! I'm working on a Golang (self-hosted) local GOG website called vangogh (I have some things implemented here: https://github.com/arelate) and stumbled upon the following problem:

I'm trying to get a consistent source of the data for indexing (search, view models), something along the lines of id, title, publisher, developer(s), rating, languages, etc.

api.gog.com/v2/games/{id} seems like a great source for games - store products and account products seem universally available (with exceptions like "Spring Sale Goodies Collection #1": https://api.gog.com/v2/games/2005648906), however I couldn't find how to make that work for movies. Neither /games/{movie_id}, nor /movies/{movie_id}, nor /{movie_id} works.

api.gog.com/products/{id} does seem to work for games AND movies, however it doesn't seem to contain things like publisher, developer, rating even with available `expand` values (perhaps I'm missing some?).

My current backup plan is to use response from /games/ajax/filtered?mediaType=movies and hope that it'll correspond with account products, unlike games (regional versions, bundles) - less than ideal since that'll be a separate code-path for movies.

Any ideas on data sources that would ideally allow to do this consistently between games and movies would be appreciated!
avatar
boggydigital: api.gog.com/products/{id} does seem to work for games AND movies, however it doesn't seem to contain things like publisher, developer, rating even with available `expand` values (perhaps I'm missing some?).

My current backup plan is to use response from /games/ajax/filtered?mediaType=movies and hope that it'll correspond with account products, unlike games (regional versions, bundles) - less than ideal since that'll be a separate code-path for movies.

Any ideas on data sources that would ideally allow to do this consistently between games and movies would be appreciated!
As far as I am aware, you are not missing anything. ̶Y̶o̶u̶r̶ ̶b̶a̶c̶k̶u̶p̶ ̶p̶l̶a̶n̶ ̶i̶s̶ ̶h̶o̶w̶ ̶I̶ ̶c̶u̶r̶r̶e̶n̶t̶l̶y̶ ̶t̶r̶a̶c̶k̶ ̶m̶o̶v̶i̶e̶s̶ ̶i̶n̶ ̶m̶y̶ ̶s̶c̶r̶i̶p̶t̶s̶, largely because, as you also pointed out, api.gog.com/products/{id} is missing developer/publisher info. With GOG, movies in general seem to be an afterthought... including the support in their APIs.

P.S. Scratch that, this is how I am currently doing it for movies (scraping the product/movie website page). But your idea might have merit. Let me know how it goes, I might switch to it later on :).
Post edited February 23, 2021 by WinterSnowfall
avatar
WinterSnowfall: ...
Thank you for the insights - that makes sense! I'll take a stab and see how that goes :-) With cases like that it's always tempting to just rip out any support for movies, but hey - I'll keep trying to maintain them in my code for now.
avatar
boggydigital: Hey folks, fantastic information so far in this thread! I'm working on a Golang (self-hosted) local GOG website called vangogh (I have some things implemented here: https://github.com/arelate) and stumbled upon the following problem:

I'm trying to get a consistent source of the data for indexing (search, view models), something along the lines of id, title, publisher, developer(s), rating, languages, etc.

api.gog.com/v2/games/{id} seems like a great source for games - store products and account products seem universally available (with exceptions like "Spring Sale Goodies Collection #1": https://api.gog.com/v2/games/2005648906), however I couldn't find how to make that work for movies. Neither /games/{movie_id}, nor /movies/{movie_id}, nor /{movie_id} works.

api.gog.com/products/{id} does seem to work for games AND movies, however it doesn't seem to contain things like publisher, developer, rating even with available `expand` values (perhaps I'm missing some?).

My current backup plan is to use response from /games/ajax/filtered?mediaType=movies and hope that it'll correspond with account products, unlike games (regional versions, bundles) - less than ideal since that'll be a separate code-path for movies.

Any ideas on data sources that would ideally allow to do this consistently between games and movies would be appreciated!
Abstract and cache if possible. This is my first time seeing this stuff (from first post to jumping to last page, so keep that context in mind), but ask yourself how you'd implement it. Would you use the same database for both games and movies? Given it's made for Galaxy, i expect it to have whatever is available for Galaxy. Therefore, if Galaxy has it, there's a safe way to grab it. If Galaxy doesn't display it, i would assume it's apocrypha not gospel. I don't use galaxy, so i wouldn't know.
avatar
kohlrak: Therefore, if Galaxy has it, there's a safe way to grab it.
I'm sure there is a sane(r) way, but even the GOG website seems half-broken when it comes to movies. Just go on any movie page and inspect the flow - you'll see calls made to the v2 APIs that return 404.
avatar
kohlrak: Therefore, if Galaxy has it, there's a safe way to grab it.
avatar
WinterSnowfall: I'm sure there is a sane(r) way, but even the GOG website seems half-broken when it comes to movies. Just go on any movie page and inspect the flow - you'll see calls made to the v2 APIs that return 404.
When the devs have a broken site, a broken client, and a broken API, it does beg the question what the hell the company has them doing other than coding. They've been working 8 hour shifts for several years, supposedly. Do they have them doing support duty and/or mod duty all the time or something?
Developed a simple library in JavaScript for returning GOG products in a class.
NPM: https://www.npmjs.com/package/ugog-product and source code in github: https://github.com/HDK101/unnoficial-gog-product-wrapper
Post edited February 24, 2021 by EMKBRO
avatar
kohlrak: Would you use the same database for both games and movies?
FWIW, most of the data is consistent for games and movies with the exception of api.gog.com/v2 endpoint. Store products (type for the "STORE" items, as well as wishlist), Account products (type for your account games), Details (type for expanded items in account) are the same for both from a schema perspective.

It gets a bit weird at time:
- account product movies have worksOn.Windows, .Mac, .Linux (all set to "false")
- details for movies have things like "cdKeys", "simpleGalaxyInstallers" - both unlikely super relevant for movies :-)

From the data types perspective supporting movies is not a lot of work on top of games, since GOG reused games schemas mostly. I'm sure there are more exceptions like api.gog.com/v2 not being available - yet so far it's been not so bad.
avatar
kohlrak: Would you use the same database for both games and movies?
avatar
boggydigital: FWIW, most of the data is consistent for games and movies with the exception of api.gog.com/v2 endpoint. Store products (type for the "STORE" items, as well as wishlist), Account products (type for your account games), Details (type for expanded items in account) are the same for both from a schema perspective.

It gets a bit weird at time:
- account product movies have worksOn.Windows, .Mac, .Linux (all set to "false")
- details for movies have things like "cdKeys", "simpleGalaxyInstallers" - both unlikely super relevant for movies :-)

From the data types perspective supporting movies is not a lot of work on top of games, since GOG reused games schemas mostly. I'm sure there are more exceptions like api.gog.com/v2 not being available - yet so far it's been not so bad.
That's exactly what i thought it'd look like. So the issue is you, ultimately, don't know where the value that you're looking for is stored, right? And it doesn't help that there are unused values to sort through (either because they're irrelevant or because the data is broken like in the case of the worksOn). Either way, the point remains. If it's on galaxy, it's there somewhere. I doubt galaxy guesses and guesses accurately.
Post edited February 27, 2021 by kohlrak
Hello there, hope you're all doing fine.

Before getting to the point, I'd just like to thank Yepoleb for documenting the whole GOG API - it really is great work and shows dedication.

Now, I'd like to ask for some help hoping that someone here can shed some light.

I'm working on a small project using the GOG API to retrieve info (note: I'm mostly doing this as practice, for fun). So far I can handle authentication, get user info, library items, etc. Now I want to *drumroll* ... download my games :)

I successfully retrieve the download links for a specific game and subsequently get the secure url for each file of the installer. This is where I'm stuck now.

The response JSON is essentially an object in the form { "downlink": "...", "checksum": "..." }.

When I try to send a 'GET' request at the above "downlink" URL, all I get back is an HTML response obviously intended for a browser to redirect somewhere else and initiate the download. So my question is, how do I eventually start the download in my own code without browser interference? Do I have to use a headless browser in the background or is there a more elegant way?
avatar
Panaias: Hello there, hope you're all doing fine.

Before getting to the point, I'd just like to thank Yepoleb for documenting the whole GOG API - it really is great work and shows dedication.

Now, I'd like to ask for some help hoping that someone here can shed some light.

I'm working on a small project using the GOG API to retrieve info (note: I'm mostly doing this as practice, for fun). So far I can handle authentication, get user info, library items, etc. Now I want to *drumroll* ... download my games :)

I successfully retrieve the download links for a specific game and subsequently get the secure url for each file of the installer. This is where I'm stuck now.

The response JSON is essentially an object in the form { "downlink": "...", "checksum": "..." }.

When I try to send a 'GET' request at the above "downlink" URL, all I get back is an HTML response obviously intended for a browser to redirect somewhere else and initiate the download. So my question is, how do I eventually start the download in my own code without browser interference? Do I have to use a headless browser in the background or is there a more elegant way?
Did you try a GET with redirect enabled?

Could you post an example of an actual "downlink" URL?
avatar
mrkgnao: Did you try a GET with redirect enabled?

Could you post an example of an actual "downlink" URL?
Hey, thanks for replying.

Here is an example URL:

downlink: 'https://content-system.gog.com/products/1116941879/users/user_id_here/namespaces/website/download?path=%2Fsecure%2Foffline%2F1116941823%2F1116941823%2F52229249225039594%2F9632%2Fsetup_the_game_%2829152%29.exe&token=some_very_very_long_string'

Of course I changed a few parts above for obvious reasons (e.g. the token at the end).

Could you elaborate on how I can actually perform a GET request with redirection enabled?

(P.S. Please excuse me if anything sounds funny, I've been a programmer for many years but web development is kind of new to me. By the way I'm doing this in NodeJS, if it helps.)
Post edited April 12, 2021 by Panaias
avatar
mrkgnao: Did you try a GET with redirect enabled?

Could you post an example of an actual "downlink" URL?
avatar
Panaias: Hey, thanks for replying.

Here is an example URL:

downlink: 'https://content-system.gog.com/products/1116941879/users/user_id_here/namespaces/website/download?path=%2Fsecure%2Foffline%2F1116941823%2F1116941823%2F52229249225039594%2F9632%2Fsetup_the_game_%2829152%29.exe&token=some_very_very_long_string'

Of course I changed a few parts above for obvious reasons (e.g. the token at the end).

Could you elaborate on how I can actually perform a GET request with redirection enabled?

(P.S. Please excuse me if anything sounds funny, I've been a programmer for many years but web development is kind of new to me. By the way I'm doing this in NodeJS, if it helps.)
Yes. This is the non-redirected link. A redirected link would look something like:
https://www.gog.com/downloads/80_days/en1installer0

How to enable redirection depends on the language you are using. I don't know NodeJS.

I googled "nodejs get redirect url" and found a couple of links that might be relevant:
https://www.tutorialspoint.com/redirecting-requests-in-node-js
https://www.tutorialkart.com/nodejs/node-js-redirect-url/
https://stackoverflow.com/questions/16687618/how-do-i-get-the-redirected-url-from-the-nodejs-request-module

Hope this helps.