Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More graceful handling of blocked Curseforge browser downloads #1512

Merged
merged 6 commits into from
Jan 19, 2023

Conversation

Celeo
Copy link
Contributor

@Celeo Celeo commented Jan 16, 2023

Purpose

This PR attempts to more gracefully handle Curseforge blocking automated downloads of mods.

Related: many posts in Discord.

Fixes #1367, #1520.

Approach

If the Electron browser detects an HTTP 403 response from Curseforge, it notifies the webapp of such. Following the (attempted) downloading of all mods, the user is presented with info text and the ability to open the instance's folder. The list of missing mods includes links to download those mods themselves. This bypasses / gets around the automated download protection by (1) using the user's main browser which is more likely to be easily fingerprintable, and (2) allowing the user time to confirm captchas or other human-verification mechanics.

1
2
3

Learning

The issues I faced were mostly to the system I was running on. WSL + VcXsrv is tedious at best, installing Node/Rust/Choco/Python/openssl etc. on Windows didn't go well, so I had to reach for VirtualBox, set up a new graphical install there, and test the code.

The only other thing I'd mention is that there doesn't seem to be hot-module replacement. This may have not been implemented, for any number of reasons, but did slow down development.

@CLAassistant
Copy link

CLAassistant commented Jan 16, 2023

CLA assistant check
All committers have signed the CLA.

@cyraid
Copy link

cyraid commented Jan 17, 2023

Is there anything preventing this Pull Request from being merged? I know someone that's going through that issue, and would be nice to have a way to download the mods manually.

One thing I would suggest is to have a download link on every single item, so you can do it separately. If you have 10 in that list, it'll open up 10 tabs, and could get resource hoggy very fast.

@Celeo
Copy link
Contributor Author

Celeo commented Jan 17, 2023

One thing I would suggest is to have a download link on every single item, so you can do it separately. If you have 10 in that list, it'll open up 10 tabs, and could get resource hoggy very fast.

Good idea, I like that better.

@cyraid
Copy link

cyraid commented Jan 17, 2023

Or the standard download icon on button would probably be nice and GUI friendly. Either way, thank you for the work you're doing. :)

@Celeo
Copy link
Contributor Author

Celeo commented Jan 17, 2023

Updated to use individual download buttons. Also made more resilient. I feel better about this code.

@cyraid
Copy link

cyraid commented Jan 17, 2023

Looking good! :)

@cyraid
Copy link

cyraid commented Jan 17, 2023

Oh, could you (or did you already) implement a verification to check if the mods are there when you hit continue? Just incase someone forgets one by accident. Perhaps a warning and then refreshes the list with the ones that are still missing? Sorry for thinking of this so late. Lol beyond that I can't think of anything else you'd need?

@AshtakaOOf
Copy link

@Celeo could you enable the "edits by maintainers"?

@Celeo
Copy link
Contributor Author

Celeo commented Jan 17, 2023

I think it has been.

image

@Eskaan
Copy link
Collaborator

Eskaan commented Jan 19, 2023

I cannot reproduce the cloudflare issue returning a 403, it just gets stuck in a download loop until the timeout.
Maybe you could change your code to be called from the cleanupFn and reduce the timeout to just a minute?

@Celeo
Copy link
Contributor Author

Celeo commented Jan 19, 2023

Agreed; I'm no longer getting the 403s when the Curseforge verification page is shown.

EDIT: now it's 503.

EDIT: the responseHeaders include "cloudflare" in the server field, but that seems to be regardless of whether or not the user is sent to the Cloudflare verification page or the actual site.

@Eskaan Eskaan linked an issue Jan 19, 2023 that may be closed by this pull request
@Celeo
Copy link
Contributor Author

Celeo commented Jan 19, 2023

I've pushed an improvement to the detection.

@Eskaan
Copy link
Collaborator

Eskaan commented Jan 19, 2023

LGTM. Maybe in the future someone wants to implement an addition so downloaded mods get removed from the manual list.

@Eskaan Eskaan merged commit a8dfa1c into gorilla-devs:master Jan 19, 2023
@Celeo Celeo deleted the handle-cloudflare branch January 19, 2023 18:53
Eskaan pushed a commit to Eskaan/GDLauncher that referenced this pull request Nov 15, 2023
…l downloading) (gorilla-devs#1512)

* Switch to individual download buttons

* Improve Cloudflare detection
Eskaan pushed a commit to Eskaan/GDLauncher that referenced this pull request Nov 17, 2023
…l downloading) (gorilla-devs#1512)

* Switch to individual download buttons

* Improve Cloudflare detection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

[Enhancement] Manual Download Inapp browser mod downloading stopped by Cloudflare
5 participants