|
@@ -390,6 +390,7 @@ class HtmlCollect extends Command |
|
@@ -390,6 +390,7 @@ class HtmlCollect extends Command |
|
390
|
$js_html = curl_c(getImageUrl($new_source), false);
|
390
|
$js_html = curl_c(getImageUrl($new_source), false);
|
|
391
|
preg_match_all("/[large|thumb]+URL:['\"]+(\s*[^>]+?)['\"]+,/i", $js_html, $result_js_source);
|
391
|
preg_match_all("/[large|thumb]+URL:['\"]+(\s*[^>]+?)['\"]+,/i", $js_html, $result_js_source);
|
|
392
|
$js_source = $result_js_source[1] ?? [];
|
392
|
$js_source = $result_js_source[1] ?? [];
|
|
|
|
393
|
+ if($js_source){
|
|
393
|
foreach ($js_source as $vjs) {
|
394
|
foreach ($js_source as $vjs) {
|
|
394
|
$vjs_result = $this->url_check($vjs, $project_id, $domain, $web_url_domain, $home_url);
|
395
|
$vjs_result = $this->url_check($vjs, $project_id, $domain, $web_url_domain, $home_url);
|
|
395
|
if (!$vjs_result) {
|
396
|
if (!$vjs_result) {
|
|
@@ -416,7 +417,39 @@ class HtmlCollect extends Command |
|
@@ -416,7 +417,39 @@ class HtmlCollect extends Command |
|
416
|
CosService::uploadRemote($project_id, 'source', $new_source, $new_source, $js_html);
|
417
|
CosService::uploadRemote($project_id, 'source', $new_source, $new_source, $js_html);
|
|
417
|
}
|
418
|
}
|
|
418
|
}
|
419
|
}
|
|
|
|
420
|
+ }
|
|
|
|
421
|
+ } elseif(substr($vs['url_complete'], -2, 2) == 'js') {
|
|
|
|
422
|
+
|
|
|
|
423
|
+ $js_html = curl_c(getImageUrl($vs['url_complete']), false);
|
|
|
|
424
|
+ preg_match_all("/[large|thumb]+URL:['\"]+(\s*[^>]+?)['\"]+,/i", $js_html, $result_js_source);
|
|
|
|
425
|
+ $js_source = $result_js_source[1] ?? [];
|
|
|
|
426
|
+ if($js_source){
|
|
|
|
427
|
+ foreach ($js_source as $vjs) {
|
|
|
|
428
|
+ $vjs_result = $this->url_check($vjs, $project_id, $domain, $web_url_domain, $home_url);
|
|
|
|
429
|
+ if (!$vjs_result) {
|
|
|
|
430
|
+ continue;
|
|
|
|
431
|
+ }
|
|
|
|
432
|
+
|
|
|
|
433
|
+ if ($vjs_result['download']) {
|
|
|
|
434
|
+ $new_vjs = CosService::uploadRemote($project_id, 'source', $vjs_result['url_complete']);
|
|
|
|
435
|
+ if ($new_vjs) {
|
|
|
|
436
|
+ CollectSource::insert([
|
|
|
|
437
|
+ 'project_id' => $project_id,
|
|
|
|
438
|
+ 'origin' => $vjs_result['url'],
|
|
|
|
439
|
+ 'target' => $new_vjs,
|
|
|
|
440
|
+ 'created_at' => date('Y-m-d H:i:s'),
|
|
|
|
441
|
+ 'updated_at' => date('Y-m-d H:i:s'),
|
|
|
|
442
|
+ ]);
|
|
|
|
443
|
+ $js_html = str_replace($vjs, getImageUrl($new_vjs), $js_html);
|
|
|
|
444
|
+ }
|
|
419
|
} else {
|
445
|
} else {
|
|
|
|
446
|
+ $js_html = str_replace($vjs, getImageUrl($vjs_result['url_complete']), $js_html);
|
|
|
|
447
|
+ }
|
|
|
|
448
|
+ }
|
|
|
|
449
|
+
|
|
|
|
450
|
+ CosService::uploadRemote($project_id, 'source', $vs['url_complete'], $vs['url_complete'], $js_html);
|
|
|
|
451
|
+ }
|
|
|
|
452
|
+ }else{
|
|
420
|
$html = str_replace($vs['url'], getImageUrl($vs['url_complete']), $html);
|
453
|
$html = str_replace($vs['url'], getImageUrl($vs['url_complete']), $html);
|
|
421
|
}
|
454
|
}
|
|
422
|
}
|
455
|
}
|