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

Download URL is None on a very specfic mod #13

Closed
Advik-B opened this issue Nov 23, 2022 · 2 comments
Closed

Download URL is None on a very specfic mod #13

Advik-B opened this issue Nov 23, 2022 · 2 comments

Comments

@Advik-B
Copy link
Contributor

Advik-B commented Nov 23, 2022

from cursepy import CurseClient
from v import api_key

c = CurseClient(api_key)
game = c.game(432) # Minecraft
addon = c.addon(400012) # Ex Nihilo: Sequentia

for file in addon.files():  # type: ignore
    print(file.download_url)

Screenshot 2022-11-23 at 9 25 55 PM

@OwenCochell
Copy link
Owner

Hey, thank you for reporting this issue!

This is a tricky problem. After messing around a bit, it appears the Curse Forge is serving 'None' for for the download URL. I suspect this is because the mod has not been approved for distribution outside of the official curseforge ecosystem. The mode developer can choose weather their mod is approved on the 'creator dashboard', so maybe the mod you ran into has this disabled. You can read about this here. I couldn't find anything in the official documentation, and I don't have access to any 'creator dashboard', but i'm pretty sure this is the issue.

However, there may be a solution. I believe we can create a download link using the information provided. I'll play around with my idea and see how it works large scale. If I get something workable i'll post my methods here, and update the library with this fix. Hopefully I can get this out today or tomorrow.

Thanks!

@OwenCochell
Copy link
Owner

In the latest cursepy version, 2.2.0, the CurseFile class can now generate a guess download URL using the guess_download() method. From my testing, this URL seems to work fine, and can download the associated files. This creates a URL to the CurseForge CDN, which is likely what most people want. You can read up on the updated documentation for more info on this method and how to use it.

Again, this feature has not been tested very well! The addition works for the addon you specified, but it is unknown weather it will work for other addons. Please let me know if you run into any issues with this, so we can fine tune this feature.

Thanks again for reporting this! If this does not work then please let me know, otherwise we can close this issue.

@Advik-B Advik-B closed this as completed Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants