This repository was archived by the owner on Aug 11, 2025. It is now read-only.
Description Trying to source logos for example from wikipedia can run into:
requests.exceptions.HTTPError: 403 Client Error: Forbidden. Please comply with the User-Agent policy: https://meta.wikimedia.org/wiki/User-Agent_policy
Which states that there must be user-agent information or scripts may be blocked without notice. The expected format is
< client name > / < version > (< contact information > ) < library / framework name > / < version > [< library name > / < version > ...]
They provide a template for python:
import requests
url = 'https://example/...'
headers = {'User-Agent' : 'CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org)' }
response = requests .get (url , headers = headers )
Suggestions:
Add standard header like {'User-Agent': 'pybadges/3.0.0 (https://github.com/google/pybadges/)}
And/Or add --user-agent option to allow passing this information manually.
Reactions are currently unavailable
Trying to source logos for example from wikipedia can run into:
Which states that there must be user-agent information or scripts may be blocked without notice. The expected format is
They provide a template for python:
Suggestions:
{'User-Agent': 'pybadges/3.0.0 (https://github.com/google/pybadges/)}--user-agentoption to allow passing this information manually.