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

×
avatar
adaliabooks: Ok, a quick look at the library suggests it wouldn't be trivial to do as the information is only on the second layer (when you click on the game on the shelf) and would require an AJAX call for each game, which would soon probably crash the system if you have over 100 - 200 games...

But there may be other ways to do it.
Have you looked at MaGog? You can import your owned games into it and could then display a list of them, adding them with a script would be far easier that way. Not sure if it's more or less hassle than gogrepo would be though...
Thank you for looking into it.

I was writing before your later replies (and now deleted all of the reply), and tried now with your method. I'm glad you engaged with this puzzle. :)

I'm checking now some specific games, and it seems MaGog has issues with file sizes for some of them, for example The Witcher 3 or the Zork Anthology, but it certainly makes a manual count simpler.

avatar
timppu: Either way, I suggest you try out gogrepo.py. When you start the actual download of your games/extras with gogrepo, it will tell you right at the start how much exactly is still to be downloaded (total), which is the figure you're after. You can cancel the download right there if your intention was not to download your games but just to see how much space they will take.
Thank you for confirming this. If it gets too complicated I will go with gogrepo, it really looks like a fine piece of programming in any case.
Post edited December 14, 2016 by Links
avatar
Links: Thank you for looking into it.

I was writing before your later replies (and now deleted all of the reply), and tried now with your method. I'm glad you engaged with this puzzle. :)

I'm checking now some specific games, and it seems MaGog has issues with file sizes for some of them, for example The Witcher 3 or the Zork Anthology, but it certainly makes a manual count simpler.

Thank you for confirming this. If it gets too complicated I will go with gogrepo, it really looks like a fine piece of programming in any case.
No problem, I do enjoy a bit of problem solving :)

Like I said, it's not perfect, it's based on what I believe is just Gog's own estimates for file size / install size rather than the sizes of the files themselves (which MaGog does have, but is harder to work with in the format it's in)

gogrepo really is your best bet for an accurate number (and for downloading the games too probably)
I'm giving the answer "prize" (A for effort) to adalia, but feel free to keep the thread going if anyone has other ideas.
avatar
adaliabooks: [snip]
And in the Options section change Output Format to JSON.
You could output this as HTML and do it manually (it does include all the sizes for the bonuses etc. too), unfortunately the formatting doesn't lend itself to scraping easily.

