JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 24.04.2017, 00:24
hplagoon
Guest
 
Posts: n/a
Default 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!
Reply With Quote
  #2  
Old 24.04.2017, 11:12
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

Please send example links and username/password to support@jdownloader.org so we can check it
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 24.04.2017, 11:12
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

No changes in JDownloader since 13.10.2016. So must be something on their side.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #4  
Old 24.04.2017, 11:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 25.04.2017, 10:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

Please contact CheapCaptcha Support about this.
Their server responds with
"Cannot process request at this moment. Try again later!"
__________________
JD-Dev & Server-Admin
Reply With Quote
  #6  
Old 20.07.2017, 10:56
Joey_G
Guest
 
Posts: n/a
Default

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--
If I leave 'filename="image.jpg"' or use base64 string it doesn't work. Can you please check the PlugIn?

Last edited by raztoki; 20.07.2017 at 11:59.
Reply With Quote
  #7  
Old 20.07.2017, 10:59
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

What shall we check? We use their api and it responds with error.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #8  
Old 20.07.2017, 11:46
Joey_G
Guest
 
Posts: n/a
Default

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;
    }
I can clearly see the filename property, that is missing in the wireshark capture. So I assume you do not use the actual API. Can you update this?

Last edited by raztoki; 20.07.2017 at 11:59.
Reply With Quote
  #9  
Old 20.07.2017, 12:02
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,614
Default

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.
Reply With Quote
  #10  
Old 20.07.2017, 12:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

JDownloader uses the captchafile with base64, there is no filename for that
__________________
JD-Dev & Server-Admin
Reply With Quote
  #11  
Old 24.07.2017, 16:55
eagleg eagleg is offline
Tornado
 
Join Date: Apr 2016
Posts: 237
Default

thought it was solved
Reply With Quote
  #12  
Old 24.07.2017, 17:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

Does it work (more reliable) with your upload method?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #13  
Old 25.07.2017, 13:45
Joey_G
Guest
 
Posts: n/a
Default

Yes, it does work with my method.
Reply With Quote
  #14  
Old 26.07.2017, 13:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

With next core update, your upload method will be used. Please provide feedback then
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 00:05.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.