有人用过七牛云内容审核吗

有大佬用过七牛云API调用视频审核吗?
看官方文档只有python代码示例,自己用PHP请求一直失败..
PHP相关的示例也Google不到,烦请有示例的大佬发一份参考下

阅读 3.2k
1 个回答
<?php
require './autoload.php';
use \Qiniu\Auth;
use Qiniu\Http\Client;
  
$accessKey = 'xxx';
$secretKey = 'xxx';
$auth = new Auth($accessKey, $secretKey);
  
$url = "http://ai.qiniuapi.com/v3/video/censor";
$method = "POST";
$host = "ai.qiniuapi.com";
$body = "{ \"data\": { \"uri\": \"http://xxx/xxx.mp4\" } ,\"params\": {\"scenes\": [\"pulp\",\"terror\",\"politician\"]}}";
$contentType = "application/json";
$headers = $auth->authorizationV2($url, $method, $body, $contentType);
$headers['Content-Type'] = $contentType;
$headers['Host'] = $host;
  
$response = Client::post($url, $body, $headers);
  
if ($response->ok()) {
    $r=$response->json();
    var_dump($r);
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
七牛云问答
子站问答
访问
宣传栏