Content Moderation
Content Moderation
- What's New
- Product Bulletin
- Service Overview
- Getting Started
- User Guide
- API Reference
-
SDK Reference
- Introduction to Moderation SDK
- Applying for a Service
- Obtaining Authentication Information
- Preparing the Environment
- Using the SDK (Java)
- Using the Python SDK
- Using the .NET SDK
- Using the Go SDK
-
FAQs
- Service Enabling
-
APIs
- How Do I Use Content Moderation APIs?
- What Should I Do When I Fail to Call a Content Moderation API?
- Can I Directly Upload a Word File for Text Moderation?
- What Are the Constraints on Concurrent API Calls?
- What Can I Do if the Request for Calling an API Times Out?
- How Do I Customize a Detection in Text Moderation?
- Can Content Moderation Traverse and Review the Content in an OBS Folder?
- Error Codes
- Monitoring
- Others
- Price Details
- Glossary
- General Reference
On this page
Show all
Help Center/
Content Moderation/
SDK Reference/
Using the Python SDK/
SDK Calling Example/
Moderation (Video)/
Creating a Video Moderation Job
Copied.
Creating a Video Moderation Job
- This section describes how to create a video moderation job using the video moderation SDK and AK/SK.
Replace the AK/SK in the sample code with the actual AK/SK. You can use the withUrls method of the RunCreateVideoModerationJobRequest class to configure the URLs of the videos to be reviewed, and then execute the code.
# coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkmoderation.v3.region.moderation_region import ModerationRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkmoderation.v3 import * if __name__ == "__main__": //Enter your AK/SK. ak = "<YOUR AK>" sk = "<YOUR SK>" credentials = BasicCredentials(ak, sk) \ client = ModerationClient.new_builder() \ .with_credentials(credentials) \ .with_region(ModerationRegion.value_of("xxx")) \ //Replace xxx with the region where the service is located. .build() try: request = RunCreateVideoModerationJobRequest() listAudioCategoriesbody = [ "porn" ] listImageCategoriesbody = [ "porn" ] databody = VideoCreateRequestData( url="http://xxx.xx.xxxx", frame_interval=5.5 ) request.body = VideoCreateRequest( callback="http://xxx.xx.xxxx", audio_categories=listAudioCategoriesbody, image_categories=listImageCategoriesbody, event_type="default", data=databody ) response = client.run_create_video_moderation_job(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
- The console returns the creation result of the video moderation job.
{"request_id": "dbbcb75d1a174bfa899a38be38fdd107", "job_id": "xxx"}
Parent topic: Moderation (Video)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot