Table of Contents

Class CaptchaSolver

Namespace
Twikit.Captcha
Assembly
Twikit.dll

captcha ソルバーの基底クラス。Client に渡すと、アカウントがロックされたとき (code 326)に自動でロック解除を試みます。

public abstract class CaptchaSolver
Inheritance
CaptchaSolver
Derived
Inherited Members

Fields

CaptchaSiteKey

public const string CaptchaSiteKey = "0152B4EB-D2DC-460A-89A1-629838B529C9"

Field Value

string

CaptchaUrl

public static readonly string CaptchaUrl

Field Value

string

Properties

Client

このソルバーを使うクライアント(Client のコンストラクターが設定します)。

public Client? Client { get; }

Property Value

Client

MaxAttempts

ロック解除の最大試行回数。

public int MaxAttempts { get; set; }

Property Value

int

Methods

ConfirmUnlockAsync(string?, string?, string?, bool)

ロック解除フォームを送信します。

public Task<(HttpResponseMessage Response, UnlockHtml Html)> ConfirmUnlockAsync(string? authenticityToken, string? assignmentToken, string? verificationString = null, bool uiMetrics = false)

Parameters

authenticityToken string
assignmentToken string
verificationString string
uiMetrics bool

Returns

Task<(HttpResponseMessage Response, UnlockHtml Html)>

GetUnlockHtmlAsync()

ロック解除ページを取得して解析します。

public Task<(HttpResponseMessage Response, UnlockHtml Html)> GetUnlockHtmlAsync()

Returns

Task<(HttpResponseMessage Response, UnlockHtml Html)>

ParseUnlockHtml(string)

ロック解除ページを解析します。

public static UnlockHtml ParseUnlockHtml(string html)

Parameters

html string

Returns

UnlockHtml

SolveFunCaptchaAsync(string?)

FunCaptcha を解きます。errorId と solution.token を含む結果を返します。

public abstract Task<JsonObject> SolveFunCaptchaAsync(string? blob)

Parameters

blob string

Returns

Task<JsonObject>

UiMetrixAsync()

ui_metrics スクリプトの本体(return {...}; の部分)を取得します。

public Task<string> UiMetrixAsync()

Returns

Task<string>