全部产品
云市场

媒体审核

更新时间:2019-01-30 16:45:20

初始化客户端

使用前请先初始化客户端,参考 initVodClient 接口。

提交智能审核作业

接口参数和返回字段请参考 SubmitAIMediaAuditJob

  1. // 调用样例
  2. var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');
  3. client.request("SubmitAIMediaAuditJob", {
  4. MediaId: 'xxxxxxa507a44d0eaa7424afdxxxxxx' // 设置媒体资源ID
  5. }, {}).then(function (response) {
  6. console.log('JobId = ' + response.JobId); // 作业ID
  7. console.log('MediaId = ' + response.MediaId); // 视频ID
  8. console.log('RequestId = ' + response.RequestId);
  9. }).catch(function (response) {
  10. console.log('ErrorCode = ' + response.data.Code);
  11. console.log('ErrorMessage = ' + response.data.Message);
  12. console.log('RequestId = ' + response.data.RequestId);
  13. });

查询智能审核作业

接口参数和返回字段请参考 GetAIMediaAuditJob

  1. // 调用样例
  2. var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');
  3. client.request("GetAIMediaAuditJob", {
  4. JobId: 'xxxxxxde1dd8492ea6d815f079xxxxxx' // 设置作业ID
  5. }, {}).then(function (response) {
  6. if (response.MediaAuditJob){
  7. // 作业结果信息
  8. console.log('MediaId = ' + response.MediaAuditJob.MediaId);
  9. console.log('JobId = ' + response.MediaAuditJob.JobId);
  10. console.log('Type = ' + response.MediaAuditJob.Type);
  11. console.log('Status = ' + response.MediaAuditJob.Status);
  12. if (response.MediaAuditJob.Code){
  13. console.log('Code = ' + response.MediaAuditJob.Code);
  14. }
  15. if (response.MediaAuditJob.Message){
  16. console.log('Message = ' + response.MediaAuditJob.Message);
  17. }
  18. if (response.MediaAuditJob.Data){
  19. console.log('Data Label = ' + response.MediaAuditJob.Data.Label);
  20. console.log('Data Suggestion = ' + response.MediaAuditJob.Data.Suggestion);
  21. console.log('Data AbnormalModules = ' + response.MediaAuditJob.Data.AbnormalModules);
  22. }
  23. }
  24. console.log('RequestId = ' + response.RequestId);
  25. }).catch(function (response) {
  26. console.log('ErrorCode = ' + response.data.Code);
  27. console.log('ErrorMessage = ' + response.data.Message);
  28. console.log('RequestId = ' + response.data.RequestId);
  29. });

获取智能审核结果摘要

接口参数和返回字段请参考 GetMediaAuditResult

  1. // 调用样例
  2. var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');
  3. client.request("GetMediaAuditResult", {
  4. MediaId: 'xxxxxxea743d4733adfc8c3654xxxxxx' // 设置媒体资源ID
  5. }, {}).then(function (response) {
  6. console.log(response);
  7. if (response.MediaAuditResult){
  8. // 智能审核结果信息
  9. console.log('Data Label = ' + response.MediaAuditResult.Label);
  10. console.log('Data Suggestion = ' + response.MediaAuditResult.Suggestion);
  11. console.log('Data AbnormalModules = ' + response.MediaAuditResult.AbnormalModules);
  12. }
  13. console.log('RequestId = ' + response.RequestId);
  14. }).catch(function (response) {
  15. console.log('ErrorCode = ' + response.data.Code);
  16. console.log('ErrorMessage = ' + response.data.Message);
  17. console.log('RequestId = ' + response.data.RequestId);
  18. });

获取智能审核结果详情

接口参数和返回字段请参考 GetMediaAuditResultDetail

  1. // 调用样例
  2. var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');
  3. client.request("GetMediaAuditResultDetail", {
  4. MediaId: 'xxxxxxea743d4733adfc8c3654xxxxxx', // 设置媒体资源ID
  5. PageNo: 1
  6. }, {}).then(function (response) {
  7. if (response.MediaAuditResultDetail){
  8. // 智能审核结果详情
  9. console.log('Data Total = ' + response.MediaAuditResultDetail.Total);
  10. console.log('Data List Size = ' + response.MediaAuditResultDetail.List.length);
  11. }
  12. console.log('RequestId = ' + response.RequestId);
  13. }).catch(function (response) {
  14. console.log('ErrorCode = ' + response.data.Code);
  15. console.log('ErrorMessage = ' + response.data.Message);
  16. console.log('RequestId = ' + response.data.RequestId);
  17. });

