本文介绍如何使用Python SDK视频人工审核接口,进行人工审核。

功能描述

如果您认为视频检测结果与您的预期不符,可以进行人工审核。关于参数的详细信息,请参见视频人工审核API文档

您需要使用内容安全的API接入地址,调用本SDK接口。关于API接入地址的信息,请参见接入地址(Endpoint)

前提条件

提交视频人工审核任务

# coding=utf-8
import uuid

from aliyunsdkcore import client
from aliyunsdkcore.profile import region_provider
from aliyunsdkgreen.request.v20180509 import VideoAsyncManualScanRequest
import json

# 请使用您的AccessKey信息。
clt = client.AcsClient("您的AccessKey ID", "您的AccessKey Secret", 'cn-shanghai')
region_provider.modify_point('Green', 'cn-shanghai', 'green.cn-shanghai.aliyuncs.com')
request = VideoAsyncManualScanRequest.VideoAsyncManualScanRequest()
request.set_accept_format('JSON')

request.set_content(json.dumps({"tasks": [{"dataId": "检测数据ID", "url": "待检测视频链接"}],
                                "callback": "回调地址",
                                "seed": "随机字符串"}))

try:
    response = clt.do_action_with_exception(request)
    print response
except Exception, err:
    print err.__str__()

查询视频人工审核任务结果

# coding=utf-8
import uuid

from aliyunsdkcore import client
from aliyunsdkcore.profile import region_provider
from aliyunsdkgreen.request.v20180509 import VideoAsyncManualScanResultsRequest
import json

# 请使用您的AccessKey信息。
clt = client.AcsClient("您的AccessKey ID", "您的AccessKey Secret", 'cn-shanghai')
region_provider.modify_point('Green', 'cn-shanghai', 'green.cn-shanghai.aliyuncs.com')
request = VideoAsyncManualScanResultsRequest.VideoAsyncManualScanResultsRequest()
request.set_accept_format('JSON')

request.set_content(json.dumps(["视频人工审核任务ID"]))

try:
    response = clt.do_action_with_exception(request)
    print response
except Exception, err:
    print err.__str__()