-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
取模意义是什么? #5
Comments
感谢你提出的问题。你的说法是对的。 这个取模操作是在调试中忘记删除的代码。在 飞书API文档 中,checksum的示例值是一个20位的数字,当时看的时候百思不得其解,试了几种方法均不知其所以然,遂恢复原始代码,跑通后忘记删除此处的取模。 再次感谢你的反馈。 祝好 |
谢谢你,你好有礼貌。 这是我在你提供的文档链接看到的内容,我发现你的请求体和cURL好像都和文档有些偏差,以下是你的请求体: json = {
"upload_id": self.upload_id,
"num_blocks": (self.file_size + self.block_size - 1) // self.block_size,
"vhid": self.vhid,
"risk_detection_extra": '{"source_terminal":1,"file_operate_usage":3,"locale":"zh_cn"}',
} 以下是你的cRUL: complete_url1 = (
f"https://internal-api-space.feishu.cn/space/api/box/upload/finish/"
) 此外,还有一个请求,这次的cURL和文档也不一致,请求体依旧不同,我就不分开引用了: complete_url2 = f"https://meetings.feishu.cn/minutes/api/upload/finish"
json = {
"auto_transcribe": True,
"language": "mixed",
"num_blocks": (self.file_size + self.block_size - 1) // self.block_size,
"upload_id": self.upload_id,
"vhid": self.vhid,
"upload_token": self.upload_token,
"object_token": self.object_token,
} 我想知道怎么查找这些信息,和文档的差异是因为文档更新导致的吗? 希望得到你的回复,谢谢。 |
感谢你的解答!我大开眼界! 另外我修改了一小段代码,表达更加简洁一点,是 # 如果只下载会议妙记,则过滤掉自己上传的妙记
if download_type == 0:
need_download_minutes = [
minutes
for minutes in need_download_minutes
if minutes["object_type"] == 0
]
# 如果只下载自己上传的妙记,则过滤掉会议妙记
elif download_type == 1:
need_download_minutes = [
minutes
for minutes in need_download_minutes
if minutes["object_type"] == 1
] 修改为: # 过滤需要下载的妙记,基于download_type确定是会议妙记还是自己上传的妙记
need_download_minutes = [
minutes
for minutes in need_download_minutes
if minutes["object_type"] == download_type
] 希望采纳~ |
已修改,感谢贡献!另外minutes["object_type"]的取值只有0和1,而download_type可能为2,因此需要加一条判断。 |
👋 两个相关的飞书API文档 分片上传文件(上传分片) 和 上传文件 今日已修改checksum的示例值。 感谢你的贡献 🥳! |
其中有这样一行代码:
这里adler32函数返回值是一个32位无符号整数,为什么还要取模10的10次方呢?
2^32=4294967296,是小于10^10的,这样的取模结果始终为0。
The text was updated successfully, but these errors were encountered: