A .NET Standard library to interact with multiple captcha solution providers.
- For now it only contains 2Captcha provider and a code-base of how the multiple Captcha solver providers will work, you want to improve it or add captcha systems?, create a pull request !
I will dedicate myself to update it if it gets community support
How to use? Example class
CapSharp capSharpLibrary = new CapSharp(useProxy: false) // Here you can assign the use of proxies
{
// If you have this option enabled, the 'TrySolveCaptcha'
// method will never return as false and will throw an exception with the error code
ThrowExceptions = true,
// Configure this method if you are activating the 'useProxy' in the method call
Proxy = new Proxy(Host: "1.1.1.1", Port: 1234, new ProxySettings(ProxyProtocol.HTTP)
{
BackConnect = false, // If your proxies are backconnect
Timeout = TimeSpan.FromSeconds(5),
ProxyCredentials = new Credentials("Username", "Password") // If your proxies use credentials, assign them
})
};
// CapSharp capSharpLibrary = new CapSharp(us... ()
TwoCaptcha twoCaptcha = new TwoCaptcha(apiKey: "YOUR_API_KEY", capSharp: capSharpLibrary);
Captcha based on images not available at the moment
- ReCaptcha V2, reCaptcha V3, reCaptcha Invisible and reCaptcha Enterprise
- hCaptcha
- Arkose Labs - FunCaptcha
- KeyCaptcha
- GeeTest
/* Google reCaptcha */
twoCaptcha.SetCaptchaSettings(
TwoCaptchaTypes.reCaptchaV2, PageUrl: "PAGE_URL", ReCaptchaSiteKey: "RECAPTCHA_SITE");
// Is the captcha invisible?, add the parameter to the method:
twoCaptcha.SetCaptchaSettings(
TwoCaptchaTypes.reCaptchaV2, PageUrl: "PAGE_URL", ReCaptchaSiteKey: "RECAPTCHA_SITE", invisibleCaptcha: true);
// twoCaptcha.MinScore = 0.3; (Optional): For captcha invisibles
// twoCaptcha.Enterprise = true; (Default: false) // if the captcha is enterprise just enable this
/* Google reCaptcha */
twoCaptcha.SetCaptchaSettings(
TwoCaptchaTypes.FunCaptcha, PageUrl: "PAGE_URL");
twoCaptcha.PublicKey = "PUBLIC_KEY";
twoCaptcha.ServiceUrl = "SERVICE_URL";
twoCaptcha.SetCaptchaSettings(
TwoCaptchaTypes.KeyCaptcha, PageUrl: "PAGE_URL");
twoCaptcha.KeyCaptcha.s_s_c_user_id = "USER_ID";
twoCaptcha.KeyCaptcha.s_s_c_session_id = "SESSION_ID";
twoCaptcha.KeyCaptcha.s_s_c_web_server_sign = "WEB_SERVER_SIGN";
twoCaptcha.KeyCaptcha.s_s_c_web_server_sign2 = "WEB_SERVER_SIGN2";
twoCaptcha.SetCaptchaSettings(
TwoCaptchaTypes.GeeTest, PageUrl: "PAGE_URL");
twoCaptcha.GeeTest.gt = "GT";
twoCaptcha.GeeTest.challenge = "CHALLENGE";
twoCaptcha.GeeTest.api_server = "API_SERVER"; // (Optional)
twoCaptcha.SetCaptchaSettings(
TwoCaptchaTypes.hCaptcha, PageUrl: "PAGE_URL");
twoCaptcha.hCaptchaSiteKey = "SITE_KEY";
bool CaptchaIsSuccess = twoCaptcha.TrySolveCaptcha(out string accessToken);
In the case of GeeTest, you must call:
bool CaptchaIsSuccess = twoCaptcha.TrySolveCaptcha(out GeeTest.Response GeeTestResponse);
// Response:
// GeeTestResponse.challenge (string)
// GeeTestResponse.validate (string)
// GeeTestResponse.seccode (string)
bool Success = CaptchaInstance.TryGetUserBalance(out string MyBalance);
bool Success = CaptchaInstance.TrySolveCaptcha(out string CaptchaAccessToken);
If you find a problem or have a suggestion inside this library, please let me know by clicking here, if you want to improve the code, make it cleaner or even more expensive, create a pull request.
In case you will contribute in the code, please follow the same code base.
Telegram: https://t.me/biitez
Bitcoin Addy: bc1qzz4rghmt6zg0wl6shzaekd59af5znqhr3nxmms