获取智能审核结果时间线

接口参数和返回字段请参考 GetMediaAuditResultTimeline

  1. // 调用样例
  2. var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');
  3. client.request("GetMediaAuditResultTimeline", {
  4. MediaId: 'xxxxxxea743d4733adfc8c3654xxxxxx' // 设置媒体资源ID
  5. }, {}).then(function (response) {
  6. if (response.MediaAuditResultTimeline){
  7. // 智能审核结果时间线
  8. if (response.MediaAuditResultTimeline.Terrorism){
  9. console.log('Terrorism = ' + response.MediaAuditResultTimeline.Terrorism);
  10. }
  11. if (response.MediaAuditResultTimeline.Porn){
  12. console.log('Porn = ' + response.MediaAuditResultTimeline.Porn);
  13. }
  14. }
  15. console.log('RequestId = ' + response.RequestId);
  16. }).catch(function (response) {
  17. console.log('ErrorCode = ' + response.data.Code);
  18. console.log('ErrorMessage = ' + response.data.Message);
  19. console.log('RequestId = ' + response.data.RequestId);
  20. });

人工审核

接口参数和返回字段请参考 CreateAudit

  1. // 调用样例
  2. var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');
  3. var auditContent = [{
  4. VideoId: 'VideoId', // 视频ID
  5. Status: 'Blocked', // 审核状态
  6. Reason: '含有淫秽色情内容' // 若审核状态为屏蔽时,需给出屏蔽的理由,最长支持128字节
  7. }];
  8. client.request("CreateAudit", {
  9. AuditContent: JSON.stringify(auditContent)
  10. }, {}).then(function (response) {
  11. console.log('RequestId = ' + response.RequestId);
  12. }).catch(function (response) {
  13. console.log('ErrorCode = ' + response.data.Code);
  14. console.log('ErrorMessage = ' + response.data.Message);
  15. console.log('RequestId = ' + response.data.RequestId);
  16. });

获取人工审核历史

接口参数和返回字段请参考 GetAuditHistory

  1. // 调用样例
  2. var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');
  3. client.request("GetAuditHistory", {
  4. VideoId: 'VideoId',
  5. PageNo: 1,
  6. PageSize: 10
  7. }, {}).then(function (response) {
  8. // 打印审核历史记录总条数
  9. console.log('Total = ' + response.Total);
  10. // 打印本次审核结果
  11. console.log('Status = ' + response.Status);
  12. // 打印审核历史记录列表
  13. console.log('Histories = ');
  14. console.log(response.Histories);
  15. console.log('RequestId = ' + response.RequestId);
  16. }).catch(function (response) {
  17. console.log('ErrorCode = ' + response.data.Code);
  18. console.log('ErrorMessage = ' + response.data.Message);
  19. console.log('RequestId = ' + response.data.RequestId);
  20. });

设置审核安全IP

接口参数和返回字段请参考 SetAuditSecurityIp

  1. // 调用样例
  2. var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');
  3. client.request("SetAuditSecurityIp", {
  4. SecurityGroupName: 'MyGroupName', // 审核安全组名称,默认为Default
  5. OperateMode: 'Cover', // 操作方式,默认值Append(追加IP白名单)
  6. Ips: '10.23.12.20,10.23.12.21,10.23.12.22' // 审核安全IP列表,每个分组最多支持100个并以逗号隔开
  7. }, {}).then(function (response) {
  8. console.log('RequestId = ' + response.RequestId);
  9. }).catch(function (response) {
  10. console.log('ErrorCode = ' + response.data.Code);
  11. console.log('ErrorMessage = ' + response.data.Message);
  12. console.log('RequestId = ' + response.data.RequestId);
  13. });

获取审核安全IP列表

接口参数和返回字段请参考 ListAuditSecurityIp

  1. // 调用样例
  2. var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');
  3. client.request("ListAuditSecurityIp", {
  4. SecurityGroupName: 'MyGroupName' // 审核安全组名称
  5. }, {}).then(function (response) {
  6. // 打印审核安全IP详情
  7. console.log('SecurityIpList = ');
  8. console.log(response.SecurityIpList);
  9. console.log('RequestId = ' + response.RequestId);
  10. }).catch(function (response) {
  11. console.log('ErrorCode = ' + response.data.Code);
  12. console.log('ErrorMessage = ' + response.data.Message);
  13. console.log('RequestId = ' + response.data.RequestId);
  14. });