From 8cde6ab4c8a1596ca7c5c7735e6e37464ce2ebe1 Mon Sep 17 00:00:00 2001
From: J <40630518+JReverse@users.noreply.github.com>
Date: Mon, 1 Mar 2021 03:36:10 -0600
Subject: [PATCH] HCaptcha Support + Cleanup Imports
---
CapMonsterCloud/CapMonsterClient.cs | 3 -
CapMonsterCloud/CaptchaTaskStatus.cs | 6 +-
CapMonsterCloud/EndpointData.cs | 2 -
CapMonsterCloud/EndpointSecurityType.cs | 6 +-
CapMonsterCloud/Endpoints.cs | 2 -
CapMonsterCloud/ErrorType.cs | 6 +-
CapMonsterCloud/ErrorTypeHelper.cs | 4 +-
CapMonsterCloud/Exceptions/ApiException.cs | 2 -
.../Exceptions/CapMonsterException.cs | 2 -
.../Models/CaptchaTasks/CaptchaTask.cs | 6 +-
.../CaptchaTasks/FunCaptchaTaskProxyless.cs | 3 -
.../Models/CaptchaTasks/HCaptchaTask.cs | 62 +++++++++++++++++++
.../CaptchaTasks/HCaptchaTaskProxyless.cs | 36 +++++++++++
.../Models/CaptchaTasks/ImageToTextTask.cs | 3 -
.../Models/CaptchaTasks/NoCaptchaTask.cs | 3 -
.../CaptchaTasks/NoCaptchaTaskProxyless.cs | 3 -
.../CaptchaTasks/RecaptchaV3TaskProxyless.cs | 3 -
17 files changed, 103 insertions(+), 49 deletions(-)
create mode 100644 CapMonsterCloud/Models/CaptchaTasks/HCaptchaTask.cs
create mode 100644 CapMonsterCloud/Models/CaptchaTasks/HCaptchaTaskProxyless.cs
diff --git a/CapMonsterCloud/CapMonsterClient.cs b/CapMonsterCloud/CapMonsterClient.cs
index 1d03d63..7e5d2ce 100644
--- a/CapMonsterCloud/CapMonsterClient.cs
+++ b/CapMonsterCloud/CapMonsterClient.cs
@@ -1,9 +1,6 @@
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
-using CapMonsterCloud.Exceptions;
using CapMonsterCloud.Models.CaptchaTasks;
using CapMonsterCloud.Models.CaptchaTasksResults;
using CapMonsterCloud.Models.Requests;
diff --git a/CapMonsterCloud/CaptchaTaskStatus.cs b/CapMonsterCloud/CaptchaTaskStatus.cs
index 6f1f6e2..486ea22 100644
--- a/CapMonsterCloud/CaptchaTaskStatus.cs
+++ b/CapMonsterCloud/CaptchaTaskStatus.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace CapMonsterCloud
+namespace CapMonsterCloud
{
internal static class CaptchaTaskStatus
{
diff --git a/CapMonsterCloud/EndpointData.cs b/CapMonsterCloud/EndpointData.cs
index ae55855..3c97832 100644
--- a/CapMonsterCloud/EndpointData.cs
+++ b/CapMonsterCloud/EndpointData.cs
@@ -1,6 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Net.Http;
namespace CapMonsterCloud
diff --git a/CapMonsterCloud/EndpointSecurityType.cs b/CapMonsterCloud/EndpointSecurityType.cs
index 3821b45..fa358e1 100644
--- a/CapMonsterCloud/EndpointSecurityType.cs
+++ b/CapMonsterCloud/EndpointSecurityType.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace CapMonsterCloud
+namespace CapMonsterCloud
{
internal enum EndpointSecurityType
{
diff --git a/CapMonsterCloud/Endpoints.cs b/CapMonsterCloud/Endpoints.cs
index f59dcd8..40738fd 100644
--- a/CapMonsterCloud/Endpoints.cs
+++ b/CapMonsterCloud/Endpoints.cs
@@ -1,7 +1,5 @@
using System;
-using System.Collections.Generic;
using System.Net.Http;
-using System.Text;
namespace CapMonsterCloud
{
diff --git a/CapMonsterCloud/ErrorType.cs b/CapMonsterCloud/ErrorType.cs
index 601c7b6..b2789e2 100644
--- a/CapMonsterCloud/ErrorType.cs
+++ b/CapMonsterCloud/ErrorType.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace CapMonsterCloud
+namespace CapMonsterCloud
{
public enum ErrorType
{
diff --git a/CapMonsterCloud/ErrorTypeHelper.cs b/CapMonsterCloud/ErrorTypeHelper.cs
index 17e430a..d5f3842 100644
--- a/CapMonsterCloud/ErrorTypeHelper.cs
+++ b/CapMonsterCloud/ErrorTypeHelper.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
+using System.Collections.Generic;
namespace CapMonsterCloud
{
diff --git a/CapMonsterCloud/Exceptions/ApiException.cs b/CapMonsterCloud/Exceptions/ApiException.cs
index 3ea5a28..0edfb50 100644
--- a/CapMonsterCloud/Exceptions/ApiException.cs
+++ b/CapMonsterCloud/Exceptions/ApiException.cs
@@ -1,6 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Text;
namespace CapMonsterCloud.Exceptions
{
diff --git a/CapMonsterCloud/Exceptions/CapMonsterException.cs b/CapMonsterCloud/Exceptions/CapMonsterException.cs
index 8fd8c3e..8f7368d 100644
--- a/CapMonsterCloud/Exceptions/CapMonsterException.cs
+++ b/CapMonsterCloud/Exceptions/CapMonsterException.cs
@@ -1,6 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Text;
namespace CapMonsterCloud.Exceptions
{
diff --git a/CapMonsterCloud/Models/CaptchaTasks/CaptchaTask.cs b/CapMonsterCloud/Models/CaptchaTasks/CaptchaTask.cs
index 1cb79ca..3d66d16 100644
--- a/CapMonsterCloud/Models/CaptchaTasks/CaptchaTask.cs
+++ b/CapMonsterCloud/Models/CaptchaTasks/CaptchaTask.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace CapMonsterCloud.Models.CaptchaTasks
+namespace CapMonsterCloud.Models.CaptchaTasks
{
public abstract class CaptchaTask
{
diff --git a/CapMonsterCloud/Models/CaptchaTasks/FunCaptchaTaskProxyless.cs b/CapMonsterCloud/Models/CaptchaTasks/FunCaptchaTaskProxyless.cs
index 7b7b1a2..56ffbc8 100644
--- a/CapMonsterCloud/Models/CaptchaTasks/FunCaptchaTaskProxyless.cs
+++ b/CapMonsterCloud/Models/CaptchaTasks/FunCaptchaTaskProxyless.cs
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Text;
namespace CapMonsterCloud.Models.CaptchaTasks
{
diff --git a/CapMonsterCloud/Models/CaptchaTasks/HCaptchaTask.cs b/CapMonsterCloud/Models/CaptchaTasks/HCaptchaTask.cs
new file mode 100644
index 0000000..7f80b4a
--- /dev/null
+++ b/CapMonsterCloud/Models/CaptchaTasks/HCaptchaTask.cs
@@ -0,0 +1,62 @@
+using Newtonsoft.Json;
+
+namespace CapMonsterCloud.Models.CaptchaTasks
+{
+ public class HCaptchaTask : CaptchaTask
+ {
+ public HCaptchaTask()
+ {
+ Type = "HCaptchaTask";
+ }
+
+ ///
+ /// Address of a webpage with HCaptcha
+ ///
+ [JsonProperty("websiteURL")]
+ public string WebsiteUrl { get; set; }
+
+ ///
+ /// HCaptcha website key.
+ ///
+ public string WebsiteKey { get; set; }
+
+ ///
+ /// Type of the proxy
+ /// http, https, socks4, socks5
+ ///
+ public string ProxyType { get; set; }
+
+ ///
+ /// Proxy IP address IPv4/IPv6
+ ///
+ public string ProxyAddress { get; set; }
+
+ ///
+ /// Proxy port
+ ///
+ public int ProxyPort { get; set; }
+
+ ///
+ /// Login for proxy which requires authorizaiton (basic)
+ ///
+ public string ProxyUsername { get; set; }
+
+ ///
+ /// Proxy password
+ ///
+ public string ProxyPassword { get; set; }
+
+ ///
+ /// Browser's User-Agent which is used in emulation.
+ /// It is required that you use a signature of a modern browser,
+ /// otherwise HCaptcha will ask you to "update your browser".
+ ///
+ public string UserAgent { get; set; }
+
+ ///
+ /// Additional cookies which we must use during interaction with target page or HCaptcha.
+ /// Format: cookiename1=cookievalue1; cookiename2=cookievalue2
+ ///
+ public string Cookies { get; set; }
+ }
+}
diff --git a/CapMonsterCloud/Models/CaptchaTasks/HCaptchaTaskProxyless.cs b/CapMonsterCloud/Models/CaptchaTasks/HCaptchaTaskProxyless.cs
new file mode 100644
index 0000000..2e62f09
--- /dev/null
+++ b/CapMonsterCloud/Models/CaptchaTasks/HCaptchaTaskProxyless.cs
@@ -0,0 +1,36 @@
+using Newtonsoft.Json;
+
+namespace CapMonsterCloud.Models.CaptchaTasks
+{
+ public class HCaptchaTaskProxyless : CaptchaTask
+ {
+ public HCaptchaTaskProxyless()
+ {
+ Type = "HCaptchaTaskProxyless";
+ }
+
+ ///
+ /// Address of a webpage with Hcaptcha
+ ///
+ [JsonProperty("websiteURL")]
+ public string WebsiteUrl { get; set; }
+
+ ///
+ /// HCaptcha website key.
+ ///
+ public string WebsiteKey { get; set; }
+
+ ///
+ /// Browser's User-Agent which is used in emulation.
+ /// It is required that you use a signature of a modern browser,
+ /// otherwise Hcaptcha will ask you to "update your browser".
+ ///
+ public string UserAgent { get; set; }
+
+ ///
+ /// Additional cookies which we must use during interaction with target page or Hcaptcha.
+ /// Format: cookiename1=cookievalue1; cookiename2=cookievalue2
+ ///
+ public string Cookies { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/CapMonsterCloud/Models/CaptchaTasks/ImageToTextTask.cs b/CapMonsterCloud/Models/CaptchaTasks/ImageToTextTask.cs
index 1a4aa2f..c8fba68 100644
--- a/CapMonsterCloud/Models/CaptchaTasks/ImageToTextTask.cs
+++ b/CapMonsterCloud/Models/CaptchaTasks/ImageToTextTask.cs
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Text;
namespace CapMonsterCloud.Models.CaptchaTasks
{
diff --git a/CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTask.cs b/CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTask.cs
index e13a53f..3bd5e3f 100644
--- a/CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTask.cs
+++ b/CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTask.cs
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Text;
namespace CapMonsterCloud.Models.CaptchaTasks
{
diff --git a/CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTaskProxyless.cs b/CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTaskProxyless.cs
index e30c415..aa84e3f 100644
--- a/CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTaskProxyless.cs
+++ b/CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTaskProxyless.cs
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Text;
namespace CapMonsterCloud.Models.CaptchaTasks
{
diff --git a/CapMonsterCloud/Models/CaptchaTasks/RecaptchaV3TaskProxyless.cs b/CapMonsterCloud/Models/CaptchaTasks/RecaptchaV3TaskProxyless.cs
index 2e1358c..814c02e 100644
--- a/CapMonsterCloud/Models/CaptchaTasks/RecaptchaV3TaskProxyless.cs
+++ b/CapMonsterCloud/Models/CaptchaTasks/RecaptchaV3TaskProxyless.cs
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Text;
namespace CapMonsterCloud.Models.CaptchaTasks
{