全部产品
云市场

媒体审核

更新时间:2019-01-17 13:54:19

初始化客户端

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

提交智能审核作业

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * 提交智能审核作业
  7. */
  8. VodApiResponse submitAIMediaAuditJob(VodCredential authInfo) {
  9. string apiName = "SubmitAIMediaAuditJob";
  10. map<string, string> args;
  11. // 设置视频ID
  12. args["MediaId"] = "dc063078c1d845139e2a5bd8ffxxxxxx";
  13. return getAcsResponse(authInfo, apiName, args);
  14. }
  15. // 请求示例
  16. void main() {
  17. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  18. VodApiResponse response = submitAIMediaAuditJob(authInfo);
  19. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  20. }

查询智能审核作业

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * 查询智能审核作业
  7. */
  8. VodApiResponse getAIMediaAuditJob(VodCredential authInfo) {
  9. string apiName = "GetAIMediaAuditJob";
  10. map<string, string> args;
  11. // 设置作业ID
  12. args["JobId"] = "7dc69b893c8b4f13b47aae8de0xxxxxx";
  13. return getAcsResponse(authInfo, apiName, args);
  14. }
  15. // 请求示例
  16. void main() {
  17. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  18. VodApiResponse response = getAIMediaAuditJob(authInfo);
  19. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  20. }

获取智能审核结果摘要

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * 获取智能审核结果摘要
  7. */
  8. VodApiResponse getMediaAuditResult(VodCredential authInfo) {
  9. string apiName = "GetMediaAuditResult";
  10. map<string, string> args;
  11. // 设置视频ID
  12. args["MediaId"] = "dc063078c1d845139e2a5bd8fxxxxxx";
  13. return getAcsResponse(authInfo, apiName, args);
  14. }
  15. // 请求示例
  16. void main() {
  17. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  18. VodApiResponse response = getMediaAuditResult(authInfo);
  19. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  20. }

获取智能审核结果详情

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * 获取智能审核结果详情
  7. */
  8. VodApiResponse getMediaAuditResultDetail(VodCredential authInfo) {
  9. string apiName = "GetMediaAuditResultDetail";
  10. map<string, string> args;
  11. // 设置视频ID
  12. args["MediaId"] = "dc063078c1d845139e2a5bd8fxxxxxx";
  13. // 设置翻页页数
  14. args["PageNo"] = "1";
  15. return getAcsResponse(authInfo, apiName, args);
  16. }
  17. // 请求示例
  18. void main() {
  19. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  20. VodApiResponse response = getMediaAuditResultDetail(authInfo);
  21. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  22. }

获取智能审核结果时间线

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * 获取智能审核结果时间线
  7. */
  8. VodApiResponse getMediaAuditResultTimeline(VodCredential authInfo) {
  9. string apiName = "GetMediaAuditResultTimeline";
  10. map<string, string> args;
  11. // 设置视频ID
  12. args["MediaId"] = "dc063078c1d845139e2a5bd8fxxxxxx";
  13. return getAcsResponse(authInfo, apiName, args);
  14. }
  15. // 请求示例
  16. void main() {
  17. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  18. VodApiResponse response = getMediaAuditResultTimeline(authInfo);
  19. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  20. }

人工审核

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * 构建审核内容
  8. */
  9. Json::Value buildAuditContent() {
  10. Json::Value auditContents;
  11. Json::Value auditContent;
  12. auditContent["VideoId"] = "3ebc10160bda481ca9b6858a0bxxxxxx"; // 视频ID
  13. auditContent["Status"] = "Blocked"; // 审核状态
  14. auditContent["Reason"] = "含有淫秽色情内容"; // 若审核状态为屏蔽时,需给出屏蔽的理由,最长支持128字节
  15. auditContents.append(auditContent);
  16. return auditContents;
  17. }
  18. /**
  19. * 人工审核
  20. */
  21. VodApiResponse createAudit(VodCredential authInfo) {
  22. string apiName = "CreateAudit";
  23. map<string, string> args;
  24. // 设置审核内容
  25. args["AuditContent"] = buildAuditContent().toStyledString();
  26. return getAcsResponse(authInfo, apiName, args);
  27. }
  28. // 请求示例
  29. void main() {
  30. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  31. VodApiResponse response = createAudit(authInfo);
  32. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  33. }

获取人工审核历史

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * 获取人工审核历史
  8. */
  9. VodApiResponse getAuditHistory(VodCredential authInfo) {
  10. string apiName = "GetAuditHistory";
  11. map<string, string> args;
  12. // 视频ID
  13. args["VideoId"] = "3ebc10160bda481ca9b6858a0bxxxxxx";
  14. // 页号
  15. args["PageNo"] = "1";
  16. // 每页数量
  17. args["PageSize"] = "10";
  18. return getAcsResponse(authInfo, apiName, args);
  19. }
  20. // 请求示例
  21. void main() {
  22. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  23. VodApiResponse response = getAuditHistory(authInfo);
  24. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  25. }

设置审核安全IP

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * 设置审核安全IP
  8. */
  9. VodApiResponse setAuditSecurityIp(VodCredential authInfo) {
  10. string apiName = "SetAuditSecurityIp";
  11. map<string, string> args;
  12. // 审核安全组名称,默认为Default
  13. args["SecurityGroupName"] = "MyGroupName";
  14. // 操作方式,默认值Append(追加IP白名单)
  15. args["OperateMode"] = "Cover";
  16. // 审核安全IP列表
  17. args["Ips"] = "10.23.12.20,10.23.12.21,10.23.12.22";
  18. return getAcsResponse(authInfo, apiName, args);
  19. }
  20. // 请求示例
  21. void main() {
  22. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  23. VodApiResponse response = setAuditSecurityIp(authInfo);
  24. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  25. }

获取审核安全IP列表

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * 获取审核安全IP
  8. */
  9. VodApiResponse listAuditSecurityIp(VodCredential authInfo) {
  10. string apiName = "ListAuditSecurityIp";
  11. map<string, string> args;
  12. // 审核安全组名称
  13. args["SecurityGroupName"] = "MyGroupName";
  14. return getAcsResponse(authInfo, apiName, args);
  15. }
  16. // 请求示例
  17. void main() {
  18. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  19. VodApiResponse response = listAuditSecurityIp(authInfo);
  20. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  21. }