sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
951 stars 405 forks source link

wikipedia: fix urlparse usage & handle Special: namespace #2575

Closed SnoopJ closed 7 months ago

SnoopJ commented 7 months ago

Description

Closes #2573.

This changeset corrects errant usage of urllib.parse.urlparse() in the wikipedia plugin, fixing a regression introduced by #2414. This fix prevents namespaces from being erroneously discarded.

In the process of this fix, I discovered that the Special:* namespace is a special case as far as the MediaWiki API is concerned, queries to the API for pages in this namespace don't do what you might expect, so these pages cannot be located and turned into snippets for IRC. So, instead, the URL rule ignores these pages, and issues a specific explanation if a user tries to query them using a command.

Checklist