作者 lyh

gx

... ... @@ -35,7 +35,7 @@ class EditVideoMp4 extends Command
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['is_upgrade'=>0,'delete_status'=>0,'type'=>['!=',0],'id'=>['<=',500]]);
$list = $projectModel->list(['is_upgrade'=>0,'delete_status'=>0,'type'=>['!=',0],'id'=>['<=',320]]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
... ... @@ -76,11 +76,13 @@ class EditVideoMp4 extends Command
$pattern = '/<video.*?src="([^"]+)"[^>]*>/i';
preg_match_all($pattern, $html, $matches);
$srcLinks = $matches[1];
if(!empty($srcLinks)){
foreach ($srcLinks as $link) {
$newLink = str_replace('ecdn6.globalso.com','v6-file.globalso.com', $link);
$html = str_replace($link, $newLink, $html);
}
$model->edit([$filed=>$html],['id'=>$id]);
}
return true;
}
... ...