|
...
|
...
|
@@ -11,6 +11,7 @@ namespace App\Console\Commands\Test; |
|
|
|
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Models\Template\BTemplateCommon;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
...
|
...
|
@@ -54,10 +55,9 @@ class EditVideoMp4 extends Command |
|
|
|
*/
|
|
|
|
public function getHtml(){
|
|
|
|
$templateModel = new BTemplate();
|
|
|
|
$list = $templateModel->list(['id'=>1]);
|
|
|
|
foreach ($list as $k1 => $v1){
|
|
|
|
echo date('Y-m-d H:i:s') . '更新的id:'.$v1['id'] . PHP_EOL;
|
|
|
|
$this->getVideoSrc($v1['id'],$v1['main_html'],'main_html');
|
|
|
|
$templateList = $templateModel->list();
|
|
|
|
foreach ($templateList as $v1){
|
|
|
|
$this->getVideoSrc($v1['id'],$v1['main_html'],'main_html',$templateModel);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
...
|
...
|
@@ -69,17 +69,15 @@ class EditVideoMp4 extends Command |
|
|
|
* @method :post
|
|
|
|
* @time :2024/4/16 9:46
|
|
|
|
*/
|
|
|
|
public function getVideoSrc($id,$html,$filed){
|
|
|
|
$main_html = $html;
|
|
|
|
public function getVideoSrc($id,$html,$filed,$model){
|
|
|
|
$pattern = '/<video.*?src="([^"]+)"[^>]*>/i';
|
|
|
|
preg_match_all($pattern, $html, $matches);
|
|
|
|
$srcLinks = $matches[1];
|
|
|
|
foreach ($srcLinks as $link) {
|
|
|
|
$newLink = str_replace('v6-file.globalso.com','ecdn6.globalso.com', $link);
|
|
|
|
$main_html = str_replace($link, $newLink, $main_html);
|
|
|
|
$newLink = str_replace('ecdn6.globalso.com','v6-file.globalso.com', $link);
|
|
|
|
$html = str_replace($link, $newLink, $html);
|
|
|
|
}
|
|
|
|
$templateModel = new BTemplate();
|
|
|
|
$templateModel->edit([$filed=>$main_html],['id'=>$id]);
|
|
|
|
$model->edit([$filed=>$html],['id'=>$id]);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|