anon4456 Posted March 26, 2009 Share Posted March 26, 2009 I am writing a script to bypass a captcha (for legal purposes). I am using a class called Snoopy, which simulates a web browser. I am trying to write a script that sends the CAPTCHA to CAPTCHA killer and retrive the text. For now, I have a script that print outs the resulting page. When I call the submit() method without the file, it prints out fine, but with the files, I get a blank page Here is the code: <?php include('snoopy.php'); function getSizeFile($url) { if (substr($url,0,4)=='http') { $x = array_change_key_case(get_headers($url, 1),CASE_LOWER); if ( strcasecmp($x[0], 'HTTP/1.1 200 OK') != 0 ) { $x = $x['content-length'][1]; } else { $x = $x['content-length']; } } else { $x = @filesize($url); } return $x; } $snoopy = new Snoopy(); // post the CAPTCHA to Captcha killer $submit_url = "http://www.captchakiller.com/api.php"; $snoopy->submit_type = "image/jpg"; $submit_vars['method'] = "upload_captcha"; $submit_vars['api_key'] = "E8C3300A-EC9F-DBFC-6D7E-3FD6A9646BB3"; $filename = "http://swagbucks.com/images/captcha/-441652462.jpg?2058866442"; $fp = fopen($filename, 'rb'); $submit_files['file'] = fread($fp, getSizeFile($filename)); $snoopy->submit($submit_url, $submit_vars, $submit_files); print $snoopy->results; ?> Link to comment https://forums.phpfreaks.com/topic/151155-using-snoopy-to-submit-files/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.