UncleGoogle / galaxy-integration-humblebundle

Humble Bundle integration for GOG Galaxy 2.0
GNU General Public License v3.0
188 stars 18 forks source link

Unable to download any DRM-free game from within Galaxy #94

Closed MarkoH01 closed 4 years ago

MarkoH01 commented 4 years ago

Describe the bug I am simply unable to download any DRM-free humble game from within Galaxy. The browser opens and shows a URL but does nothing. Downloading directly from the web site still works fine.

Expected behavior Opening browser with the correct URL to download the game.

Plugin installed manually from your repository releases

I tried this with Waterfox (Firefox fork) and Internet Explorer. Waterfox simply did nothing, internet explorer told me that I had to be logged in (which I was).

Provide logs

logs.zip

UncleGoogle commented 4 years ago

The browser opens and shows a URL but does nothing.

Can you provide an example of URL? (replace gamekey with *** if there is such in the link) I cannot reproduce the problem with games I have in my library.

For me the plugin opens default browser on the URL that is provided by Humble API. This should be exactly the same as via humblebundle.com. Then a new tab is opened and quickly closed just after the browser starts download.

EDIT I've just investigate humble download on Shelter example and and I see a POST to /humbler/redeemdownload instead of simple GET with API url download link. But still - it works for me. Maybe you have to download from the site at least once and then you can do it via plugin? Can you check, please?

MarkoH01 commented 4 years ago

I tried "The Silent Age" - it opens my browser at the following URL https://dl.humble.com/tsa_pc_drm_free_1456167649.zip?gamekey=*******&ttl=1586012634&t=557de1ea1d7f042902b7b4805259d225 But then it does nothing.

Unfortunately I cannot see the working link. If I select download manually in my humble library it simply downloads the file without showing the URL - so I cannot compare.

MarkoH01 commented 4 years ago

Just downloaded via website and tried the download afterwards with Galaxy - same problem. URL is not working. Firefox is saying nothing while IE is saying that the site is forbidden (403 error).

UncleGoogle commented 4 years ago

Thanks for checking. It may be related to #71

MarkoH01 commented 4 years ago

Yes, that sounds similar. Is there a way to view the URL humble is using on their web site? In that case I could compare the URL created by your script and the URL I access manually. It was possible before they redesigned their web site but it does not seem to be possible anymore.

UncleGoogle commented 4 years ago

You can open devtools (ctrl+shift+I or similar depending on browser), then go to Network section and then click on download button. I see that it does not open the same URL anymore, but does POST to /humbler/redeemdownload but maybe not every game - you can check. Anyway, many humble downloaders projects rely on URL from API so it should be doable somehow.

MarkoH01 commented 4 years ago

That helped and now I can tell you the difference between the URLs (for Silent Age) - I just replaced the part of the gamekey that's the same in script and web site.

Web Site (working): https://dl.humble.com/tsa_pc_drm_free_1456167649.zip?gamekey=SAME&ttl=1586897526&t=53dedeb1e54e6dea5a3ebd1aa085fb74

Script (not working): https://dl.humble.com/tsa_pc_drm_free_1456167649.zip?gamekey=SAME&ttl=1586012634&t=557de1ea1d7f042902b7b4805259d225

Maybe this helps.

I will try other games as well, but every game I tried so far did not work.

MarkoH01 commented 4 years ago

It really seems to be every game (stopped testing at 20 games) and only the ttl and t parameters are different - the gamekey is correct.

UncleGoogle commented 4 years ago

Can you disconnect and connect plugin and then try again?

I'm caching API responses - probably I should not as apparently download links are dynamic and generated for 24h or so (judging by ttl timestamp value)

UncleGoogle commented 4 years ago

Another thing to check if previous still does not work:

MarkoH01 commented 4 years ago

Sorry, but I have no idea how to get where you want me to go. I was able to see the download URL by chosing network but if I click the tab "response" (like in your screenshot) it shows a really long string with many characters that is not helpful.

Also tried to disconnect and reconnect the plugin again - did not help.

UncleGoogle commented 4 years ago

Hey, I'm sorry for poor explanation.

You can go directly to https://www.humblebundle.com/api/v1/order/YOUR_ORDER_NUMBER?all_tpkds=true

replacing YOUR_ORDER_NUMBER with gamekey your have hide in this post https://github.com/UncleGoogle/galaxy-integration-humblebundle/issues/94#issuecomment-613359911

And then find "web" url for downloading the game. If this link works, the version of plugin below should also works (I hope):

humblebundle_0.7.1-subprod_download_fix.zip Installation:

I would be grateful for testing as I cannot reproduce from my side

MarkoH01 commented 4 years ago

IT WORKS!

Thank you, man. This fixed the issue and I tried with several games. Might have also fixed the Trove issue (cannot test since I don't have Trove anymore).

UncleGoogle commented 4 years ago

Good to hear! I think I need bigger refactor, as my former assumptions for cache were wrong. Or just release it as a workaround. Trove won't work in this version, but this should be analogous.

UncleGoogle commented 4 years ago

Above fix will be included in the next release after 0.7.1. Maybe 0.8.0

Bertaz commented 4 years ago

You can go directly to https://www.humblebundle.com/api/v1/order/YOUR_ORDER_NUMBER?all_tpkds=true

replacing YOUR_ORDER_NUMBER with gamekey your have hide in this post #94 (comment)

And then find "web" url for downloading the game. If this link works, the version of plugin below should also works (I hope):

Hi just saw this. I tested it too and the links work, but are different from the one in post https://github.com/UncleGoogle/galaxy-integration-humblebundle/issues/71#issuecomment-619017210 BTW if I bought a game inside a bundle that page with the order number returns all the games inside. Is it a problem?

humblebundle_0.7.1-subprod_download_fix.zip I would be grateful for testing as I cannot reproduce from my side

For the drm-free games it works, but the links are different from the web ones. They have the gamekey parameter, not the key one. Also if I select drm-free in the config (alone or with trove and keys) it works showing only drm-free games. If I select trove or trove and keys the plugin crashes and show no games. If I select only keys it doesn't crash but show no games

Logs: humbleIntegrationLogs.7z.zip (can't upload on github .7z files, just rename it)