Wikipedia-API icon indicating copy to clipboard operation
Wikipedia-API copied to clipboard

hebrew not supported with a passed api key

Open nevakrien opened this issue 2 years ago • 2 comments

wiki_he = wikipediaapi.Wikipedia(language='he',user_agent=user_agent, headers={"Authorization": f"Bearer {secrets2['Access token']}"}) wiki_he.page("אמנות").text

this works for the English equivalent of the page with english as lang

nevakrien avatar Jan 08 '24 18:01 nevakrien

Hi! I got the same problem and fortunately I found a fix!

Despite the documentation in the wikimedia API, they expect {"Authorization": f"{secrets2['Access token']}"}) directly. Note that "Bearer" is not there.

Removing that I got mine working.

irisdominguez avatar Jun 04 '24 18:06 irisdominguez