funcaptcha icon indicating copy to clipboard operation
funcaptcha copied to clipboard

send answer problem

Open ItMan2056 opened this issue 2 years ago • 11 comments

hi noahcoolboy I have problem with sending answer bigger than 5 like some challenge have bigger answer could you tell me how could I solve this problem? when answering bigger than 5 I get error like this: This captcha answer is 8: 468755 Index must be between 0 and 5 challenge.js:160 Assertion failed: Index must be between 0 and 5 Thanks

ItMan2056 avatar Oct 08 '23 17:10 ItMan2056

Thank you for your report, this seems like a possible issue in the library. Would you mind providing the data object so I can further look into the problem? You can get it with Challenge.data

noahcoolboy avatar Oct 08 '23 19:10 noahcoolboy

Thanks for response. { session_token: '829178c39f974a165.8613351905', challengeID: '1936523091934d736.8926001305', challengeURL: 'https://roblox-api.arkoselabs.com/fc/assets/match-game-ui/0.33.0/standard/index.html', audio_challenge_urls: null, audio_game_rate_limited: null, sec: 20, end_url: null, game_data: { display_fc_welldone: false, final_challenge_text: '', customGUI: { example_images: [Object], _challenge_imgs: [Array], _final_chal_lang_key: 'touch_done_info_colour', _disableFinalChalAfterSecChal: 1, fc2_rotate_stroke: 0, _guiProgressColorSecondary: '#edf0f5', _guiTaper: 0, _meta_bg_colour: '#ffffff', _guiBGColorMain: '#ffffff', fc2_button_small: 1, _guiInfoText: '#000000', _guiTextColor: '#000000', _landingTextColor: '#000000', _guiNoShadow: 1, _guiProgressTextColor: '#000000', _guiTheme: 3, _guiProgressColorMain: '#edf0f5', fc2_button_taper: 0, fc2_text_bg: '#edf0f5', _guiColorMain: '#ffffff', _meta_icon_colour: '#757575', _guiNoInfoBG: 1, fc2_stroke_colour: '#000000', fc2_button_border_thickness: '1', fc2_rotate_bg: 0, _guiNoOutline: 1, fc2_stroke_size: 1, _intro_game_bg: 0, fc2_button_font_size: 17, _guiColorSecondary: '#ffffff', fc2_button_text_colour: '#000000', _guiBGColorSecondary: '#ffffff', _meta_theme: 3, _guiLoaderColor: '#000000', watermark_not_for_public: 0, api_breaker: 'method_3', api_breaker_v2_enabled: 1, _final_ball: null, _app_bg: 'https://roblox-api.arkoselabs.com/cdn/fc/assets/graphics/funcaptcha/004/white.png', _end_banner: 'https://roblox-api.arkoselabs.com/cdn/fc/apps/canvas/victory_generic.jpg', embedded_session_id_enabled: 1, audio_disabled: false }, waves: 2, instruction_string: 'train_coordinates', game_difficulty: 9, answer_width: 200, answer_height: 200, key_width: 125, key_height: 200, puzzle_name: 'Train Coordinates Icons', feature_game4_at_availability: true, gameType: 4 }, game_sid: 'eu-west-1', sid: 'eu-west-1', lang: 'en', string_table_prefixes: [], string_table: { 'meta.help': 'Get answers to your questions', '4.game_progress': '{{currentChallenge}} of {{numChallenges}}', '4.key_image_annotation': 'Match This!', 'meta.audio_info_play-3': 'Press Play, type the number of the song that is the most sad, then press enter:', 'meta.text_info': 'Enter the text you see:', 'meta.footer_general_info': 'Play like humans do.', '4.fail_info_timed_top': 'That was not quite fast enough.', 'meta.audio_info_ctrl': 'Press CTRL to play again.', 'meta.star_info': 'Stars you have earned', 'meta.visual_version': 'Change to a visual challenge', 'aria.tick_icon_alt': 'Example for correct answer.', 'meta.audio_sending_answer': 'Committing your answer. Please wait...', 'game_meta.seconds': 'seconds', 'meta.audio_play_again': 'Play sound again', 'meta.audio_please_download_info': 'Please download and listen to the sound, then type what you heard:', 'meta.audio_info': 'Enter the numbers you hear:', 'meta.session_timeout': 'The connection to a verification server was interrupted. Please refresh this page to try again.', 'meta.audio_info_play': 'Press Play and type what you hear:', 'meta.footer_finished_info-1': "

Verification complete!

You've proven you're a human.

Continue your action.

", 'meta.footer_finished_info-3': "Verification complete!
You've proven you're a human.
Continue your action.", '4.fail_button': 'Try again', 'meta.audio_play_button': 'Play', '4.interstitial_progress_2': '{{currentChallenge}} of {{numChallenges}}', '4.interstitial_progress_1': '{{currentChallenge}} done', 'aria.correct_image_alt': 'Example for correct answer.', 'meta.audio_new_puzzle': 'Start over with a different challenge', 'meta.html_verify_info': "Please prove you're not a spammer by doing this quick activity!", 'game_meta.game_great': 'Great', 'meta.funcaptcha_website': 'Open Arkose Labs website', 'aria.challenge_image_alt': 'Image {{count}}.', 'game_meta.verification': 'Verification', 'aria.input_placeholder': 'Type here...', 'meta.audio_sent_info': "Verification complete! You've proven you're a human. Continue your action.", 'meta.funcaptcha': 'Arkose Labs', 'meta.reload_challenge': 'Reload Challenge', 'aria.left_arrow': 'Navigate to previous image', 'meta.generic_error': 'Something went wrong. Please reload the challenge to try again.', 'aria.audio_challenge': 'Audio challenge', 'meta.audio_disabled': 'The audio challenge has been disabled. Please use the visual challenge, or contact the customer support team for assistance.', '4.challenge_progress': '{{currentChallenge}} of {{numChallenges}}', '4.key_image_annotation-train_coordinates': 'Train Position', 'meta.stars_link': 'Stars', 'meta.api_timeout_error': 'The connection to a verification server was interrupted. Please reload the challenge to try again. ', 'aria.right_arrow': 'Navigate to next image', 'meta.audio_challenge_frame_title': 'Audio challenge', 'aria.visual_challenge_describe': 'Audio challenge is available below. Compatible with screen reader software.', 'meta.audio_version': 'Change to an audio challenge', 'meta.audio_answer_input': 'Challenge Answer', 'meta.audio_challenge': 'Change to an audio challenge', 'meta.footer_patent': 'Patent pending', '4.submit_button': 'Submit', 'game_meta.checking': 'Checking', 'game_meta.game_good': 'Good', 'aria.answer_field': 'Answer field', '4.hint': 'Make sure to select an image that matches what you see in the example image.', 'meta.audio_verify_button': 'Verify', 'meta.audio_play': 'Play Sound', 'meta.audio_please_download_info-3': 'Please download and listen to the sound, type the number of the song that is the most sad:', '4.intro_title': 'Verification', 'meta.audio_alert': 'Please enter your answer into the input box.', 'meta.loading_info': 'Working, please wait...', 'aria.audio_answer_input': 'Challenge answer', 'meta.html_verify_button': 'Verify', 'meta.meta_start_cta': 'Start visual challenge', 'meta.footer_general_info-1': 'Please solve the puzzle.', 'game_meta.challenge': 'Challenge {{count}}', '4.instructions': 'Press the arrows to see different images. When the image matches the example on the left, press Submit!', '4.fail_info_timed_middle_hidden': 'Try to answer before too much time runs out!', 'game_meta.not_for_public_watermark': 'NOT FOR PRODUCTION USE', 'game_meta.interstitial_progress_1': '{{currentChallenge}} done', 'meta.funcaptcha_solved_phrase': 'Verification challenge has been solved', '4.hint-train_coordinates': 'Make sure that the train is placed at the point of coordinates indicated in the left image', '4.instructions-train_coordinates': 'Use the arrows to move the train to the coordinates indicated in the left image', 'game_meta.wait_text': 'Please wait while we check your score.', 'aria.visual_challenge_label': 'Visual challenge.', 'game_meta.landing_heading': 'Protecting your account', 'meta.verification_complete': 'Verification complete!', 'aria.cross_icon_alt': 'Example for incorrect answer.', 'aria.wrong_image_alt': 'Example for incorrect answer.', 'aria.restart_challenge': 'Restarting challenge', 'meta.audio_rate_limit': 'Use of the audio challenge for this user has been too high. Please try again.', 'meta.restart_label': 'Restart', 'meta.audio_incorrect': 'Incorrect, try again', 'game_meta.landing_info': 'Please solve this puzzle so we know you are a real person', '4.fail_top': 'That was not quite right.', 'game_meta.game_perfect': 'Perfect', '4.finish_message': "Verification Complete
You've proven you're a human.
Continue your action.", 'meta.audio_challenge_label': 'Audio', 'meta.finished_info': "You've proven you're a human. Continue your action.", 'meta.footer_phone_mode_on': "This isn't working for me", 'game_meta.game_check': 'Check!', 'meta.session_reset': 'Your session was reset. Please try again.', 'game_meta.landing_button': 'Verify', 'aria.visual_challenge': 'Visual challenge. Audio challenge is available below, compatible with screen reader software.', 'meta.visual_challenge_label': 'Visual', 'meta.visual_challenge_frame_title': 'Visual challenge', 'game_meta.landing_start': 'Start Puzzle', 'meta.audio_download': 'Download Sound' }, earlyVictoryMessage: null, font_size_adjustments: null, style_theme: 'default', dapib_url: 'https://roblox-api.arkoselabs.com/dapib/eu-west-1/aa685266-9d43-4162-b705-fd8df3ac60e7/978.js?mac=l8kxlZ3%2F177zD0CPGlWrB948RFBD2WHpM4KTWOpHK%2Fk%3D&expiry=1696796705789', token: 'token=829178c39f974a165.8613351905|r=eu-west-1|meta=3|metabgclr=%23ffffff|metaiconclr=%23757575|guitextcolor=%23000000|lang=en|pk=5B50130F-E160-4D2A-BB1E-ABEC31A7AA9E|at=40|ag=101|cdn_url=https%3A%2F%2Froblox-api.arkoselabs.com%2Fcdn%2Ffc|lurl=https%3A%2F%2Faudio-eu-west-1.arkoselabs.com|surl=https%3A%2F%2Froblox-api.arkoselabs.com|smurl=https%3A%2F%2Froblox-api.arkoselabs.com%2Fcdn%2Ffc%2Fassets%2Fstyle-manager', tokenInfo: { token: '829178c39f974a165.8613351905', r: 'eu-west-1', meta: '3', metabgclr: '#ffffff', metaiconclr: '#757575', guitextcolor: '#000000', lang: 'en', pk: '5B50130F-E160-4D2A-BB1E-ABEC31A7AA9E', at: '40', ag: '101', cdn_url: 'https://roblox-api.arkoselabs.com/cdn/fc', lurl: 'https://audio-eu-west-1.arkoselabs.com', surl: 'https://roblox-api.arkoselabs.com', smurl: 'https://roblox-api.arkoselabs.com/cdn/fc/assets/style-manager', mbio: true } }

ItMan2056 avatar Oct 08 '23 19:10 ItMan2056

This is really weird... Are you by any chance attempting to fetch a second challenge without finishing the first one? game_difficulty dictates how many choices you have, and it's what limits your answer range (https://github.com/noahcoolboy/funcaptcha/blob/master/src/challenge.ts#L254) In the data object you posted, it shows 9, but from what you are saying it is being limited to 5? It should be impossible for this to happen...

noahcoolboy avatar Oct 08 '23 21:10 noahcoolboy

I solve the first challenge and when I try to post the answer, I get the error I posted. I tested several different type 4 captchas that have game difficulty above 6, all of them face the problem of sending a response and it loads the next image repeatedly, which is the same problem of not sending a response. The main problem is in sending the answer, that is, it cannot send an answer that is correct and is greater than 5, as if it cannot set the difficulty in the answer so that the correct answer can be sent. bandicam 2023-10-09 00-52-50-179 Please check the image, it sends one image in each round, as if the images that have more than 6 images have problems If you pay attention, I send the first picture and send the answer. In the second round, he sends the same picture, a duplicate answer is sent, and the same goes on until the challenge ends, so there is a problem in sending the answer.

ItMan2056 avatar Oct 08 '23 21:10 ItMan2056

Would you mind providing a snippet of code? Particularly around the line which sends the answer and fetches the image.

noahcoolboy avatar Oct 08 '23 22:10 noahcoolboy

this code sending captcha image with base64 and get response and send answer:

for (let x = 0; x < captcha.data.game_data.waves; x++) {
        var imageAsBase64 = "";
        fs.writeFileSync(`${x}.gif`, await captcha.getImage())
        imageAsBase64 = fs.readFileSync(`${x}.gif`, 'base64');
        var data = "method=base64&body="+imageAsBase64+"&key=286bd61650403348ff30097519eff786&imginstructions=3d&json=1";
        var requestOpts = {
            encoding: 'utf8',
            headers : { 'Content-Type': 'application/x-www-form-urlencoded' },
            uri: 'http://2 captcha.com/in.php',
            method: 'POST',
            body: data
        };
        var body = "";
        await rp(requestOpts)
        .then(async function(body) {
           sleep.sleep(1);
            var subStr = body.match('request":"(.*)"}');
            var answ = subStr[1];
            var requestOpts = {
              encoding: 'utf8',
              uri: 'http://2 captcha.com/res.php?key=286bd61650403348ff30097519eff786&action=get&id='+answ+'&json=1',
              method: 'GET'
              };
              await rp(requestOpts)
              .then(async function(body) {
                  var subStr = body.match('request":"(.*)"}');
                  var answ = subStr[1]-1;
                  console.log(answ);
                  let answer = await captcha.answer(answ);
                  console.log(answer)
                  checksup = answer.solved;
                if(checksup){
                  console.log("CAPTCHADONE!!");
                }else{
                  console.log(checksup);
                }
              })
              .catch(function(reason) {
                  console.dir(reason);
              });
            })
        .catch(function(reason) {
            console.dir(reason);
        });
    }

ItMan2056 avatar Oct 09 '23 03:10 ItMan2056

I checked the code, if the challenge is greater than 0-5, the whole library is in trouble and cannot send the answer, whether the answer is greater than 0-5 or not, so the console cannot show anything.

ItMan2056 avatar Oct 09 '23 10:10 ItMan2056

I'm a little confused, would you mind elaborating? The 0-5 check is only for gametype 3, not gametype 4

noahcoolboy avatar Oct 09 '23 10:10 noahcoolboy

I checked the challenges whose difficulty is 6, there is no problem. If it is more than 6, it will be difficult to send the answer. If you check, you will understand the issue. I looked at your code. Because I don't know much about your code, I can't do anything to improve the code

ItMan2056 avatar Oct 09 '23 10:10 ItMan2056

Any success in this problem?!

ItMan2056 avatar Oct 10 '23 09:10 ItMan2056

I think the problem is the bio parameter, I do not know whether the web page sent with the bio parameter

0x676e67 avatar Oct 20 '23 11:10 0x676e67