Page MenuHomePhabricator

Captcha support broken
Closed, ResolvedPublic

Description

After logging out first..

valhallasw@lisilwen:~/src/pwb/pywikibot-compat$ python login.py
Password for user valhallasw on wikipedia:nl
No characters will be shown:
Logging in to wikipedia:nl as valhallasw via API.
Login failed. Wrong password or CAPTCHA answer?
API login failed, retrying using standard webpage.
Logging in to wikipedia:nl as valhallasw
What is the answer to the captcha "CAPTCHA: " ?

Instead of showing the captcha URL, the above is shown, which obviously makes solving the captcha hard.


Version: compat-(1.0)
Severity: major

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:26 AM
bzimport set Reference to bz58546.
bzimport added a subscriber: Unknown Object (????).

This is with the following user-config.py:

mylang = 'nl'
family = 'wikipedia'
usernames['wikipedia']['nl'] = 'valhallasw'
usernames['commons']['commons'] = 'valhallasw'

and

valhallasw@lisilwen:~/src/pwb/pywikibot-compat$ python version.py
Pywikibot: [https] r/pywikibot/co (r10583, 87d627f, 2013/12/09, 22:32:42, OUTDATED)
Release version: 1.0b1
Python: 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3]
config-settings:
use_api = True
use_api_login = True
unicode test: ok

after a few wrong password attempts.

Aklapper lowered the priority of this task from High to Lowest.Jun 5 2015, 1:41 PM
Aklapper subscribed.

Pywikibot has two versions: Compat and Core. This task was filed about the older version, called Pywikibot-compat, which is not under active development anymore. Hence I'm lowering the priority of this task to reflect the reality. Unfortunately, the Pywikibot team does not have the manpower to retest every single bug report / feature request against the (maintained) Pywikibot code base. Furthermore, the code base of Pywikibot-Compat has changed a lot compared to the code base of Pywikibot-Core so there is a chance that the problem described in this task might not exist anymore. Please help: Unfortunately manpower is limited and does not allow testing every single reported task again. If you have time and interest in Pywikibot, please upgrade to Pywikibot-Core and add a comment to this task if the problem in this task still happens in Pywikibot-Core (or directly edit the task by removing the Pywikibot-compat project and adding the Pywikibot project to this task). To learn more about Pywikibot and to get involved in its development, please check out https://www.mediawiki.org/wiki/Manual:Pywikibot/Development Thank you for your understanding.

jayvdb set Security to None.

Wikimedia configuration may have changed but ... when trying to reproduce this with core, as the login code doesnt appear to support CAPTCHA at all, I cant get a response that wants a CAPTCHA.

The core code doesnt appear to support this, but currently Wikimedia sites API are falling back to Throttling even when Captcha is enabled.
If anyone has a site where API login uses Captcha, add a comment and increase the priority to Low. (this only affects failed logins, which are very preventable ;-) )

binbot raised the priority of this task from Lowest to Low.Aug 25 2016, 5:55 PM
binbot subscribed.

The problem definitely exists. I stull cannot log in with my admin account on huwikipedia.
I do nned the bot to delete plenty of pages, but I can't.
It is a shame that compat users are handled as secondary despite the fact that everyone knows, that core does not have a full functionality.

In core, this issue should be solved with the introduction of BotPasswords (which should not trigger captchas).

With respect to compat vs core: I think you will have a bigger chance of finding someone to implement whatever is missing in delete.py in core than finding someone who is interested in debugging an issue with compat handling. Remember: developers are volunteers, and they are allowed to choose how they spend their time.

Merlijn: the real problem is that on one side developers say "no, nobody declared that core has to implement full funcionality of compat" and on the other side compat issues are automatically set to lowest priority.

I translate this to human language: whoever needs to use compat, because the core does not implement a functionality, should better go and hang himself on the first tree.

No-one is suggesting anyone hangs themselves, and I would appreciate it if you don't make such implications.

Once more: developers are volunteers, and they are free to choose how they spend their time. They are free to write new stuff they are interested in, they are free to set their own targets, and they are free to drop support for stuff they are no longer interested in.

At the same time, you are free to choose to not use core, and you are free to fix the bugs you are encountering in compat (or convincing/paying someone to do so for you). You are just missing out on the updates that go into core.

Dear Merlijn

I am sad to remind you that Pywikibot is full of my contributions and bug fixes, even with whole new scripts written by me.
We discussed hundred times on the mailing list, how we fell out of developing at the git/Bugzilla catastrophe. (Not only me, but a few other goood guys.)
So the last thing I need to spoon-feed me every 5 minutes what a developer is.
Thank you.

The fixes I needed to apply to get pywikibot automatically solving captchas for Haskellwiki are here: https://github.com/ysangkok/fix-wiki-links/blob/master/insc.py#L11

They involve matching captcha type "simple" instead of "math", using ast.literal_eval and replacing a unicode minus with a minus that literal_eval can execute.

If you are going to submit a patch with the fix (plus possibly tests), it will be appreciated.
You can also use https://tools.wmflabs.org/gerrit-patch-uploader/ in case you do not want to go through the standard process (git/gerrit).

Change 572204 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Add captcha support for "simple" type

https://gerrit.wikimedia.org/r/572204

@JanusTroelsen: see comment at gerrit patch. Any further ideas?

@Xqt looks great, thanks! I think the automatic solving could still be done by e.g. a regex parser and a manual interpreter, but that can go in another PR I guess.

Change 572204 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Add captcha support for "simple" type

https://gerrit.wikimedia.org/r/572204

Xqt claimed this task.