From 6d8d5f9136c6ea4ece6166526d7060bb32c38d44 Mon Sep 17 00:00:00 2001 From: salam Date: Sun, 7 Jun 2026 07:53:18 +0200 Subject: [PATCH] wip curl --- app/Console/Commands/Curl.php | 1 - app/Console/Commands/Grapper/Sofascore.php | 2 +- .../Commands/Grapper/Sofascore/Tournament.php | 12 +++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/Curl.php b/app/Console/Commands/Curl.php index 95fb0fc4..cd0f4255 100644 --- a/app/Console/Commands/Curl.php +++ b/app/Console/Commands/Curl.php @@ -218,7 +218,6 @@ class Curl 82 => 'CURLE_SSL_CRL_BADFILE', 83 => 'CURLE_SSL_ISSUER_ERROR', 84 => 'CURLE_FTP_PRET_FAILED', - 84 => 'CURLE_FTP_PRET_FAILED', 85 => 'CURLE_RTSP_CSEQ_ERROR', 86 => 'CURLE_RTSP_SESSION_ERROR', 87 => 'CURLE_FTP_BAD_FILE_LIST', diff --git a/app/Console/Commands/Grapper/Sofascore.php b/app/Console/Commands/Grapper/Sofascore.php index dc911276..8eadcf4a 100644 --- a/app/Console/Commands/Grapper/Sofascore.php +++ b/app/Console/Commands/Grapper/Sofascore.php @@ -27,7 +27,7 @@ class Sofascore SofaScoreTournament::truncate(); SofaScoreDay::truncate(); SofaScoreCategorie::truncate(); - Notice::note('Table SofaScoreDayTournament, SofaScoreTournament, SofaScoreCategorie truncated', 'b', 1); + Notice::note('Table SofaScoreDay, SofaScoreDayTournament, SofaScoreTournament, SofaScoreCategorie truncated!', 'b', 1); } if ($debug) { diff --git a/app/Console/Commands/Grapper/Sofascore/Tournament.php b/app/Console/Commands/Grapper/Sofascore/Tournament.php index cc3f0750..367b76d9 100644 --- a/app/Console/Commands/Grapper/Sofascore/Tournament.php +++ b/app/Console/Commands/Grapper/Sofascore/Tournament.php @@ -46,8 +46,6 @@ class Tournament Notice::note('Grapping Sport: '.Nuh::$options['sport'].' Day: '.$day, 'g'); } - SofaScoreDay::updateOrCreate(['day' => $day], [$sport->ss_slug => 1]); - $page = 1; while ($page) { @@ -59,7 +57,13 @@ class Tournament } usleep($rand); - $data = Curl::load($url); + // $data = Curl::load($url); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($ch); + $data = json_decode($response, true); if ($data['hasNextPage']) { $page++; @@ -151,6 +155,8 @@ class Tournament Notice::note("tournaments: $tournaments_counter", 'p'); + SofaScoreDay::updateOrCreate(['day' => $day], [$sport->ss_slug => 1]); + } if (Nuh::$options['test']) {