Skip to content

Commit cd07dad

Browse files
committed
[build] New staging version
- Fixed auto word selection in native winforms RTB - Removed label from auto block bool params - Fixed hardcoded timeout when connecting with RL HTTP without a proxy - Removed CapSolver support - Upgraded CaptchaSharp to 2.1.0 - Added AYCD AutoSolve support - Added block to Solves a Cloudflare Challenge page
1 parent 97c4fc1 commit cd07dad

File tree

12 files changed

+69
-3
lines changed

12 files changed

+69
-3
lines changed

OpenBullet2.Native/ViewModels/RLSettingsViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,16 @@ public string CapGuruApiKey
554554
OnPropertyChanged();
555555
}
556556
}
557+
558+
public string AycdApiKey
559+
{
560+
get => Captcha.AycdApiKey;
561+
set
562+
{
563+
Captcha.AycdApiKey = value;
564+
OnPropertyChanged();
565+
}
566+
}
557567

558568
public string PuppeteerChromeBinaryLocation
559569
{

OpenBullet2.Native/Views/Pages/RLSettings.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,17 @@
487487
</StackPanel>
488488
</StackPanel>
489489
</TabItem>
490+
491+
<!-- AYCD -->
492+
<TabItem>
493+
<StackPanel>
494+
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
495+
<Label>Api Key</Label>
496+
<TextBox Text="{Binding AycdApiKey}"
497+
Width="400"></TextBox>
498+
</StackPanel>
499+
</StackPanel>
500+
</TabItem>
490501
</TabControl>
491502
<Button x:Name="checkBalanceButton"
492503
Click="CheckCaptchaBalance"

RuriLib/Blocks/Captchas/Methods.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,14 +414,14 @@ public static async Task<string> SolveRecaptchaMobile(BotData data, string appPa
414414
extraInfo =
415415
"The response will be a list and its elements are (in order) captcha id, lot number, pass token, gen time, captcha output")]
416416
public static async Task<List<string>> SolveGeeTestV4Captcha(BotData data, string captchaId,
417-
string siteUrl, string userAgent =
417+
string siteUrl, bool useProxy = false, string userAgent =
418418
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36")
419419
{
420420
data.Logger.LogHeader();
421421
await CheckBalanceAsync(data).ConfigureAwait(false);
422422

423423
var response = await data.Providers.Captcha.SolveGeeTestV4Async(captchaId, siteUrl,
424-
CreateSessionParams(data, useProxy: false, userAgent), data.CancellationToken).ConfigureAwait(false);
424+
CreateSessionParams(data, useProxy, userAgent), data.CancellationToken).ConfigureAwait(false);
425425

426426
AddCaptchaId(data, response.Id, CaptchaType.GeeTestV4);
427427
data.Logger.Log("Got solution!", LogColors.ElectricBlue);
@@ -433,6 +433,24 @@ public static async Task<List<string>> SolveGeeTestV4Captcha(BotData data, strin
433433
return [response.CaptchaId, response.LotNumber, response.PassToken, response.GenTime, response.CaptchaOutput];
434434
}
435435

436+
[Block("Solves a Cloudflare Challenge page",
437+
extraInfo = "The response will contain the value of the cf_clearance cookie")]
438+
public static async Task<string> SolveCloudflareChallengePage(BotData data,
439+
string siteUrl, string pageHtml, bool useProxy = false, string userAgent =
440+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36")
441+
{
442+
data.Logger.LogHeader();
443+
await CheckBalanceAsync(data).ConfigureAwait(false);
444+
445+
var response = await data.Providers.Captcha.SolveCloudflareChallengePageAsync(
446+
siteUrl, pageHtml,
447+
CreateSessionParams(data, useProxy, userAgent), data.CancellationToken).ConfigureAwait(false);
448+
449+
AddCaptchaId(data, response.Id, CaptchaType.CloudflareChallengePage);
450+
data.Logger.Log($"Got solution: {response.Response}", LogColors.ElectricBlue);
451+
return response.Response;
452+
}
453+
436454
[Block("Reports an incorrectly solved captcha to the service in order to get funds back")]
437455
public static async Task ReportLastSolution(BotData data)
438456
{

RuriLib/Functions/Captchas/CaptchaServiceFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public static CaptchaService GetService(CaptchaSettings settings)
4545
CaptchaServiceType.EndCaptcha => new EndCaptchaService(settings.EndCaptchaUsername, settings.EndCaptchaPassword),
4646
CaptchaServiceType.BestCaptchaSolver => new BestCaptchaSolverService(settings.BestCaptchaSolverApiKey),
4747
CaptchaServiceType.CapGuru => new CapGuruService(settings.CapGuruApiKey),
48+
CaptchaServiceType.Aycd => new AycdService(settings.AycdApiKey),
4849
_ => throw new NotSupportedException(),
4950
};
5051

RuriLib/Functions/Captchas/CaptchaServiceType.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,7 @@ public enum CaptchaServiceType
8585

8686
/// <summary>The service provided by https://cap.guru/</summary>
8787
CapGuru = 27,
88+
89+
/// <summary>The service provided by https://aycd.io/</summary>
90+
Aycd = 28,
8891
}

RuriLib/Models/Settings/CaptchaSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ public class CaptchaSettings
4646
public string EndCaptchaUsername { get; set; } = "";
4747
public string EndCaptchaPassword { get; set; } = "";
4848
public string CapGuruApiKey { get; set; } = "";
49+
public string AycdApiKey { get; set; } = "";
4950
}

