eldur / jwbf

Java Wiki Bot Framework is a library to maintain Wikis like Wikipedia based on MediaWiki.
http://jwbf.sourceforge.net/
Apache License 2.0
78 stars 33 forks source link

React on <edit result="Failure"> #37

Open croesch opened 9 years ago

croesch commented 9 years ago

First of all, nice framework! It's simple and cool to use..

Yesterday I spent my whole evening figuring out why the heck I couldn't post some changes to a wiki. Today I analysed the packages sent over the line and found this:

<api><edit result="Failure"><captcha type="image" mime="image/png" id="1178352419" url="/w/index.php?title=Spezial:Captcha/image&amp;wpCaptchaId=1178352419" /></edit></api>

It would be really helpful if jwbf would react on that with an exception or at least a log message!

croesch commented 9 years ago

If necessary I can provide the traffic for a good and for a bad commit. But only if needed..

eldur commented 9 years ago

Thanks.

It looks that it is related to an extension (something with a captcha). Do you know the extension (Special:Version)?

Request url and response pairs of a valid and problematic action would be appreciated (if possible json and xml). If there are no proper logger to get this information, we should define one first (working with package analyzer feels wrong).

croesch commented 9 years ago

Extension seems to be ConfirmEdit 1.3 (4d239e5) 23:26, 4. Nov. 2014

It's de.wiktionary.org and I found that it occurs when you try to add a new external link on a page e.g. (on this wiki) via the template {{Ref-.*}}. So request URL and Response URL is the same for a valid and a problematic action.

It seems that it is related to use a new user on that particular wiki. So if you haven't been active on that wiki, it might occur immediately when inserting a link on a test page. The CAPTCHA also occurs when editing the page manually with the same content as sending with jwbf. So it might be easy to reproduce if you have a user that leads to CAPTCHAs being displayed.

Is this sufficient or can I help you with further information?