Skip to content

Commit ad45c2a

Browse files
Yidun added
1 parent ce46577 commit ad45c2a

5 files changed

Lines changed: 99 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Examples of API requests for different captcha types are available on the [PHP c
5050
- [VK Image](#vk-image)
5151
- [Altchacaptcha](#altchacaptcha)
5252
- [Binancecaptcha](#binancecaptcha)
53+
- [Yidun](#yidun)
5354
- [Other methods](#other-methods)
5455
- [send / getResult](#send--getresult)
5556
- [balance](#balance)
@@ -550,7 +551,7 @@ Use this method to bypass Altchacaptcha.
550551

551552
<sup>[API method description.](https://2captcha.com/2captcha-api#binance)</sup>
552553

553-
Use this method to bypass binance.
554+
Use this method to bypass Binance.
554555

555556
```php
556557
$result = $solver->binance([
@@ -560,6 +561,20 @@ Use this method to bypass binance.
560561
]);
561562
```
562563

564+
### Yidun
565+
566+
<sup>[API method description.](https://2captcha.com/2captcha-api#yidun)</sup>
567+
568+
Use this method to bypass Yidun.
569+
570+
```php
571+
$result = $solver->yidun([
572+
'sitekey' => '0f743r3g1...8rz3grz0ym5',
573+
'url' => 'https://example.com/page-with-yidun'
574+
]);
575+
```
576+
577+
563578
## Other methods
564579

565580
### send / getResult

examples/yidun.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
use TwoCaptcha\TwoCaptcha;
3+
4+
require(__DIR__ . '/../src/autoloader.php');
5+
6+
//$argv[1] = YOUR_API_KEY
7+
$solver = new TwoCaptcha($argv[1]);
8+
9+
try {
10+
$result = $solver->yidun([
11+
'sitekey' => '0f743r3g1...8rz3grz0ym5',
12+
'url' => 'https://example.com/page-with-yidun'
13+
]);
14+
} catch (\Exception $e) {
15+
die($e->getMessage());
16+
}
17+
18+
die('Captcha solved: ' . $result->code);

examples/yidun_options.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
use TwoCaptcha\TwoCaptcha;
3+
4+
require(__DIR__ . '/../src/autoloader.php');
5+
6+
//$argv[1] = YOUR_API_KEY
7+
$solver = new TwoCaptcha($argv[1]);
8+
9+
try {
10+
$result = $solver->yidun([
11+
'sitekey' => '0f743r3g1...8rz3grz0ym5',
12+
'url' => 'https://example.com/page-with-yidun',
13+
'proxy' => [
14+
'type' => 'HTTPS',
15+
'uri' => 'login:password@IP_address:PORT',
16+
],
17+
]);
18+
} catch (\Exception $e) {
19+
die($e->getMessage());
20+
}
21+
22+
die('Captcha solved: ' . $result->code);

src/TwoCaptcha.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,13 @@ public function binance($captcha)
698698
return $this->solve($captcha);
699699
}
700700

701+
public function yidun($captcha)
702+
{
703+
$captcha['method'] = 'yidun';
704+
705+
return $this->solve($captcha);
706+
}
707+
701708
/**
702709
* Sends captcha to `/in.php` and waits for it's result.
703710
* This helper can be used insted of manual using of `send` and `getResult` functions.

tests/YidunTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace TwoCaptcha\Tests;
4+
5+
class YidunTest extends AbstractWrapperTestCase
6+
{
7+
protected $method = 'yidun';
8+
9+
public function testAllOptions()
10+
{
11+
$params = [
12+
'sitekey' => '0f743r3g1...8rz3grz0ym5',
13+
'url' => 'https://example.com/page-with-yidun',
14+
'proxy' => [
15+
'type' => 'HTTPS',
16+
'uri' => 'login:password@IP_address:PORT',
17+
]
18+
];
19+
20+
$sendParams = [
21+
'method' => 'yidun',
22+
'sitekey' => '0f743r3g1...8rz3grz0ym5',
23+
'pageurl' => 'https://example.com/page-with-yidun',
24+
'proxy' => 'login:password@IP_address:PORT',
25+
'proxytype' => 'HTTPS',
26+
'soft_id' => '4585',
27+
'json' => '0'
28+
];
29+
30+
$this->checkIfCorrectParamsSendAndResultReturned([
31+
'params' => $params,
32+
'sendParams' => $sendParams,
33+
'sendFiles' => [],
34+
]);
35+
}
36+
}

0 commit comments

Comments
 (0)