RuriLib/Providers/Captchas/CaptchaSharpProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ public Task<GeeTestV4Response> SolveGeeTestV4Async(
130130
string captchaId, string siteUrl, SessionParams? sessionParams = null, CancellationToken cancellationToken = default)
131131
=> _service.SolveGeeTestV4Async(captchaId, siteUrl, sessionParams, cancellationToken);
132132

133+
public Task<StringResponse> SolveCloudflareChallengePageAsync(
134+
string siteUrl, string pageHtml, SessionParams? sessionParams = null, CancellationToken cancellationToken = default)
135+
=> _service.SolveCloudflareChallengePageAsync(siteUrl, pageHtml, sessionParams, cancellationToken);
136+
133137
public Task ReportSolutionAsync(string captchaId, CaptchaType type, bool correct,
134138
CancellationToken cancellationToken = default)
135139
=> _service.ReportSolutionAsync(captchaId, type, correct, cancellationToken);

RuriLib/Providers/Captchas/ICaptchaProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ Task<GeeTestV4Response> SolveGeeTestV4Async(
113113
string captchaId, string siteUrl,
114114
SessionParams? sessionParams = null, CancellationToken cancellationToken = default);
115115

116+
Task<StringResponse> SolveCloudflareChallengePageAsync(
117+
string siteUrl, string pageHtml,
118+
SessionParams? sessionParams = null, CancellationToken cancellationToken = default);
119+
116120
Task ReportSolutionAsync(
117121
string id, CaptchaType type, bool correct = false, CancellationToken cancellationToken = default);
118122
}

RuriLib/RuriLib.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ItemGroup>
1010
<PackageReference Include="AngleSharp" Version="1.1.2" />
1111
<PackageReference Include="BCrypt.Net-Core" Version="1.6.0" />
12-
<PackageReference Include="CaptchaSharp" Version="2.0.0" />
12+
<PackageReference Include="CaptchaSharp" Version="2.1.0" />
1313
<PackageReference Include="DeviceId" Version="5.2.0" />
1414
<PackageReference Include="FluentFTP" Version="50.0.1" />
1515
<PackageReference Include="HtmlAgilityPack" Version="1.11.61" />

openbullet2-web-client/src/app/main/components/rl-settings/rl-settings.component.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,17 @@ <h3>Captchas</h3>
565565
placeholder="API_KEY" />
566566
</div>
567567
</div>
568+
<div class="row my-3" *ngIf="settings.captchaSettings.currentService === CaptchaServiceType.Aycd">
569+
<div class="col-12">
570+
<span class="mr-2">AYCD API Key</span>
571+
<app-input-text key="aycdApiKey"
572+
class="input-small" [style]="{ width: '600px' }"
573+
(touched)="touched = true" ngDefaultControl
574+
(validityChange)="onValidityChange($event)"
575+
[(ngModel)]="settings.captchaSettings.aycdApiKey"
576+
placeholder="API_KEY" />
577+
</div>
578+
</div>
568579
<div class="row my-3">
569580
<div class="col-12">
570581
<button class="button button-secondary"

openbullet2-web-client/src/app/main/components/rl-settings/rl-settings.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export class RlSettingsComponent implements OnInit, DeactivatableComponent {
7474
CaptchaServiceType.EndCaptcha,
7575
CaptchaServiceType.BestCaptchaSolver,
7676
CaptchaServiceType.CapGuru,
77+
CaptchaServiceType.Aycd,
7778
];
7879
CaptchaServiceType = CaptchaServiceType;
7980

openbullet2-web-client/src/app/main/dtos/settings/rl-settings.dto.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export enum CaptchaServiceType {
3131
EndCaptcha = 'endCaptcha',
3232
BestCaptchaSolver = 'bestCaptchaSolver',
3333
CapGuru = 'capGuru',
34+
Aycd = 'aycd',
3435
}
3536

3637
export enum BrowserType {
@@ -99,6 +100,7 @@ export interface CaptchaRLSettings {
99100
endCaptchaUsername: string;
100101
endCaptchaPassword: string;
101102
capGuruApiKey: string;
103+
aycdApiKey: string;
102104
}
103105

104106
export interface ProxyRLSettings {

0 commit comments

Comments
 (0)