Hello, I try to add a support to Lingua Libre (https://lingualibre.org) in Pywikibot but I cannot figure out how to connect to the website to be able to edit (the current support of Lingua Libre in PWB allows to "read" Lingua Libre, not to "edit"). The problem is the way to log in is quit unusual. Normal user who wants to log in on Lingua Libre, has to log in on Wikimedia Commons via OAuth (you can see cliking on https://lingualibre.org/index.php?title=Special:UserLogin&returnto=Lingu... )
And it makes me completely lost about the way to log in a bot with such system.
Here is the ouput of python pwb.py login -v (I try to log in with my user account to check) with this content in user-config.py
family = 'lingualibre' mylang = 'lingualibre' usernames['lingualibre']['lingualibre'] = 'Pamputt'
Python 3.8.9 (default, Apr 5 2021, 18:09:13) [GCC 10.2.1 20210130] Found 1 lingualibre:lingualibre processes running, including this one. WARNING: No user is logged in on site lingualibre:lingualibre Password for user Pamputt on lingualibre:lingualibre (no characters will be shown): Logging in to lingualibre:lingualibre as Pamputt WARNING: API warning (main): Unrecognized parameters: username, password. ERROR: Login failed (FAIL). Traceback (most recent call last): File "/home/pamputt/bot/core/pywikibot/login.py", line 307, in login self.login_to_site() File "/home/pamputt/bot/core/pywikibot/data/api.py", line 2968, in login_to_site raise pywikibot.exceptions.APIError(code=status, info=fail_reason) pywikibot.exceptions.APIError: FAIL: The supplied credentials could not be authenticated.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "pwb.py", line 399, in <module> if not main(): File "pwb.py", line 391, in main run_python_file(filename, File "pwb.py", line 106, in run_python_file exec(compile(source, filename, 'exec', dont_inherit=True), File "./scripts/login.py", line 151, in <module> main() File "./scripts/login.py", line 139, in main site.login(autocreate=autocreate) File "/home/pamputt/bot/core/pywikibot/site/_apisite.py", line 390, in login if login_manager.login(retry=True, autocreate=autocreate): File "/home/pamputt/bot/core/pywikibot/login.py", line 316, in login raise NoUsernameError(error_msg) pywikibot.exceptions.NoUsernameError: Username "Pamputt" does not have read permissions on lingualibre:lingualibre .The supplied credentials could not be authenticated.
You can also have a look at https://lingualibre.org/api.php?action=query&meta=authmanagerinfo&am... to see that direct authentication are forbidden ("canauthenticatenow": "")
So, is anyone know how to log in with such authentication system (I am completely lost with OAuth). Thanks in advance Pamputt
pywikibot supports authentication using Extension:OAuth (authenticating directly to the wiki), but I don't think it supports Extesnion:OAuthAuthentication (authenticating to another wiki). It does appear that BotPasswords are enabled on Lingua Libre (https://lingualibre.org/wiki/Special:BotPasswords), so I'd suggest trying that. For more information see https://www.mediawiki.org/wiki/Manual:Pywikibot/BotPasswords.
On Tue, Jul 13, 2021 at 4:15 PM pamputt pamputt0@gmail.com wrote:
Hello, I try to add a support to Lingua Libre (https://lingualibre.org) in Pywikibot but I cannot figure out how to connect to the website to be able to edit (the current support of Lingua Libre in PWB allows to "read" Lingua Libre, not to "edit"). The problem is the way to log in is quit unusual. Normal user who wants to log in on Lingua Libre, has to log in on Wikimedia Commons via OAuth (you can see cliking on https://lingualibre.org/index.php?title=Special:UserLogin&returnto=Lingu... )
And it makes me completely lost about the way to log in a bot with such system.
Here is the ouput of python pwb.py login -v (I try to log in with my user account to check) with this content in user-config.py
family = 'lingualibre' mylang = 'lingualibre' usernames['lingualibre']['lingualibre'] = 'Pamputt'
Python 3.8.9 (default, Apr 5 2021, 18:09:13) [GCC 10.2.1 20210130] Found 1 lingualibre:lingualibre processes running, including this one. WARNING: No user is logged in on site lingualibre:lingualibre Password for user Pamputt on lingualibre:lingualibre (no characters will be shown): Logging in to lingualibre:lingualibre as Pamputt WARNING: API warning (main): Unrecognized parameters: username, password. ERROR: Login failed (FAIL). Traceback (most recent call last): File "/home/pamputt/bot/core/pywikibot/login.py", line 307, in login self.login_to_site() File "/home/pamputt/bot/core/pywikibot/data/api.py", line 2968, in login_to_site raise pywikibot.exceptions.APIError(code=status, info=fail_reason) pywikibot.exceptions.APIError: FAIL: The supplied credentials could not be authenticated.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "pwb.py", line 399, in <module> if not main(): File "pwb.py", line 391, in main run_python_file(filename, File "pwb.py", line 106, in run_python_file exec(compile(source, filename, 'exec', dont_inherit=True), File "./scripts/login.py", line 151, in <module> main() File "./scripts/login.py", line 139, in main site.login(autocreate=autocreate) File "/home/pamputt/bot/core/pywikibot/site/_apisite.py", line 390, in login if login_manager.login(retry=True, autocreate=autocreate): File "/home/pamputt/bot/core/pywikibot/login.py", line 316, in login raise NoUsernameError(error_msg) pywikibot.exceptions.NoUsernameError: Username "Pamputt" does not have read permissions on lingualibre:lingualibre .The supplied credentials could not be authenticated.
You can also have a look at https://lingualibre.org/api.php?action=query&meta=authmanagerinfo&am... to see that direct authentication are forbidden ("canauthenticatenow": "")
So, is anyone know how to log in with such authentication system (I am completely lost with OAuth). Thanks in advance Pamputt _______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.org To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org