Otherwise, once on the JSON output page, run this script from your browser's console. It should give you an output in MB of the size of your library.
[snip]
MaGog already calculates the total file size of the games in your search results (based on the info on each game's store page) at the bottom of each results page, as well as showing the average file size per game (though I struggle to think of a scenario in which knowing the average file size would be all that useful). Am I misunderstanding? Is this not what your script is also meant to show?
avatar
adaliabooks: [snip]
And in the Options section change Output Format to JSON.
You could output this as HTML and do it manually (it does include all the sizes for the bonuses etc. too), unfortunately the formatting doesn't lend itself to scraping easily.

Otherwise, once on the JSON output page, run this script from your browser's console. It should give you an output in MB of the size of your library.
[snip]
avatar
HunchBluntley: MaGog already calculates the total file size of the games in your search results (based on the info on each game's store page) at the bottom of each results page, as well as showing the average file size per game (though I struggle to think of a scenario in which knowing the average file size would be all that useful). Am I misunderstanding? Is this not what your script is also meant to show?
LOL
Whoops, that is indeed what it does. I rarely reach the bottom of the results page so didn't notice that XD
Trust mrkgnao to be one step ahead...
XD I never looked either.

It is still quite off, I will get a more accurate count manually, to include the games with size issues and the big goodies not included in the installers (OSTs mainly).
Post edited December 14, 2016 by Links
avatar
adaliabooks: LOL
Whoops, that is indeed what it does. I rarely reach the bottom of the results page so didn't notice that XD
Trust mrkgnao to be one step ahead...
What fun's an existing solution when a new, more complex one can be dreamt up, eh? =D
Posted instead of editing, sorry
Post edited December 14, 2016 by Links
avatar
adaliabooks:
I don't suppose the script could be altered to instead total the numbers from the various sub-categories of the "Downloadable Files" category? Then it might still serve an otherwise-unfulfilled purpose to Links. (At least, I don't think MaGog can do that on its own..yet. But she's probably listening...planning....)
EDIT: Closed italics tag and corrected inadvertent reference to MaGog doing carpentry.
Post edited December 14, 2016 by HunchBluntley
avatar
adaliabooks:
avatar
HunchBluntley: I don't suppose the script could be altered to instead total the numbers from the various sub-categories of the "Downloadable Files" category? Then it might still serve an otherwise-unfulfilled purpose to Links. (At least, I don't think MaGog can do that on its own..yet. But she's probably listening...planning....)
EDIT: Closed italics tag and corrected inadvertent reference to MaGog doing carpentry.
Technically yes, but the issue there is there's no easy way to identify those via javascript. They don't have any unique class (the easiest way to find them) so you'd have to regex it or something.
Then you have to parse whether it's GB or MB (or KB?) and adjust accordingly.
It's certainly doable, but not in the vein of a quickly thrown together script. I'll have another look at it when I can be bothered and make it do a more accurate count.
avatar
HunchBluntley: What fun's an existing solution when a new, more complex one can be dreamt up, eh? =D
Also, yes. Totally XD

These [url=https://xkcd.com/1445/]strips are totally me.
Post edited December 14, 2016 by adaliabooks
You can use www.gog.com/user/data/games and combine it with api.gog.com/products/123?expand=downloads, which returns sizes in a machine readable format.
avatar
adaliabooks: Technically yes, but the issue there is there's no easy way to identify those via javascript. They don't have any unique class (the easiest way to find them) so you'd have to regex it or something.
Then you have to parse whether it's GB or MB (or KB?) and adjust accordingly.
It's certainly doable, but not in the vein of a quickly thrown together script. I'll have another look at it when I can be bothered and make it do a more accurate count.
I figured there was a good reason that that wasn't what you had the script do in the first place. Sigh.

avatar
adaliabooks: Also, yes. Totally XD

These [url=https://xkcd.com/1445/]strips are totally me.
DUDE, spoilers! I'm only on #792, and I don't want to skip ahead!

=P
avatar
HunchBluntley: DUDE, spoilers! I'm only on #792, and I don't want to skip ahead!

=P
Wait, you read them in order? :P

I just hit random until I find one I haven't seen (which doesn't happen much now, I'm sure I've read most of them)
avatar
HunchBluntley: DUDE, spoilers! I'm only on #792, and I don't want to skip ahead!

=P
avatar
adaliabooks: Wait, you read them in order? :P
I was joking about the "no spoilers" bit, but yeah, I do tend to read all web comics from the beginning, regardless of whether or not there's anything like a narrative or continuity.
Though I only very rarely read web comics these days. Or blogs, for that matter. [hangs head]

avatar
adaliabooks: I just hit random until I find one I haven't seen (which doesn't happen much now, I'm sure I've read most of them)
Speaking of inefficiency... :P
avatar
adaliabooks: Wait, you read them in order? :P
avatar
HunchBluntley: I was joking about the "no spoilers" bit, but yeah, I do tend to read all web comics from the beginning, regardless of whether or not there's anything like a narrative or continuity.
Though I only very rarely read web comics these days. Or blogs, for that matter. [hangs head]

avatar
adaliabooks: I just hit random until I find one I haven't seen (which doesn't happen much now, I'm sure I've read most of them)
avatar
HunchBluntley: Speaking of inefficiency... :P
I only really read xkcd these days, used to read loads but can't be bothered to keep up with them any more.

Yeah, but the problem is because I started that way there's not much point in going through them in order either, having already read most of them... at least the random ones I've seen before are still funny :)