用Python进行七牛多文件处理(mkzip),一直报404的错,索引文件没有问题,可以访问,索引文件内的图片地址也是可以访问的,不知道是哪个文件找不到
参考的七牛相关文档:
https://developer.qiniu.com/k...
https://developer.qiniu.com/d...
from qiniu import Auth, PersistentFop, urlsafe_base64_encode
access_key = '....'
secret_key = '....'
q = Auth(access_key, secret_key)
bucket = 'hera'
key = 'mkzip-index_2.txt'
fops = 'mkzip/4/'
saveas_key = urlsafe_base64_encode(bucket + ':' + "xlz_mkzip4.zip")
fops = fops+'|saveas/'+saveas_key
pfop = PersistentFop(q, bucket)
ops = []
ops.append(fops)
ret, info = pfop.execute(key, ops, 1)
print("ret: ", ret)
print("info: ", info)
assert ret['persistentId'] is not None
打印结果
ret: None
info: _ResponseInfo__response:<Response [404]>, exception:None, status_code:404, text_body:{"error":"Document not found"}, req_id:wpUAAABWbvpfniQW, x_log:X-Log, error:Document not found
索引文件:
https://heras.igengmei.com/mk...
索引文件内容生成过程:
from qiniu import urlsafe_base64_encode
images = ["https://heras.igengmei.com/2020/07/23/0fcd8a243b", "https://heras.igengmei.com/2020/07/23/e8f134ef12", "https://heras.igengmei.com/2020/07/24/d9d4f234a5"]
for i in images:
print('/url/' + urlsafe_base64_encode(i))
生成结果:
/url/aHR0cHM6Ly9oZXJhcy5pZ2VuZ21laS5jb20vMjAyMC8wNy8yMy8wZmNkOGEyNDNi
/url/aHR0cHM6Ly9oZXJhcy5pZ2VuZ21laS5jb20vMjAyMC8wNy8yMy9lOGYxMzRlZjEy
/url/aHR0cHM6Ly9oZXJhcy5pZ2VuZ21laS5jb20vMjAyMC8wNy8yNC9kOWQ0ZjIzNGE1
确定空间名没有问题,
尝试加管道也没用
任务的id提供下呢,或者试下这个demo