Logifuture proxy
This commit is contained in:
1 parent
a4bfecde02
commit
403cb8d08b
8 files changed
+135
-97
No files matched your search
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Console\Commands\Grapper;
|
||||
|
||||
use App\Console\Commands\Grapper\Logifuture\Auth;
|
||||
use App\Console\Commands\Grapper\Logifuture\BaseUrl;
|
||||
use App\Console\Commands\Grapper\Logifuture\Authentication;
|
||||
use App\Console\Commands\Grapper\Logifuture\Basketball;
|
||||
use App\Console\Commands\Grapper\Logifuture\Icehockey;
|
||||
use App\Console\Commands\Grapper\Logifuture\LogifutureData;
|
||||
use App\Console\Commands\Grapper\Logifuture\MapEvent;
|
||||
use App\Console\Commands\Grapper\Logifuture\Soccer;
|
||||
use App\Console\Commands\Grapper\Logifuture\Tennis;
|
||||
@@ -19,10 +19,25 @@ use App\Utilities\Notice;
|
||||
|
||||
class Logifuture
|
||||
{
|
||||
public static $auth_header = [];
|
||||
|
||||
public static $base_url = '';
|
||||
|
||||
public static function switch()
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
switch (Nuh::$options['provider_id']) {
|
||||
case 5:
|
||||
Nuh::$options['bookmaker_id'] = 35;
|
||||
self::$base_url = 'https://external-api.bet9ja.com/external';
|
||||
break;
|
||||
case 6:
|
||||
Nuh::$options['bookmaker_id'] = 36;
|
||||
self::$base_url = 'https://external-api.yajuego.co/external';
|
||||
break;
|
||||
}
|
||||
|
||||
$_elements = LoadElements::load(Nuh::$options['provider_id'], true);
|
||||
|
||||
$_groups = LoadGroups::load(Nuh::$options['provider_id'], true);
|
||||
@@ -35,50 +50,11 @@ class Logifuture
|
||||
Notice::note(Nuh::$options['provider']['name'].' '.Nuh::$options['sport']['name'], 'g');
|
||||
}
|
||||
|
||||
switch (Nuh::$options['provider_id']) {
|
||||
case 5:
|
||||
Nuh::$options['bookmaker_id'] = 35;
|
||||
break;
|
||||
case 6:
|
||||
Nuh::$options['bookmaker_id'] = 36;
|
||||
break;
|
||||
}
|
||||
Authentication::authenticate();
|
||||
|
||||
// https://external-api.bet9ja.com/external/v1/matches?sport_id=1
|
||||
// https://external-api.bet9ja.com/external
|
||||
foreach ($sportmap as $logifuture_sport_id => $sport_id) {
|
||||
|
||||
$data = Auth::exe();
|
||||
|
||||
$header = [];
|
||||
$header[] = 'Authorization: Bearer '.$data['token'];
|
||||
$header[] = 'accept: application/json';
|
||||
$header[] = 'content-type: application/json';
|
||||
|
||||
foreach ($sportmap as $client_sport_id => $sport_id) {
|
||||
$post_fields = [
|
||||
'url' => BaseUrl::get().'/v1/matches?sportId='.$client_sport_id,
|
||||
'header' => json_encode($header),
|
||||
];
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
if (config('env.app_env') == 'local') {
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
|
||||
curl_setopt($ch, CURLOPT_URL, 'https://proxydb1.nuhodds.com/logifuture.php');
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Proxy-Auth: AIkcoRnipSgMK88WMQhOQQN3LKDrNDCIebNfPnEayJdmDeTigx',
|
||||
]);
|
||||
} else {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
||||
}
|
||||
|
||||
$file = curl_exec($ch);
|
||||
|
||||
$matches = json_decode($file, 1);
|
||||
$matches = LogifutureData::load($logifuture_sport_id);
|
||||
|
||||
if (! isset($matches['error'])) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user