|
...
|
...
|
@@ -54,9 +54,10 @@ class EditVideoMp4 extends Command |
|
|
|
*/
|
|
|
|
public function getHtml(){
|
|
|
|
$templateModel = new BTemplate();
|
|
|
|
$list = $templateModel->list();
|
|
|
|
$list = $templateModel->list(['id'=>1]);
|
|
|
|
foreach ($list as $k1 => $v1){
|
|
|
|
$this->getVideoSrc($v1['main_html']);
|
|
|
|
echo date('Y-m-d H:i:s') . '更新的id:'.$v1['id'] . PHP_EOL;
|
|
|
|
$this->getVideoSrc($v1['id'],$v1['main_html']);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
...
|
...
|
@@ -68,18 +69,21 @@ class EditVideoMp4 extends Command |
|
|
|
* @method :post
|
|
|
|
* @time :2024/4/16 9:46
|
|
|
|
*/
|
|
|
|
public function getVideoSrc($html){
|
|
|
|
$videoArr = [];
|
|
|
|
public function getVideoSrc($id,$html){
|
|
|
|
$main_html = $html;
|
|
|
|
$pattern = '/<img.*?src=[\'"]([^\'"]+)[\'"].*?>/i';
|
|
|
|
preg_match_all($pattern, $html, $matches);
|
|
|
|
$srcLinks = $matches[1];
|
|
|
|
foreach ($srcLinks as $link) {
|
|
|
|
$videoArr[] = $link;
|
|
|
|
$newLink = str_replace('ecdn6.globalso.com', 'v6-file.globalso.com', $link);
|
|
|
|
$main_html = str_replace($link, $newLink, $main_html);
|
|
|
|
}
|
|
|
|
dd($videoArr);
|
|
|
|
return $videoArr;
|
|
|
|
$templateModel = new BTemplate();
|
|
|
|
$templateModel->edit(['main_html'=>$main_html],['id'=>$id]);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :复制表
|
|
|
|
* @name :copyTable
|
...
|
...
|
|