|
...
|
...
|
@@ -418,39 +418,39 @@ class HtmlCollect extends Command |
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} elseif(substr($vs['url_complete'], -2, 2) == 'js') {
|
|
|
|
|
|
|
|
$js_html = curl_c(getImageUrl($vs['url_complete']), false);
|
|
|
|
preg_match_all("/[large|thumb]+URL:['\"]+(\s*[^>]+?)['\"]+,/i", $js_html, $result_js_source);
|
|
|
|
$js_source = $result_js_source[1] ?? [];
|
|
|
|
if($js_source){
|
|
|
|
foreach ($js_source as $vjs) {
|
|
|
|
$vjs_result = $this->url_check($vjs, $project_id, $domain, $web_url_domain, $home_url);
|
|
|
|
if (!$vjs_result) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$html = str_replace($vs['url'], getImageUrl($vs['url_complete']), $html);
|
|
|
|
if(substr($vs['url_complete'], -2, 2) == 'js'){
|
|
|
|
$js_html = curl_c(getImageUrl($vs['url_complete']), false);
|
|
|
|
preg_match_all("/[large|thumb]+URL:['\"]+(\s*[^>]+?)['\"]+,/i", $js_html, $result_js_source);
|
|
|
|
$js_source = $result_js_source[1] ?? [];
|
|
|
|
if($js_source){
|
|
|
|
foreach ($js_source as $vjs) {
|
|
|
|
$vjs_result = $this->url_check($vjs, $project_id, $domain, $web_url_domain, $home_url);
|
|
|
|
if (!$vjs_result) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($vjs_result['download']) {
|
|
|
|
$new_vjs = CosService::uploadRemote($project_id, 'source', $vjs_result['url_complete']);
|
|
|
|
if ($new_vjs) {
|
|
|
|
CollectSource::insert([
|
|
|
|
'project_id' => $project_id,
|
|
|
|
'origin' => $vjs_result['url'],
|
|
|
|
'target' => $new_vjs,
|
|
|
|
'created_at' => date('Y-m-d H:i:s'),
|
|
|
|
'updated_at' => date('Y-m-d H:i:s'),
|
|
|
|
]);
|
|
|
|
$js_html = str_replace($vjs, getImageUrl($new_vjs), $js_html);
|
|
|
|
if ($vjs_result['download']) {
|
|
|
|
$new_vjs = CosService::uploadRemote($project_id, 'source', $vjs_result['url_complete']);
|
|
|
|
if ($new_vjs) {
|
|
|
|
CollectSource::insert([
|
|
|
|
'project_id' => $project_id,
|
|
|
|
'origin' => $vjs_result['url'],
|
|
|
|
'target' => $new_vjs,
|
|
|
|
'created_at' => date('Y-m-d H:i:s'),
|
|
|
|
'updated_at' => date('Y-m-d H:i:s'),
|
|
|
|
]);
|
|
|
|
$js_html = str_replace($vjs, getImageUrl($new_vjs), $js_html);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$js_html = str_replace($vjs, getImageUrl($vjs_result['url_complete']), $js_html);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$js_html = str_replace($vjs, getImageUrl($vjs_result['url_complete']), $js_html);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CosService::uploadRemote($project_id, 'source', $vs['url_complete'], $vs['url_complete'], $js_html);
|
|
|
|
CosService::uploadRemote($project_id, 'source', $vs['url_complete'], $vs['url_complete'], $js_html);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$html = str_replace($vs['url'], getImageUrl($vs['url_complete']), $html);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|