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: error 403 on media from wikimedia #276

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

lpofredc
Copy link

Le chargement des médias issus de WikiMedia échoue avec une erreur 403:

Error: 403, Forbidden. Please comply with the User-Agent policy: https://meta.wikimedia.org/wiki/User-Agent_policy at Thu, 12 Aug 2021 09:18:51 GMT

générant une erreur lors du chargement de l'image par API, ex:
https://demo.geonature.fr/taxhub/api/tmedias/thumbnail/4?h=80&v=80

{"id_media": 4, "message": "UnidentifiedImageError('cannot identify image file <_io.BytesIO object at 0x7f5bdc739d00>',)", "success": false}

Cette PR ajoute un user-agent générique aux requêtes de la fonction url_to_image.

{'user-agent': 'TaxHub/1.8.1 (https://github.com/PnX-SI/TaxHub) python-requests/2.26.0'}

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