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

×
high rated
Check your chat. :)
high rated
avatar
Azhdar: Check your chat. :)
As I said in the chat. What a wonderful surprise. Great many thanks.
high rated
Update:
I've tried everything I could think of, but to no avail. MaGog sends the gog_lc cookie just as it did in the past year or more, but GOG seems to ignore it completely since this morning. I am pretty sure it is a result of the HTTP to HTTPS change.

Until this is somehow fixed (if it is), in order to be able to re-activate MaGog's regular updates, I disabled the collection of all information related to this cookie.

Here is what is affected:
- No new information about regional pricing
- No new information about foreign game titles
- No new information about less-giftable status
- No monitoring of regional blocking (i.e. detection of newly-blocked games or removal of existing blocks)
- The prices displayed by MaGog are now the Canadian prices, not the US ones, because MaGog lives in Canada and I cannot set the US_USD_en cookie (only two games are currently priced differently between the two: TW3 Expansion Pass and TW3 Hearts of Stone)

My plans are:
1) See if Johny. can shed some light on the matter.
2) Create a thread and ask for people's assistance. Perhaps someone will come up with an idea.
3) Wait for a while. Perhaps GOG will fix it on its own.
4) If it persists for more than a couple of weeks, I guess I will remove all the affected features from MaGog's display, filters, etc.
5) I'll be quite disappointed and discouraged
avatar
mrkgnao: - The prices displayed by MaGog are now the Canadian prices, not the US ones, because MaGog lives in Canada and I cannot set the US_USD_en cookie (only two games are currently priced differently between the two: TW3 Expansion Pass and TW3 Hearts of Stone)

My plans are:
1) See if Johny. can shed some light on the matter.
2) Create a thread and ask for people's assistance. Perhaps someone will come up with an idea.
3) Wait for a while. Perhaps GOG will fix it on its own.
4) If it persists for more than a couple of weeks, I guess I will remove all the affected features from MaGog's display, filters, etc.
5) I'll be quite disappointed and discouraged
That's very annoying...
If you can let me know how you do what you're doing (here or in a PM) I'll see if I know any workarounds. I'm fairly sure I've come across currency variables in the javascript before, but I've not tried changing them.
It may not be any use if you are using the JSON urls to retrieve data (we may have had this conversation before over something different) but it might or if you're doing something different I might be able to help.
1. Probably your whole cookie is lowercase (country part is tolerated as lowercase). I don't know why. For me changing cookie works. (editThisCookie Chrome addon)
2. Check this endpoint https://www.gog.com/user/changeCurrency/USD - it will change the currency part of the cookie for you. Probably you would need a little refactor to wait for a callback then.
Post edited March 16, 2016 by Johny.
avatar
Johny.: 1. Probably your whole cookie is lowercase (country part is tolerated as lowercase). I don't know why. For me changing cookie works. (editThisCookie Chrome addon)
2. Check this endpoint https://www.gog.com/user/changeCurrency/USD - it will change the currency part of the cookie for you. Probably you would need a little refactor to wait for a callback then.
Thank you for replying (here and via chat).

I will post a detailed description of everything I do in a new thread sometime tonight, but briefly what I do is:
my $browser = LWP::UserAgent->new(); #browser-like object
my $cookie_jar = HTTP::Cookies->new() ; #container for cookies
$browser->cookie_jar($cookie_jar);
$cookie_jar->set_cookie(0, "gog_lc", "US_USD_en", "/", ".gog.com", 80, 0, 0, 86400, 0);
$ctlg = $browser->get("http://www.gog.com/games/ajax/filtered?mediaType=game&page=1&sort=title")->content();
I tried with http and with https. In both cases, the data I receive is ok (no error), but the data is unaffected by the cookie (i.e. data is for CA_USD_en).

At a later point, I change the country (e.g. new cookie with DE_USD_en, GB_USD_en, AR_USD_en, etc.), but everything remains CA.
At an even later point, I change the language (e.g. new cookie with US_USD_fr, US_USD_ru, etc.), but everything remains en.
I never change the currency part. I always use USD.

This code hasn't changed in months and worked well until yesterday. I can say that it still worked fine on 15 March 07:00-08:00 (Poland time) and did not work any more since 15 March 13:00-14:00 (Poland time).

P.S. The prototype for set_cookie is:
$cookie_jar->set_cookie($version, $key, $val, $path, $domain, $port, $path_spec, $secure, $maxage, $discard)


avatar
adaliabooks:
Cheers. See above.
Post edited March 16, 2016 by mrkgnao
Try to set $secure to true. Plus - get the cookie after setting it to debug what you have there.

And make sure it's not made for http://www.gog.com but for https://www.gog.com

As last resort - you could use the endpoint I gave in previous post.
Post edited March 16, 2016 by Johny.
avatar
Johny.: Try to set $secure to true. Plus - get the cookie after setting it to debug what you have there.
Did both already.

- Setting $secure didn't change a thing. All it is supposed to do is, if set, prevent sending the cookie on http. If clear, it sends on both http and https.
- Throughout, the cookie remains unaffected. Before and after the get it is, for example:
"Set-Cookie3: gog_lc=US_USD_en; path="/"; domain=.gog.com; port=80; expires="2016-03-17 01:22:03Z"; version=0"
- Moreover, if I do not set the cookie at all, the jar remains empty, i.e. no default cookie arrives from GOG.

All in all, it appears as if the cookie channel is broken in both directions.

P.S. Already tested with https and http.

P.P.S. The endpoint you posted is for changing currency, which I don't need. Is there one for changing country?
Post edited March 16, 2016 by mrkgnao
Talk about "good" news...

Question for Johny.: Would it happen to work for you when you try it from work? Because in that case it may be that it does things differently if they're external requests. Guessing a better way to test would be from home and through a non-Polish proxy?
avatar
Cavalary: Talk about "good" news...

Question for Johny.: Would it happen to work for you when you try it from work? Because in that case it may be that it does things differently if they're external requests. Guessing a better way to test would be from home and through a non-Polish proxy?
The problem is not generalised. If I do the same operations (changing cookie, getting url) from Firefox, it all works ok. Apparently there is something different between the way FF does it and the way MaGog does it, but I have no idea what.
I wish they had left the HTTP link alive and not forced an HTTPS redirect. But I can't complain about GOG here; obviously users asked for it.
high rated
avatar
mrkgnao: The problem is not generalised. If I do the same operations (changing cookie, getting url) from Firefox, it all works ok. Apparently there is something different between the way FF does it and the way MaGog does it, but I have no idea what.
I wish they had left the HTTP link alive and not forced an HTTPS redirect. But I can't complain about GOG here; obviously users asked for it.
Haven't had a chance to get on my computer and check the javascript (though I suspect it may not be any use anyway judging by how you do it)

I don't know perl at all, but a quick read up on your methods and something you've said above might be worth trying.. you say it works fine if you just do it in Firefox so have you tried making LWP fake being Firefox in case it's serving different info based on browser? If you're still getting the data just unaffected by the cookie you've set it may not do any good but possibly worth trying if you haven't already.
high rated
avatar
mrkgnao: The problem is not generalised. If I do the same operations (changing cookie, getting url) from Firefox, it all works ok. Apparently there is something different between the way FF does it and the way MaGog does it, but I have no idea what.
I wish they had left the HTTP link alive and not forced an HTTPS redirect. But I can't complain about GOG here; obviously users asked for it.
avatar
adaliabooks: Haven't had a chance to get on my computer and check the javascript (though I suspect it may not be any use anyway judging by how you do it)

I don't know perl at all, but a quick read up on your methods and something you've said above might be worth trying.. you say it works fine if you just do it in Firefox so have you tried making LWP fake being Firefox in case it's serving different info based on browser? If you're still getting the data just unaffected by the cookie you've set it may not do any good but possibly worth trying if you haven't already.
Cheers.
Already browsed through the manuals for LWP::UserAgent and HTTP::Cookies and tried everything that looked remotely relevant.
Already tried to impersonate a Firefox user agent.
avatar
mrkgnao: Cheers.
Already browsed through the manuals for LWP::UserAgent and HTTP::Cookies and tried everything that looked remotely relevant.
Already tried to impersonate a Firefox user agent.
I thought you probably would have but that it was worth suggesting.

I don't know enough about perl or cookies to really comment but there doesn't seem to be anything wrong with what you are doing (and clearly it was working previously).
Johny, you haven't changed any kind of debugging settings or something have you? I know turning off debugging for Angular meant I had to rework some things to make everything work again...
high rated
Right, I tried to do what your doing from my server to see what happens, but unfortunately given the time I couldn't figure out Perl XD

So I tried the same idea in PHP and it seems to work fine (prices were showing a different region then if I just clicked the link in the forum, now they are showing the same GBP prices after sending the correct cookie).

So it could be to do with your server.. or possibly the fact you aren't on HTTPS?
If that is it you could use LetsEncrypt to secure it for free (as I do), or if all else fails you can tell me what you need and I could build a PHP page on my server that would let you set the cookie you wanted and fetch the page from GoG and pass you the results...

Edit: And as it was fairly trivial to do I've made the page, which seems to work. Not sure how much traffic you would need to send through it and if I could handle it on my hosting package (I imagine it shouldn't be a problem, even with the script stuff on there and my website it doesn't get much traffic), but I'm willing to give it a try if you'd like :)
Post edited March 16, 2016 by adaliabooks
avatar
adaliabooks: So it could be to do with your server.. or possibly the fact you aren't on HTTPS?
Can you explain what you mean by "aren't on HTTPS"?
MaGog is able to read https URLs (e.g. https://www.gog.com/games/ajax/filtered?mediaType=game&page=1&sort=title ). She just get cookieless data. Can one read https URLs without being "on HTTPS"?
Also she has no problem logging in to GOG and accessing my library, all of which is https.
It's just that damn gog_lc cookie which doesn't cross the HTTPS barrier.

Thank you for your offer to serve as a proxy, but it's not practical. We are talking about many hundreds of pages read every six hours (and many thousands on Saturday).
Post edited March 16, 2016 by mrkgnao