Skip to content

Conversation

@degangliu
Copy link
Contributor

增加ci内容审核相关的接口。

if (Scheme != u'http' and Scheme != u'https'):
raise CosClientError('Scheme can be only set to http/https')
self._scheme = Scheme
self._endpoint_ci = format_endpoint(Endpoint, Region, u'ci.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_endpoint_ci 为什么赋值了两次

data = xml_to_dict(rt.content)
return response, data

def ci_auditing_submit_common(self, Bucket, Key, DetectType, Type, Url=None, BizType=None, Conf={}, Input=None, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci函数也补充到UT中吧,不然后面被人改坏了也不知道,发版本前都会跑UT的

PoolMaxSize=10, AllowRedirects=False, SignHost=True, EndpointCi=None):
"""初始化,保存用户的信息
:param Appid(string): 用户APPID.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加EndpointCi的注释说明

@zhy1985555 zhy1985555 merged commit a336377 into tencentyun:master Sep 16, 2021
if Key:
Input['Object'] = Key
if Content:
Input['Content'] = base64.b64encode(Content)
Copy link

@tssujt tssujt Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhy1985555 @degangliu 这里 Input['Content'] 的类型为 bytes,那么之后在 ci_auditing_submit_common 中调用 format_xml 的话会得到类似于如下的结果

<?xml version="1.0" encoding="UTF-8"?>
<Request>
   <Input>
      <Content>
         <Content>53</Content>
         <Content>76</Content>
         <Content>105</Content>
         <Content>116</Content>
         <Content>53</Content>
         <Content>54</Content>
         <Content>101</Content>
         <Content>76</Content>
         <Content>54</Content>
         <Content>73</Content>
         <Content>113</Content>
         <Content>67</Content>
         <Content>53</Content>
         <Content>98</Content>
         <Content>43</Content>
         <Content>114</Content>
         <Content>53</Content>
         <Content>76</Content>
         <Content>109</Content>
         <Content>81</Content>
      </Content>
   </Input>
   <Conf>
      <DetectType>Porn,Terrorism,Politics,Ads</DetectType>
   </Conf>
</Request>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python3确实有问题 非常感谢 我修复一下

degangliu added a commit to degangliu/cos-python-sdk-v5 that referenced this pull request Sep 29, 2021
增加ci内容审核相关的接口。 (tencentyun#173)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants