ich scripte nur selten daher weiss nicht wie ich das realisieren soll.
für gute coder vielleicht 20 minuten aufwand.
es geht um folgende anleitung von imagetyperz.com und deren api zum paydcaptchalösen
Imagetyperz AutoIt Script Usages
The following is a short guide on how to use the Imagetyperz AutoIt Script correctly. This tutorial will demonstrate a few steps on how to correctly set up to retrieve the Text of the CAPTCHA as well as replying if the CAPTCHA was a bad image. This script should be run in a different thread than your actual script to stop hanging of your script. This script does contain a loop while it waits for a response form the server.
$CmdLine[1] is your Imagetyperz username.
$CmdLine[2] is your Imagetyperz password.
Remember to include the file into your script with the following line at the top.
#include "ITClient.au3"
Decode Captcha
$array = ImagetyperzUploadAndGetText($CmdLine[1], $CmdLine[2], "C:\tt.jpg")
$id = $array[1]
$text = $array[2]
NOTE: This could also return an error message. Error messages that could be returned are below.
Set Bad Image
$success = ImagetyperzSetBadIamge($CmdLine[1], $CmdLine[2], $id)
Display Balance
$balance = ImagetyperzGetBalance($CmdLine[1], $CmdLine[2])
Possible Error Messages
ERROR: INVALID_REQUEST = It will be returned when the program tries to send the invalid request.
ERROR: INVALID_USERNAME = If the username is not provided, this will be returned.
ERROR: INVALID_PASSWORD = if the password is not provide, this will be returned.
ERROR: INVALID_IMAGE_FILE = No file uploaded or No image type file uploaded.
ERROR: AUTHENTICATION_FAILED = Provided username and password are invalid.
ERROR: INVALID_IMAGE_SIZE_30_KB = The uploading image file must be 30 KB.
ERROR: INVALID_IMAGE_ID = Not provided image id or Provided invalid image id.
ERROR: UNKNOWN = Unknown error happened, close the program and reopen.
ERROR: NOT_DECODED = The captcha is timedout
The following is a short guide on how to use the Imagetyperz AutoIt Script correctly. This tutorial will demonstrate a few steps on how to correctly set up to retrieve the Text of the CAPTCHA as well as replying if the CAPTCHA was a bad image. This script should be run in a different thread than your actual script to stop hanging of your script. This script does contain a loop while it waits for a response form the server.
$CmdLine[1] is your Imagetyperz username.
$CmdLine[2] is your Imagetyperz password.
Remember to include the file into your script with the following line at the top.
#include "ITClient.au3"
Decode Captcha
$array = ImagetyperzUploadAndGetText($CmdLine[1], $CmdLine[2], "C:\tt.jpg")
$id = $array[1]
$text = $array[2]
NOTE: This could also return an error message. Error messages that could be returned are below.
Set Bad Image
$success = ImagetyperzSetBadIamge($CmdLine[1], $CmdLine[2], $id)
Display Balance
$balance = ImagetyperzGetBalance($CmdLine[1], $CmdLine[2])
Possible Error Messages
ERROR: INVALID_REQUEST = It will be returned when the program tries to send the invalid request.
ERROR: INVALID_USERNAME = If the username is not provided, this will be returned.
ERROR: INVALID_PASSWORD = if the password is not provide, this will be returned.
ERROR: INVALID_IMAGE_FILE = No file uploaded or No image type file uploaded.
ERROR: AUTHENTICATION_FAILED = Provided username and password are invalid.
ERROR: INVALID_IMAGE_SIZE_30_KB = The uploading image file must be 30 KB.
ERROR: INVALID_IMAGE_ID = Not provided image id or Provided invalid image id.
ERROR: UNKNOWN = Unknown error happened, close the program and reopen.
ERROR: NOT_DECODED = The captcha is timedout
dazu gibt es 3 scripte
itclient.au3
#include "WinHTTP.au3"
Const $Imagetyperz_HOST_GETBALANCE = "http://www.captchatypers.com/Forms/RequestBalance.ashx"
Const $Imagetyperz_HOST_SetBadImage = "http://captchatypers.com/Forms/SetBadImage.ashx"
Func ImagetyperzCall($username, $password, $file)
; No fucking clue what is going on here.
$sForm = _
' <form action="http://captchatypers.com/Forms/UploadFileAndGetTextNew.ashx" method="post" enctype="multipart/form-data">' & _
'<input type="text" name="action" value="UPLOADCAPTCHA" />' & _
'<input type="text" name="username" value="' & $username & '" />' & _
'<input type="text" name="password" value="' & $password & '" />' & _
'<input type="file" name="file" />' & _
'<input type="submit" value="Submit" />' & _
'</form>'
; Initialize and get session handle.
$hOpen = _WinHttpOpen()
$hForm = $sForm
; Fill form on this page.
$sRead = _WinHttpSimpleFormFill($hform, $hOpen, Default, "name:file", $file)
$array = StringSplit($sRead, "|")
; Close connection handle.
_WinHttpCloseHandle($hForm)
; Close Session handle
_WinHttpCloseHandle($hOpen)
; See What's return (in defualt broswer or whatever)
return $array
EndFunc
Func _ImagetyperzCall($buf, $type)
Local $URL= ""
If $type = "BALANCE" Then
$URL = $Imagetyperz_HOST_GETBALANCE
ElseIf $type = "BAD" Then
$URL = $Imagetyperz_HOST_SetBadImage
EndIf
; Creating the object
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", $URL)
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
; Performing the Request
$oHTTP.Send($buf)
; Download the body response if any, and get the server status response code.
$response = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status
If $oStatusCode <> 200 then
;MsgBox(4096, "Response code", $oStatusCode)
EndIf
Return $response
EndFunc
; Uploads CATPCH and get the TEXT.
; Call with your Imagetyperz username/password and CAPTCHA file name.
; Returns CATPCH text on success.
Func ImagetyperzUploadAndGetText($username, $password, $captchaFileName)
Local $text = ImagetyperzCall($username, $password, $captchaFileName)
return $text
EndFunc
; Reports a CAPTCHA as incorrectly solved.
; Call with your Imagetyperz username/password and unique CAPTCHA ID.
; Returns success
Func ImagetyperzSetBadImage($username, $password, $captchaId)
Return _ImagetyperzCall("action=SETBADIMAGE&username=" & $username & "&password=" & $password & "&imageid=" & $captchaId, "BAD")
EndFunc
;
; Gets a balance
; Call with your Imagetyperz username/password
; Returns 1 on success, 0 otherwise.
Func ImagetyperzGetBalance($username, $password)
Return _ImagetyperzCall("action=REQUESTBALANCE&username=" & $username & "&password=" & $password, "BALANCE")
EndFunc
; Usage example
; =============
;
; Call ImagetyperzUpload() function with your ImageTyperz username, password,
; CAPTCHA file name
; You'll receive an array of two elements: numeric CAPTCHA ID and its text;
; CAPTCHA ID will be greater than zero if the CAPTCHA was solved.
;$Balance = ImagetyperzGetBalance($CmdLine[1], $CmdLine[2])
;MsgBox(0, "decode()", StringFormat('Balance: %s', $Balance)) ;This will return the balance
;$Text = ImagetyperzUploadAndGetText($CmdLine[1], $CmdLine[2], "C:\tt.jpg")
;MsgBox(0, "decode()", StringFormat('Text: %s', $Text)) ;This will return the imagetext along with captchaID Example of output: "1245986|HGFJD"
Const $Imagetyperz_HOST_GETBALANCE = "http://www.captchatypers.com/Forms/RequestBalance.ashx"
Const $Imagetyperz_HOST_SetBadImage = "http://captchatypers.com/Forms/SetBadImage.ashx"
Func ImagetyperzCall($username, $password, $file)
; No fucking clue what is going on here.
$sForm = _
' <form action="http://captchatypers.com/Forms/UploadFileAndGetTextNew.ashx" method="post" enctype="multipart/form-data">' & _
'<input type="text" name="action" value="UPLOADCAPTCHA" />' & _
'<input type="text" name="username" value="' & $username & '" />' & _
'<input type="text" name="password" value="' & $password & '" />' & _
'<input type="file" name="file" />' & _
'<input type="submit" value="Submit" />' & _
'</form>'
; Initialize and get session handle.
$hOpen = _WinHttpOpen()
$hForm = $sForm
; Fill form on this page.
$sRead = _WinHttpSimpleFormFill($hform, $hOpen, Default, "name:file", $file)
$array = StringSplit($sRead, "|")
; Close connection handle.
_WinHttpCloseHandle($hForm)
; Close Session handle
_WinHttpCloseHandle($hOpen)
; See What's return (in defualt broswer or whatever)
return $array
EndFunc
Func _ImagetyperzCall($buf, $type)
Local $URL= ""
If $type = "BALANCE" Then
$URL = $Imagetyperz_HOST_GETBALANCE
ElseIf $type = "BAD" Then
$URL = $Imagetyperz_HOST_SetBadImage
EndIf
; Creating the object
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", $URL)
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
; Performing the Request
$oHTTP.Send($buf)
; Download the body response if any, and get the server status response code.
$response = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status
If $oStatusCode <> 200 then
;MsgBox(4096, "Response code", $oStatusCode)
EndIf
Return $response
EndFunc
; Uploads CATPCH and get the TEXT.
; Call with your Imagetyperz username/password and CAPTCHA file name.
; Returns CATPCH text on success.
Func ImagetyperzUploadAndGetText($username, $password, $captchaFileName)
Local $text = ImagetyperzCall($username, $password, $captchaFileName)
return $text
EndFunc
; Reports a CAPTCHA as incorrectly solved.
; Call with your Imagetyperz username/password and unique CAPTCHA ID.
; Returns success
Func ImagetyperzSetBadImage($username, $password, $captchaId)
Return _ImagetyperzCall("action=SETBADIMAGE&username=" & $username & "&password=" & $password & "&imageid=" & $captchaId, "BAD")
EndFunc
;
; Gets a balance
; Call with your Imagetyperz username/password
; Returns 1 on success, 0 otherwise.
Func ImagetyperzGetBalance($username, $password)
Return _ImagetyperzCall("action=REQUESTBALANCE&username=" & $username & "&password=" & $password, "BALANCE")
EndFunc
; Usage example
; =============
;
; Call ImagetyperzUpload() function with your ImageTyperz username, password,
; CAPTCHA file name
; You'll receive an array of two elements: numeric CAPTCHA ID and its text;
; CAPTCHA ID will be greater than zero if the CAPTCHA was solved.
;$Balance = ImagetyperzGetBalance($CmdLine[1], $CmdLine[2])
;MsgBox(0, "decode()", StringFormat('Balance: %s', $Balance)) ;This will return the balance
;$Text = ImagetyperzUploadAndGetText($CmdLine[1], $CmdLine[2], "C:\tt.jpg")
;MsgBox(0, "decode()", StringFormat('Text: %s', $Text)) ;This will return the imagetext along with captchaID Example of output: "1245986|HGFJD"
das ganze soll als seperates script neben meinem script laufen.
also
wer sich schnell was verdienen mag
bitte melden






