proxy wip

This commit is contained in:
salam committed 2025-12-18 20:29:34 +01:00
1 parent 5c9745b1da
commit d16a8a3a1f
9 files changed
+144 -42

No files matched your search

+16 -9
View File
@@ -29,26 +29,33 @@ class Curl
return json_decode($file, true);
}
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
if ($proxy) {
$request = curl_init('https://proxydb1.nuhodds.com');
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($request, CURLOPT_HTTPHEADER, [
'Proxy-Auth: $2y$12$/iKduDrM9HJA6T6t/5e5x.nkQ9KUNWLvTXhRwdU.EN2Twfwlr4jzu',
'Proxy-Auth: iKduDrM9HJA6T6t5e5xnkQ9KUNWLvTXhRwdUEN2Twfwlr4jzu',
'Proxy-Target-URL: '.$url,
]);
return curl_exec($request);
} else {
$request = curl_init($url);
curl_setopt($request, CURLOPT_TIMEOUT, 30);
curl_setopt($request, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_FAILONERROR, true);
}
$data = curl_exec($ch);
$curl_errorno = curl_errno($ch);
$data = curl_exec($request);
$curl_errorno = curl_errno($request);
if ($curl_errorno) {
Notice::note('curl_errorno: '.self::curlerrorcode($curl_errorno));
}
if (PHP_VERSION_ID < 80000) {
curl_close($ch);
curl_close($request);
}
if ($save) {
+6 -13
View File
@@ -2,28 +2,21 @@
namespace App\Console\Commands\Grapper;
use App\Console\Commands\Grapper\Magloo\Fixtures;
use App\Console\Commands\Grapper\Magloo\Odds;
use App\Console\Commands\Nuh;
use App\Models\Sport;
use App\Utilities\Notice;
class Magloo
{
public static function switch()
{
$sportmap = Sport::map('magl');
dd($sportmap);
switch (Nuh::$options['sport_id']) {
case 1:
switch (Nuh::$options['name']) {
case 'Fixtures':
Fixtures::grap();
break;
case 3:
break;
case 4:
break;
case 5:
case 'Odds':
Odds::grap();
break;
default:
Notice::note('prosses name does not exist', 'r', 1);
@@ -0,0 +1,49 @@
<?php
namespace App\Console\Commands\Grapper\Magloo;
use App\Console\Commands\Curl;
use App\Console\Commands\Nuh;
use App\Models\Sport;
use App\Utilities\Notice;
class Fixtures
{
public static function grap()
{
$debug = Nuh::$options['d'] ?? 0;
$test = Nuh::$options['t'] ?? 0;
$echo = Nuh::$options['e'] ?? 0;
switch (Nuh::$options['provider_id']) {
case 3:
// KENIA
if ($test) {
$url = 'https://int.external.api.algorez.com/api/sb/affiliates/30/en/1/prematch';
} else {
$url = 'https://api.externalsvc.com/api/sb/affiliates/30/en/1/prematch';
}
break;
case 4:
// NIGERIA
if ($test) {
$base_url = 'https://int.external.api.algorez.com/api/sb/affiliates/20/en/1/prematch';
} else {
$url = 'https://api.externalsvc.com/api/sb/affiliates/20/en/1/prematch';
}
break;
default:
Notice::note('prosses name does not exist', 'r', 1);
break;
}
$sportmap = Sport::map('magl');
$url = $base_url.'/sport';
$url = 'https://www.github.com';
$_data = Curl::load($url, 1);
dd($_data);
}
}
@@ -0,0 +1,48 @@
<?php
namespace App\Console\Commands\Grapper\Magloo;
use App\Console\Commands\Curl;
use App\Console\Commands\Nuh;
use App\Models\Sport;
use App\Utilities\Notice;
class Odds
{
public static function grap()
{
$debug = Nuh::$options['d'] ?? 0;
$test = Nuh::$options['t'] ?? 0;
$echo = Nuh::$options['e'] ?? 0;
switch (Nuh::$options['provider_id']) {
case 3:
// KENIA
if ($test) {
$base_url = 'https://int.external.api.algorez.com/api/sb/affiliates/30/en/1/prematch/sport';
} else {
$base_url = 'https://api.externalsvc.com/api/sb/affiliates/30/en/1/prematch/sport';
}
break;
case 4:
// NIGERIA
if ($test) {
$base_url = 'https://int.external.api.algorez.com/api/sb/affiliates/20/en/1/prematch/sport';
} else {
$base_url = 'https://api.externalsvc.com/api/sb/affiliates/20/en/1/prematch/sport';
}
break;
default:
Notice::note('prosses name does not exist', 'r', 1);
break;
}
$sportmap = Sport::map('magl');
$_data = Curl::load($url, 1);
dd($_data);
}
}
-6
View File
@@ -24,12 +24,6 @@ class TxOdds
case 'Odds':
Odds::grap();
break;
case 3:
break;
case 4:
break;
case 5:
break;
default:
Notice::note('prosses name does not exist', 'r', 1);
break;
+14 -9
View File
@@ -24,7 +24,7 @@ class Nuh extends Command
public static $BETSAPI_TOKEN = '36152-aeTRNnZxSPUwGe';
protected $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--w} {--p} {--s} {--r} {--b} {--q}';
protected $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--w} {--p} {--e} {--s} {--r} {--b} {--q} {--t}';
protected $description = 'Nuh';
@@ -45,16 +45,21 @@ class Nuh extends Command
$txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL;
$txt .= 'List of options'.PHP_EOL;
$txt .= '----------------------------------------------'.PHP_EOL;
$txt .= '--d debug'.PHP_EOL;
$txt .= '--q print queries'.PHP_EOL;
$txt .= '--f force update market'.PHP_EOL;
$txt .= '--a reload all'.PHP_EOL;
$txt .= '--w reload one week'.PHP_EOL;
$txt .= '--p use proydb1'.PHP_EOL;
$txt .= '--e echo file'.PHP_EOL;
$txt .= '--s store data to file '.PHP_EOL;
$txt .= '--r read data from file '.PHP_EOL;
$txt .= '--b break loop after one '.PHP_EOL;
$txt .= '--d debug'.PHP_EOL;
$txt .= '--e echo file'.PHP_EOL;
$txt .= '--f force update market'.PHP_EOL;
$txt .= '--p use proydb1'.PHP_EOL;
$txt .= '--q print queries'.PHP_EOL;
$txt .= '--r read data from file '.PHP_EOL;
$txt .= '--s store data to file '.PHP_EOL;
$txt .= '--t test server url '.PHP_EOL;
$txt .= '--w reload one week'.PHP_EOL;
$txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL;
$txt .= 'List of supervisors'.PHP_EOL;
$txt .= '----------------------------------------------'.PHP_EOL;
@@ -5,6 +5,7 @@ namespace App\Filament\Resources\Supervisors\Tables;
use Filament\Actions\BulkActionGroup;
use Filament\Actions\DeleteBulkAction;
use Filament\Actions\EditAction;
use Filament\Tables\Columns\SelectColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Columns\ToggleColumn;
use Filament\Tables\Table;
@@ -17,7 +18,11 @@ class SupervisorsTable
->striped()
->columns([
TextColumn::make('id')->badge(),
TextColumn::make('name')->searchable(),
SelectColumn::make('name')
->options([
'Fixtures' => 'Fixtures',
'Odds' => 'Odds',
]),
TextColumn::make('provider.name')->badge(),
TextColumn::make('sport.name')->label('Sport'),
TextColumn::make('sleep')->numeric(),
+2 -1
View File
@@ -13,6 +13,7 @@ class Sport extends Model
Notice::note('Wrong Option! Possible options: bapi, bwin, b365, logi, magl', 'r', 1);
}
return Sport::select($field, 'id')->where('is_active', 1)->get()->useKey('id')->toArray();
return Sport::where('is_active', 1)->pluck($field, 'id')->toArray();
}
}
+3 -3
View File
@@ -14,9 +14,9 @@ class SupervisorSeeder extends Seeder
*/
$sql = "INSERT INTO `supervisors` (`id`, `name`, `provider_id`, `sport_id`, `sleep`, `limit`, `runtime`, `maxsconds`, `lastcall`, `is_cron`, `is_active`, `created_at`, `updated_at`)
VALUES
(1, 'Fixtures', 1, 1, 10, 0, '0.011', 1800, 0, 1, 1, '2025-08-27 07:39:55', '2025-12-18 11:45:11'),
(2, 'Odds', 1, 1, 10, 0, '0.016', 30, 0, 0, 1, '2025-12-01 05:41:02', '2025-12-18 11:51:54'),
(3, 'Magloo Nigeria Soccer', 4, 1, 10, 0, '0.001', 30, 0, 0, 1, '2025-12-18 17:44:33', '2025-12-18 17:46:31');
(1, 'Fixtures', 1, 1, 10, 0, '0.033', 1800, 0, 1, 1, '2025-08-27 07:39:55', '2025-12-18 18:00:40'),
(2, 'Odds', 1, 1, 10, 0, '0.07', 30, 0, 0, 1, '2025-12-01 05:41:02', '2025-12-18 18:00:50'),
(3, 'Fixtures', 4, 1, 10, 0, '0', 30, 0, 0, 1, '2025-12-18 17:44:33', '2025-12-18 18:41:36');
";
DB::unprepared($sql);