#1
|
|||
|
|||
Cheap Captcha plugin not working
I'm trying to use my Cheap Captcha account with Jdownloader, but I'm having some issues. Jdownloader can connect to my account (I can see my username and credit balance in the bottom left hand corner), but whenever it tries to send a captcha to the Cheap Captcha service, it says "No Answer!". This message pops up immediately after the normal countown period; there is no waiting period once the captcha is sent to Cheap Captcha indicating that there is some technical glitch and not merely a time out.
If any more specific information is needed, please let me know! |
#2
|
||||
|
||||
Please send example links and username/password to support@jdownloader.org so we can check it
__________________
JD-Dev & Server-Admin |
#3
|
||||
|
||||
No changes in JDownloader since 13.10.2016. So must be something on their side.
__________________
JD-Dev & Server-Admin |
#4
|
||||
|
||||
__________________
JD-Dev & Server-Admin |
#5
|
||||
|
||||
Please contact CheapCaptcha Support about this.
Their server responds with "Cannot process request at this moment. Try again later!"
__________________
JD-Dev & Server-Admin |
#6
|
|||
|
|||
I got the same issue with the Cheap Captcha PlugIn. So I tested some scenarios with their API. I found out, that the server answers with "Cannot process request at this moment. Try again later!" even if the data provided is not correctly formatted.
I did some wireshark-captures of the POST request JDownloader does the following (without success; data shortened): Code:
---------------------533231264343642 Content-Disposition: form-data; name="username" %USERNAME ---------------------533231264343642 Content-Disposition: form-data; name="password" %PASSWORD ---------------------533231264343642 Content-Disposition: form-data; name="captchafile" base64:iVBORw0... ---------------------533231264343642-- I created a POST request by myself (working): --5830f348-6f4b-4358-a18a-c0da69218359 Content-Type: text/plain; charset=utf-8 Content-Disposition: form-data; name="username" %USERNAME --5830f348-6f4b-4358-a18a-c0da69218359 Content-Type: text/plain; charset=utf-8 Content-Disposition: form-data; name="password" %PASSWORD --5830f348-6f4b-4358-a18a-c0da69218359 Content-Disposition: form-data; name="captchafile"; filename="image.jpg"; filename*=utf-8''%22image.jpg%22 JFIF``C C2" }!1A... --5830f348-6f4b-4358-a18a-c0da69218359-- Last edited by raztoki; 20.07.2017 at 11:59. |
#7
|
||||
|
||||
What shall we check? We use their api and it responds with error.
__________________
JD-Dev & Server-Admin |
#8
|
|||
|
|||
I checked the API for java. The method for uploading is the following:
Code:
public static String UploadCaptcha(String username, String password, String image_filename) throws Exception /** * function to upload captcha * returns captcha status as url-encoded query string of parameters */ { File file = new File(image_filename); byte[] image_data = new byte[(int) file.length()]; DataInputStream dis = new DataInputStream(new FileInputStream(file)); dis.readFully(image_data); dis.close(); int image_size = image_data.length; String url = String.format("**External links are only visible to Support Staff**, API_HOST); URL obj = new URL(url); URLConnection con = (URLConnection) obj.openConnection(); con.setDoOutput(true); String boundary = String.format("%s", System.currentTimeMillis() / 1000l); con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); String newline = "\r\n"; String template = newline + "--"+boundary + newline + "Content-Disposition: form-data; name="username""+newline+ ""+newline+ username+newline+ "--"+boundary+newline+ "Content-Disposition: form-data; name="password""+newline+ newline+ password + newline + "--" + boundary + newline + "Content-Disposition: form-data; name="captchafile"; filename="image.jpg"" + newline+ "Content-Type: image/jpeg" + newline+ "Content-Length: "+String.format("%s",image_size)+newline+ newline; DataOutputStream wr = new DataOutputStream(con.getOutputStream()); wr.writeBytes(template); wr.write(image_data, 0, image_size); wr.writeBytes(String.format("\r\n--%s--",boundary)); wr.flush(); wr.close(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); String str_response = response.toString(); return str_response; } Last edited by raztoki; 20.07.2017 at 11:59. |
#9
|
||||
|
||||
we do not use there provided examples, as it doesn't apply to JDownloader backend.
if you want to check the source code, its located at org.jdownloader.captcha.v2.solver.cheapcaptcha.CheapCaptchaSolver raztoki
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] Last edited by Jiaz; 20.07.2017 at 12:10. |
#10
|
||||
|
||||
JDownloader uses the captchafile with base64, there is no filename for that
__________________
JD-Dev & Server-Admin |
#11
|
|||
|
|||
thought it was solved
|
#12
|
||||
|
||||
Does it work (more reliable) with your upload method?
__________________
JD-Dev & Server-Admin |
#13
|
|||
|
|||
Yes, it does work with my method.
|
#14
|
||||
|
||||
With next core update, your upload method will be used. Please provide feedback then
__________________
JD-Dev & Server-Admin |
|
|