修复短视频解析工具

This commit is contained in:
net909
2025-09-20 17:10:47 +08:00
parent ad228a550b
commit f5a6c11dda
19 changed files with 1766 additions and 18 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace plugin\utility\imghosting\api;
use Exception;
use plugin\utility\imghosting\api;
use think\helper\Str;
class pngcm implements api
{
public function upload($filepath, $filename){
$url = 'https://img.wnflb2023.com/application/upload.php';
$file = new \CURLFile($filepath);
$file->setPostFilename($filename);
$param = [
'name' => $filename,
'uuid' => 'o_'.Str::random(27),
'sign' => time(),
'file' => $file,
];
$data = get_curl($url,$param,'https://img.wnflb2023.com/');
$arr = json_decode($data,true);
if(isset($arr['code']) && $arr['code']==200){
return ['url'=>$arr['url']];
}elseif(isset($arr['message'])){
throw new Exception('上传失败请重试('.$arr['message'].'');
}else{
throw new Exception('上传失败!接口错误');
}
}
}