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

Fix download from sourceforge (and possibly many others) #830

Merged
merged 1 commit into from
Jul 16, 2023

Conversation

misl6
Copy link
Member

@misl6 misl6 commented Jul 16, 2023

Sourceforge (and possibly many others) website is showing an intermediate waiting page when the user agent can handle it.

Instead, by using Wget/1.0 as user agent, the redirect to the appropriate mirror works fine.

This code is taken from python-for-android, which had a similar issue with liblzma.

... 💬 would be nice to have a utils library to share against python-for-android and kivy-ios in order to avoid duplicate effort.

Additionally: FancyURLopener has been deprecated in 3.3, and I guess it will be removed soon?

@misl6
Copy link
Member Author

misl6 commented Jul 16, 2023

@AndreMiras let's see what the CI thinks about it, but that's what I was talking about in #827 (comment).

Do you recall why we faked the User Agent previously?

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall why we used it for kivy-ios, it was introduced pretty early it seems, see 577dea0
For p4a I recall something, where some recipes downloads where returning some 403 or something as if the original python requests user agent was blocked, maybe that issue for instance kivy/python-for-android#2418
But let's give it a try with this PR and if it breaks other recipes, we could get different types of user agents for the recipes that break

@misl6 misl6 merged commit f10918c into kivy:master Jul 16, 2023
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants