Skip to content

Commit

Permalink
HCaptcha Support + Cleanup Imports
Browse files Browse the repository at this point in the history
  • Loading branch information
J authored and J committed Mar 1, 2021
1 parent 86ed28c commit 8cde6ab
Show file tree
Hide file tree
Showing 17 changed files with 103 additions and 49 deletions.
3 changes: 0 additions & 3 deletions CapMonsterCloud/CapMonsterClient.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 1 addition & 5 deletions CapMonsterCloud/CaptchaTaskStatus.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud
namespace CapMonsterCloud
{
internal static class CaptchaTaskStatus
{
Expand Down
2 changes: 0 additions & 2 deletions CapMonsterCloud/EndpointData.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Http;

namespace CapMonsterCloud
Expand Down
6 changes: 1 addition & 5 deletions CapMonsterCloud/EndpointSecurityType.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud
namespace CapMonsterCloud
{
internal enum EndpointSecurityType
{
Expand Down
2 changes: 0 additions & 2 deletions CapMonsterCloud/Endpoints.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;

namespace CapMonsterCloud
{
Expand Down
6 changes: 1 addition & 5 deletions CapMonsterCloud/ErrorType.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud
namespace CapMonsterCloud
{
public enum ErrorType
{
Expand Down
4 changes: 1 addition & 3 deletions CapMonsterCloud/ErrorTypeHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;

namespace CapMonsterCloud
{
Expand Down
2 changes: 0 additions & 2 deletions CapMonsterCloud/Exceptions/ApiException.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud.Exceptions
{
Expand Down
2 changes: 0 additions & 2 deletions CapMonsterCloud/Exceptions/CapMonsterException.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud.Exceptions
{
Expand Down
6 changes: 1 addition & 5 deletions CapMonsterCloud/Models/CaptchaTasks/CaptchaTask.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud.Models.CaptchaTasks
{
Expand Down
62 changes: 62 additions & 0 deletions CapMonsterCloud/Models/CaptchaTasks/HCaptchaTask.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using Newtonsoft.Json;

namespace CapMonsterCloud.Models.CaptchaTasks
{
public class HCaptchaTask : CaptchaTask
{
public HCaptchaTask()
{
Type = "HCaptchaTask";
}

/// <summary>
/// Address of a webpage with HCaptcha
/// </summary>
[JsonProperty("websiteURL")]
public string WebsiteUrl { get; set; }

/// <summary>
/// HCaptcha website key.
/// </summary>
public string WebsiteKey { get; set; }

/// <summary>
/// Type of the proxy
/// http, https, socks4, socks5
/// </summary>
public string ProxyType { get; set; }

/// <summary>
/// Proxy IP address IPv4/IPv6
/// </summary>
public string ProxyAddress { get; set; }

/// <summary>
/// Proxy port
/// </summary>
public int ProxyPort { get; set; }

/// <summary>
/// Login for proxy which requires authorizaiton (basic)
/// </summary>
public string ProxyUsername { get; set; }

/// <summary>
/// Proxy password
/// </summary>
public string ProxyPassword { get; set; }

/// <summary>
/// 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".
/// </summary>
public string UserAgent { get; set; }

/// <summary>
/// Additional cookies which we must use during interaction with target page or HCaptcha.
/// Format: cookiename1=cookievalue1; cookiename2=cookievalue2
/// </summary>
public string Cookies { get; set; }
}
}
36 changes: 36 additions & 0 deletions CapMonsterCloud/Models/CaptchaTasks/HCaptchaTaskProxyless.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Newtonsoft.Json;

namespace CapMonsterCloud.Models.CaptchaTasks
{
public class HCaptchaTaskProxyless : CaptchaTask
{
public HCaptchaTaskProxyless()
{
Type = "HCaptchaTaskProxyless";
}

/// <summary>
/// Address of a webpage with Hcaptcha
/// </summary>
[JsonProperty("websiteURL")]
public string WebsiteUrl { get; set; }

/// <summary>
/// HCaptcha website key.
/// </summary>
public string WebsiteKey { get; set; }

/// <summary>
/// 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".
/// </summary>
public string UserAgent { get; set; }

/// <summary>
/// Additional cookies which we must use during interaction with target page or Hcaptcha.
/// Format: cookiename1=cookievalue1; cookiename2=cookievalue2
/// </summary>
public string Cookies { get; set; }
}
}
3 changes: 0 additions & 3 deletions CapMonsterCloud/Models/CaptchaTasks/ImageToTextTask.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud.Models.CaptchaTasks
{
Expand Down
3 changes: 0 additions & 3 deletions CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTask.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud.Models.CaptchaTasks
{
Expand Down
3 changes: 0 additions & 3 deletions CapMonsterCloud/Models/CaptchaTasks/NoCaptchaTaskProxyless.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud.Models.CaptchaTasks
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace CapMonsterCloud.Models.CaptchaTasks
{
Expand Down

0 comments on commit 8cde6ab

Please sign in to comment.