diff --git a/app/Services/PageScrapper.php b/app/Services/PageScrapper.php index 21fa781..8dd6658 100644 --- a/app/Services/PageScrapper.php +++ b/app/Services/PageScrapper.php @@ -35,6 +35,13 @@ class PageScrapper $content = str_replace($el, 'https://mkgtu.ru' . $el, $content); } } + $rez = preg_match_all('/src="(.*)">/isU', $content, $arr); + $arr[1] = array_unique($arr[1]); + foreach ($arr[1] as $el) { + if (!str_starts_with($el, 'https') && str_contains($el, 'upload')) { + $content = str_replace($el, 'https://mkgtu.ru' . $el, $content); + } + } return $content; } @@ -43,8 +50,12 @@ class PageScrapper $arr = []; + // + //safdsaf sdfdasf