Skip to content

Commit

Permalink
[build] New staging version
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
openbullet committed Aug 12, 2024
1 parent 97c4fc1 commit cd07dad
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 3 deletions.
10 changes: 10 additions & 0 deletions OpenBullet2.Native/ViewModels/RLSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,16 @@ public string CapGuruApiKey
OnPropertyChanged();
}
}

public string AycdApiKey
{
get => Captcha.AycdApiKey;
set
{
Captcha.AycdApiKey = value;
OnPropertyChanged();
}
}

public string PuppeteerChromeBinaryLocation
{
Expand Down
11 changes: 11 additions & 0 deletions OpenBullet2.Native/Views/Pages/RLSettings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,17 @@
</StackPanel>
</StackPanel>
</TabItem>

<!-- AYCD -->
<TabItem>
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<Label>Api Key</Label>
<TextBox Text="{Binding AycdApiKey}"
Width="400"></TextBox>
</StackPanel>
</StackPanel>
</TabItem>
</TabControl>
<Button x:Name="checkBalanceButton"
Click="CheckCaptchaBalance"
Expand Down
22 changes: 20 additions & 2 deletions RuriLib/Blocks/Captchas/Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,14 @@ public static async Task<string> SolveRecaptchaMobile(BotData data, string appPa
extraInfo =
"The response will be a list and its elements are (in order) captcha id, lot number, pass token, gen time, captcha output")]
public static async Task<List<string>> SolveGeeTestV4Captcha(BotData data, string captchaId,
string siteUrl, string userAgent =
string siteUrl, bool useProxy = false, string userAgent =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36")
{
data.Logger.LogHeader();
await CheckBalanceAsync(data).ConfigureAwait(false);

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

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

[Block("Solves a Cloudflare Challenge page",
extraInfo = "The response will contain the value of the cf_clearance cookie")]
public static async Task<string> SolveCloudflareChallengePage(BotData data,
string siteUrl, string pageHtml, bool useProxy = false, string userAgent =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36")
{
data.Logger.LogHeader();
await CheckBalanceAsync(data).ConfigureAwait(false);

var response = await data.Providers.Captcha.SolveCloudflareChallengePageAsync(
siteUrl, pageHtml,
CreateSessionParams(data, useProxy, userAgent), data.CancellationToken).ConfigureAwait(false);

AddCaptchaId(data, response.Id, CaptchaType.CloudflareChallengePage);
data.Logger.Log($"Got solution: {response.Response}", LogColors.ElectricBlue);
return response.Response;
}

[Block("Reports an incorrectly solved captcha to the service in order to get funds back")]
public static async Task ReportLastSolution(BotData data)
{
Expand Down
1 change: 1 addition & 0 deletions RuriLib/Functions/Captchas/CaptchaServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static CaptchaService GetService(CaptchaSettings settings)
CaptchaServiceType.EndCaptcha => new EndCaptchaService(settings.EndCaptchaUsername, settings.EndCaptchaPassword),
CaptchaServiceType.BestCaptchaSolver => new BestCaptchaSolverService(settings.BestCaptchaSolverApiKey),
CaptchaServiceType.CapGuru => new CapGuruService(settings.CapGuruApiKey),
CaptchaServiceType.Aycd => new AycdService(settings.AycdApiKey),
_ => throw new NotSupportedException(),
};

Expand Down
3 changes: 3 additions & 0 deletions RuriLib/Functions/Captchas/CaptchaServiceType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@ public enum CaptchaServiceType

/// <summary>The service provided by https://cap.guru/</summary>
CapGuru = 27,

/// <summary>The service provided by https://aycd.io/</summary>
Aycd = 28,
}
1 change: 1 addition & 0 deletions RuriLib/Models/Settings/CaptchaSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ public class CaptchaSettings
public string EndCaptchaUsername { get; set; } = "";
public string EndCaptchaPassword { get; set; } = "";
public string CapGuruApiKey { get; set; } = "";
public string AycdApiKey { get; set; } = "";
}
4 changes: 4 additions & 0 deletions RuriLib/Providers/Captchas/CaptchaSharpProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ public Task<GeeTestV4Response> SolveGeeTestV4Async(
string captchaId, string siteUrl, SessionParams? sessionParams = null, CancellationToken cancellationToken = default)
=> _service.SolveGeeTestV4Async(captchaId, siteUrl, sessionParams, cancellationToken);

public Task<StringResponse> SolveCloudflareChallengePageAsync(
string siteUrl, string pageHtml, SessionParams? sessionParams = null, CancellationToken cancellationToken = default)
=> _service.SolveCloudflareChallengePageAsync(siteUrl, pageHtml, sessionParams, cancellationToken);

public Task ReportSolutionAsync(string captchaId, CaptchaType type, bool correct,
CancellationToken cancellationToken = default)
=> _service.ReportSolutionAsync(captchaId, type, correct, cancellationToken);
Expand Down
4 changes: 4 additions & 0 deletions RuriLib/Providers/Captchas/ICaptchaProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ Task<GeeTestV4Response> SolveGeeTestV4Async(
string captchaId, string siteUrl,
SessionParams? sessionParams = null, CancellationToken cancellationToken = default);

Task<StringResponse> SolveCloudflareChallengePageAsync(
string siteUrl, string pageHtml,
SessionParams? sessionParams = null, CancellationToken cancellationToken = default);

Task ReportSolutionAsync(
string id, CaptchaType type, bool correct = false, CancellationToken cancellationToken = default);
}
2 changes: 1 addition & 1 deletion RuriLib/RuriLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.1.2" />
<PackageReference Include="BCrypt.Net-Core" Version="1.6.0" />
<PackageReference Include="CaptchaSharp" Version="2.0.0" />
<PackageReference Include="CaptchaSharp" Version="2.1.0" />
<PackageReference Include="DeviceId" Version="5.2.0" />
<PackageReference Include="FluentFTP" Version="50.0.1" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.61" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,17 @@ <h3>Captchas</h3>
placeholder="API_KEY" />
</div>
</div>
<div class="row my-3" *ngIf="settings.captchaSettings.currentService === CaptchaServiceType.Aycd">
<div class="col-12">
<span class="mr-2">AYCD API Key</span>
<app-input-text key="aycdApiKey"
class="input-small" [style]="{ width: '600px' }"
(touched)="touched = true" ngDefaultControl
(validityChange)="onValidityChange($event)"
[(ngModel)]="settings.captchaSettings.aycdApiKey"
placeholder="API_KEY" />
</div>
</div>
<div class="row my-3">
<div class="col-12">
<button class="button button-secondary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class RlSettingsComponent implements OnInit, DeactivatableComponent {
CaptchaServiceType.EndCaptcha,
CaptchaServiceType.BestCaptchaSolver,
CaptchaServiceType.CapGuru,
CaptchaServiceType.Aycd,
];
CaptchaServiceType = CaptchaServiceType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export enum CaptchaServiceType {
EndCaptcha = 'endCaptcha',
BestCaptchaSolver = 'bestCaptchaSolver',
CapGuru = 'capGuru',
Aycd = 'aycd',
}

export enum BrowserType {
Expand Down Expand Up @@ -99,6 +100,7 @@ export interface CaptchaRLSettings {
endCaptchaUsername: string;
endCaptchaPassword: string;
capGuruApiKey: string;
aycdApiKey: string;
}

export interface ProxyRLSettings {
Expand Down

0 comments on commit cd07dad

Please sign in to comment.