【发布时间】:2020-02-21 00:28:17
【问题描述】:
当我尝试通过 Python 将图像上传到 Cloudinary 时:
import cloudinary.uploader
cloudinary.config(
cloud_name = 'our-name-eu',
api_key = '…',
api_secret = '…',
private_cdn = True,
secure_distribution = 'our-name-eu-res.cloudinary.com'
)
cloudinary.uploader.upload("https://i.ytimg.com/vi/2fb-g_V-UT4/hqdefault.jpg")
然后我得到以下错误:
Error: Cloud our-name-eu belongs to eu geo, please access via api-eu.cloudinary.com
虽然I see in the docs of the API API URL 的结构类似于https://api.cloudinary.com/v1_1/<cloud name>/<resource_type>/upload,但我想我可以用api-eu 替换api,但我不知道如何在Python 模块中指定它。
我正在使用 Python 3.7.2 和来自 pip 的 cloudinary 包。
【问题讨论】:
-
貌似是
upload_prefix:github.com/cloudinary/pycloudinary/blob/… -
@jonrsharpe 就是这样!你想写一个答案让我接受吗?
标签: python python-3.x cloudinary