diff --git a/app/Sources/Apero.php b/app/Sources/Apero.php index 4993295..399d4ed 100644 --- a/app/Sources/Apero.php +++ b/app/Sources/Apero.php @@ -24,7 +24,7 @@ use \App\Models\Language; use \App\Models\Author; use \App\Models\Tag; use \App\Source; -use Log; +use Illuminate\Support\Facades\Log; /** * Парсер для Apero.ru @@ -49,12 +49,17 @@ class Apero extends Source { $this->loadStr($text); $this->parseIndex(); foreach ($this->urls as $url) { - $text = $this->get_text($url); - $text = mb_convert_encoding($text, 'UTF-8', 'auto'); - $this->loadStr($text); - $this->page($url); + try { + $text = $this->get_text($url); + $text = mb_convert_encoding($text, 'UTF-8', 'auto'); + $this->loadStr($text); + $this->page($url); + } catch (\Exception $e) { + Log::error($e->getMessage()); + continue; + } } - } + } public function parseIndex() {