第一次提交:阿龙电竞 Django 后端最新版本
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# 下载视频出错。
|
||||
FAILEDOPERATION_DOWNLOADERROR = 'FailedOperation.DownloadError'
|
||||
|
||||
# 任务不存在。
|
||||
FAILEDOPERATION_TASKNOTEXIST = 'FailedOperation.TaskNotExist'
|
||||
|
||||
# 任务状态异常。
|
||||
FAILEDOPERATION_TASKSTATUSERROR = 'FailedOperation.TaskStatusError'
|
||||
|
||||
# 视频解码失败。
|
||||
FAILEDOPERATION_VIDEODECODEFAILED = 'FailedOperation.VideoDecodeFailed'
|
||||
|
||||
# 参数取值错误。
|
||||
INVALIDPARAMETERVALUE = 'InvalidParameterValue'
|
||||
|
||||
# 不支持的视频宽高比。
|
||||
INVALIDPARAMETERVALUE_INVALIDVIDEOASPECTRATIO = 'InvalidParameterValue.InvalidVideoAspectRatio'
|
||||
|
||||
# 视频时长超过限制。
|
||||
INVALIDPARAMETERVALUE_INVALIDVIDEODURATION = 'InvalidParameterValue.InvalidVideoDuration'
|
||||
|
||||
# 不支持的视频FPS。
|
||||
INVALIDPARAMETERVALUE_INVALIDVIDEOFPS = 'InvalidParameterValue.InvalidVideoFPS'
|
||||
|
||||
# 不支持的视频格式。
|
||||
INVALIDPARAMETERVALUE_INVALIDVIDEOFORMAT = 'InvalidParameterValue.InvalidVideoFormat'
|
||||
|
||||
# 不支持的分辨率。
|
||||
INVALIDPARAMETERVALUE_INVALIDVIDEORESOLUTION = 'InvalidParameterValue.InvalidVideoResolution'
|
||||
|
||||
# 参数字段或者值有误。
|
||||
INVALIDPARAMETERVALUE_PARAMETERVALUEERROR = 'InvalidParameterValue.ParameterValueError'
|
||||
|
||||
# 风格不存在。
|
||||
INVALIDPARAMETERVALUE_STYLENOTEXIST = 'InvalidParameterValue.StyleNotExist'
|
||||
|
||||
# 视频URL格式不合法。
|
||||
INVALIDPARAMETERVALUE_URLILLEGAL = 'InvalidParameterValue.UrlIllegal'
|
||||
|
||||
# 视频大小超过限制。
|
||||
INVALIDPARAMETERVALUE_VIDEOSIZEEXCEED = 'InvalidParameterValue.VideoSizeExceed'
|
||||
|
||||
# 请求的次数超过了频率限制。
|
||||
REQUESTLIMITEXCEEDED = 'RequestLimitExceeded'
|
||||
|
||||
# 提交任务数超过最大并发。
|
||||
REQUESTLIMITEXCEEDED_JOBNUMEXCEED = 'RequestLimitExceeded.JobNumExceed'
|
||||
|
||||
# 资源不足。
|
||||
RESOURCEINSUFFICIENT = 'ResourceInsufficient'
|
||||
|
||||
# 计费状态未知。
|
||||
RESOURCEUNAVAILABLE_NOTEXIST = 'ResourceUnavailable.NotExist'
|
||||
@@ -0,0 +1,256 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import warnings
|
||||
|
||||
from tencentcloud.common.abstract_model import AbstractModel
|
||||
|
||||
|
||||
class DescribeVideoStylizationJobRequest(AbstractModel):
|
||||
r"""DescribeVideoStylizationJob请求参数结构体
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
r"""
|
||||
:param _JobId: 任务ID
|
||||
:type JobId: str
|
||||
"""
|
||||
self._JobId = None
|
||||
|
||||
@property
|
||||
def JobId(self):
|
||||
r"""任务ID
|
||||
:rtype: str
|
||||
"""
|
||||
return self._JobId
|
||||
|
||||
@JobId.setter
|
||||
def JobId(self, JobId):
|
||||
self._JobId = JobId
|
||||
|
||||
|
||||
def _deserialize(self, params):
|
||||
self._JobId = params.get("JobId")
|
||||
memeber_set = set(params.keys())
|
||||
for name, value in vars(self).items():
|
||||
property_name = name[1:]
|
||||
if property_name in memeber_set:
|
||||
memeber_set.remove(property_name)
|
||||
if len(memeber_set) > 0:
|
||||
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
||||
|
||||
|
||||
|
||||
class DescribeVideoStylizationJobResponse(AbstractModel):
|
||||
r"""DescribeVideoStylizationJob返回参数结构体
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
r"""
|
||||
:param _JobId: 任务ID。
|
||||
:type JobId: str
|
||||
:param _StatusCode: 任务状态码:
|
||||
JobInit: "初始化中"
|
||||
JobModerationFailed: "审核失败",
|
||||
JobRunning: "处理中",
|
||||
JobFailed: "处理失败",
|
||||
JobSuccess: "处理完成"。
|
||||
:type StatusCode: str
|
||||
:param _StatusMsg: 任务状态描述。
|
||||
:type StatusMsg: str
|
||||
:param _ResultVideoUrl: 处理结果视频Url。URL有效期为24小时。
|
||||
:type ResultVideoUrl: str
|
||||
:param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
||||
:type RequestId: str
|
||||
"""
|
||||
self._JobId = None
|
||||
self._StatusCode = None
|
||||
self._StatusMsg = None
|
||||
self._ResultVideoUrl = None
|
||||
self._RequestId = None
|
||||
|
||||
@property
|
||||
def JobId(self):
|
||||
r"""任务ID。
|
||||
:rtype: str
|
||||
"""
|
||||
return self._JobId
|
||||
|
||||
@JobId.setter
|
||||
def JobId(self, JobId):
|
||||
self._JobId = JobId
|
||||
|
||||
@property
|
||||
def StatusCode(self):
|
||||
r"""任务状态码:
|
||||
JobInit: "初始化中"
|
||||
JobModerationFailed: "审核失败",
|
||||
JobRunning: "处理中",
|
||||
JobFailed: "处理失败",
|
||||
JobSuccess: "处理完成"。
|
||||
:rtype: str
|
||||
"""
|
||||
return self._StatusCode
|
||||
|
||||
@StatusCode.setter
|
||||
def StatusCode(self, StatusCode):
|
||||
self._StatusCode = StatusCode
|
||||
|
||||
@property
|
||||
def StatusMsg(self):
|
||||
r"""任务状态描述。
|
||||
:rtype: str
|
||||
"""
|
||||
return self._StatusMsg
|
||||
|
||||
@StatusMsg.setter
|
||||
def StatusMsg(self, StatusMsg):
|
||||
self._StatusMsg = StatusMsg
|
||||
|
||||
@property
|
||||
def ResultVideoUrl(self):
|
||||
r"""处理结果视频Url。URL有效期为24小时。
|
||||
:rtype: str
|
||||
"""
|
||||
return self._ResultVideoUrl
|
||||
|
||||
@ResultVideoUrl.setter
|
||||
def ResultVideoUrl(self, ResultVideoUrl):
|
||||
self._ResultVideoUrl = ResultVideoUrl
|
||||
|
||||
@property
|
||||
def RequestId(self):
|
||||
r"""唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
||||
:rtype: str
|
||||
"""
|
||||
return self._RequestId
|
||||
|
||||
@RequestId.setter
|
||||
def RequestId(self, RequestId):
|
||||
self._RequestId = RequestId
|
||||
|
||||
|
||||
def _deserialize(self, params):
|
||||
self._JobId = params.get("JobId")
|
||||
self._StatusCode = params.get("StatusCode")
|
||||
self._StatusMsg = params.get("StatusMsg")
|
||||
self._ResultVideoUrl = params.get("ResultVideoUrl")
|
||||
self._RequestId = params.get("RequestId")
|
||||
|
||||
|
||||
class SubmitVideoStylizationJobRequest(AbstractModel):
|
||||
r"""SubmitVideoStylizationJob请求参数结构体
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
r"""
|
||||
:param _StyleId: 风格ID,取值说明:2d_anime 2D动漫;3d_cartoon 3D卡通;3d_china 3D国潮;pixel_art 像素风。
|
||||
:type StyleId: str
|
||||
:param _VideoUrl: 输入视频URL。视频要求:
|
||||
- 视频格式:mp4、mov;
|
||||
- 视频时长:1~60秒;
|
||||
- 视频分辨率:540P~2056P,即长宽像素数均在540px~2056px范围内;
|
||||
- 视频大小:不超过200M;
|
||||
- 视频FPS:15~60fps。
|
||||
:type VideoUrl: str
|
||||
"""
|
||||
self._StyleId = None
|
||||
self._VideoUrl = None
|
||||
|
||||
@property
|
||||
def StyleId(self):
|
||||
r"""风格ID,取值说明:2d_anime 2D动漫;3d_cartoon 3D卡通;3d_china 3D国潮;pixel_art 像素风。
|
||||
:rtype: str
|
||||
"""
|
||||
return self._StyleId
|
||||
|
||||
@StyleId.setter
|
||||
def StyleId(self, StyleId):
|
||||
self._StyleId = StyleId
|
||||
|
||||
@property
|
||||
def VideoUrl(self):
|
||||
r"""输入视频URL。视频要求:
|
||||
- 视频格式:mp4、mov;
|
||||
- 视频时长:1~60秒;
|
||||
- 视频分辨率:540P~2056P,即长宽像素数均在540px~2056px范围内;
|
||||
- 视频大小:不超过200M;
|
||||
- 视频FPS:15~60fps。
|
||||
:rtype: str
|
||||
"""
|
||||
return self._VideoUrl
|
||||
|
||||
@VideoUrl.setter
|
||||
def VideoUrl(self, VideoUrl):
|
||||
self._VideoUrl = VideoUrl
|
||||
|
||||
|
||||
def _deserialize(self, params):
|
||||
self._StyleId = params.get("StyleId")
|
||||
self._VideoUrl = params.get("VideoUrl")
|
||||
memeber_set = set(params.keys())
|
||||
for name, value in vars(self).items():
|
||||
property_name = name[1:]
|
||||
if property_name in memeber_set:
|
||||
memeber_set.remove(property_name)
|
||||
if len(memeber_set) > 0:
|
||||
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
||||
|
||||
|
||||
|
||||
class SubmitVideoStylizationJobResponse(AbstractModel):
|
||||
r"""SubmitVideoStylizationJob返回参数结构体
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
r"""
|
||||
:param _JobId: 任务ID
|
||||
:type JobId: str
|
||||
:param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
||||
:type RequestId: str
|
||||
"""
|
||||
self._JobId = None
|
||||
self._RequestId = None
|
||||
|
||||
@property
|
||||
def JobId(self):
|
||||
r"""任务ID
|
||||
:rtype: str
|
||||
"""
|
||||
return self._JobId
|
||||
|
||||
@JobId.setter
|
||||
def JobId(self, JobId):
|
||||
self._JobId = JobId
|
||||
|
||||
@property
|
||||
def RequestId(self):
|
||||
r"""唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
||||
:rtype: str
|
||||
"""
|
||||
return self._RequestId
|
||||
|
||||
@RequestId.setter
|
||||
def RequestId(self, RequestId):
|
||||
self._RequestId = RequestId
|
||||
|
||||
|
||||
def _deserialize(self, params):
|
||||
self._JobId = params.get("JobId")
|
||||
self._RequestId = params.get("RequestId")
|
||||
@@ -0,0 +1,72 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
|
||||
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
|
||||
from tencentcloud.common.abstract_client import AbstractClient
|
||||
from tencentcloud.vcg.v20240404 import models
|
||||
|
||||
|
||||
class VcgClient(AbstractClient):
|
||||
_apiVersion = '2024-04-04'
|
||||
_endpoint = 'vcg.tencentcloudapi.com'
|
||||
_service = 'vcg'
|
||||
|
||||
|
||||
def DescribeVideoStylizationJob(self, request):
|
||||
r"""用于查询视频风格化任务。视频风格化支持将输入视频生成特定风格的视频。生成后的视频画面风格多样、流畅自然,能够满足社交娱乐、互动营销、视频素材制作等场景的需求。
|
||||
|
||||
:param request: Request instance for DescribeVideoStylizationJob.
|
||||
:type request: :class:`tencentcloud.vcg.v20240404.models.DescribeVideoStylizationJobRequest`
|
||||
:rtype: :class:`tencentcloud.vcg.v20240404.models.DescribeVideoStylizationJobResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeVideoStylizationJob", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeVideoStylizationJobResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def SubmitVideoStylizationJob(self, request):
|
||||
r"""用于提交视频风格化任务。支持将输入视频生成特定风格的视频。生成后的视频画面风格多样、流畅自然,能够满足社交娱乐、互动营销、视频素材制作等场景的需求。
|
||||
|
||||
:param request: Request instance for SubmitVideoStylizationJob.
|
||||
:type request: :class:`tencentcloud.vcg.v20240404.models.SubmitVideoStylizationJobRequest`
|
||||
:rtype: :class:`tencentcloud.vcg.v20240404.models.SubmitVideoStylizationJobResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("SubmitVideoStylizationJob", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.SubmitVideoStylizationJobResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
@@ -0,0 +1,62 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
|
||||
from tencentcloud.common.abstract_client_async import AbstractClient
|
||||
from tencentcloud.vcg.v20240404 import models
|
||||
from typing import Dict
|
||||
|
||||
|
||||
class VcgClient(AbstractClient):
|
||||
_apiVersion = '2024-04-04'
|
||||
_endpoint = 'vcg.tencentcloudapi.com'
|
||||
_service = 'vcg'
|
||||
|
||||
async def DescribeVideoStylizationJob(
|
||||
self,
|
||||
request: models.DescribeVideoStylizationJobRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeVideoStylizationJobResponse:
|
||||
"""
|
||||
用于查询视频风格化任务。视频风格化支持将输入视频生成特定风格的视频。生成后的视频画面风格多样、流畅自然,能够满足社交娱乐、互动营销、视频素材制作等场景的需求。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeVideoStylizationJob"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeVideoStylizationJobResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def SubmitVideoStylizationJob(
|
||||
self,
|
||||
request: models.SubmitVideoStylizationJobRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.SubmitVideoStylizationJobResponse:
|
||||
"""
|
||||
用于提交视频风格化任务。支持将输入视频生成特定风格的视频。生成后的视频画面风格多样、流畅自然,能够满足社交娱乐、互动营销、视频素材制作等场景的需求。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "SubmitVideoStylizationJob"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.SubmitVideoStylizationJobResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
Reference in New Issue
Block a user