增加本地推上传
This commit is contained in:
@@ -19,6 +19,24 @@ class DouyinApi:
|
||||
'GET',
|
||||
{'params': params or {}}
|
||||
)
|
||||
#上传本地推图片
|
||||
async def upload_local_image_material(self, oauth_id: str, data: Optional[Dict[str, Any]] = None, files: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
||||
if not oauth_id:
|
||||
raise RuntimeError('OAuth ID is not set.')
|
||||
|
||||
url = "https://api.oceanengine.com/open_api/v3.0/local/image/upload/"
|
||||
options: Dict[str, Any] = {}
|
||||
if data:
|
||||
options['data'] = data
|
||||
if files:
|
||||
options['files'] = files
|
||||
return await self.request.request_with_token_with_context(
|
||||
oauth_id,
|
||||
url,
|
||||
'POST',
|
||||
options,
|
||||
request_count = 3
|
||||
)
|
||||
|
||||
async def upload_image_material(self, oauth_id: str, data: Optional[Dict[str, Any]] = None, files: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
||||
if not oauth_id:
|
||||
@@ -57,6 +75,26 @@ class DouyinApi:
|
||||
request_count = 3
|
||||
)
|
||||
|
||||
#上传本地推视频素材
|
||||
async def upload_local_video_material(self, oauth_id: str, data: Optional[Dict[str, Any]] = None, files: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
||||
if not oauth_id:
|
||||
raise RuntimeError('OAuth ID is not set.')
|
||||
|
||||
url = "https://api.oceanengine.com/open_api/v3.0/local/file/video/upload/"
|
||||
options: Dict[str, Any] = {}
|
||||
if data:
|
||||
options['data'] = data
|
||||
if files:
|
||||
options['files'] = files
|
||||
return await self.request.request_with_token_with_context(
|
||||
oauth_id,
|
||||
url,
|
||||
'POST',
|
||||
options,
|
||||
request_count = 3
|
||||
)
|
||||
|
||||
|
||||
#获取区域信息
|
||||
async def get_area(self, oauth_id: str, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
||||
if not oauth_id:
|
||||
|
||||
Reference in New Issue
Block a user