亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Python - Looking for a demo of Qiniu Cloud remote image uploading
代言
代言 2017-06-12 09:26:44
0
1
1031

Beginner learning python When using scrapy to collect web page images, the other party will prohibit cross-domain display, so I came up with the idea of ??saving the images on Qiniu Cloud, but the python API of Qiniu Cloud is a bit confusing, so I came here I would like to ask if there is a demo for saving remote pictures to Qiniu Cloud. If so, can you post it for reference and study? Thank you very much!

代言
代言

reply all(1)
女神的閨蜜愛上我
from qiniu import Auth, BucketManager
# 抓取文件到七牛
def fetch(url):
    filename = str(time.time()).replace('.', '')
    # 獲取鑒權(quán)對(duì)象
    auth = Auth(access_key, secret_key)
    # 初始化BucketManager
    bucket_manager = BucketManager(auth)
    ret, info = bucket_manager.fetch(url, bucket_name, filename)
    if info.status_code == 200:
        file_url = bucket_domain + filename
        return file_url
    else:
        return False
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template