本地资源生成URL
2021-10-14 本文已影响0人
一个摸鱼AI喵
安装SDK
pip install oss2
pip install aliyun-python-sdk-viapiutils
pip install aliyun-python-sdk-core
pip install viapi-utils
生成URL
from viapi.fileutils import FileUtils
AccessKeyID = 'LTAI5t8frnjxgfRWfusbiQrx'
Secret_key = '3ijLwXTg9mPK4zrEkHXmXucKpzBJzo'
file_utils = FileUtils(AccessKeyID , Secret_key )
oss_url = file_utils.get_oss_url(r"E:\AI\Livenet\datasets\LCC_FASD\LCC_FASD_attack_Image\LCC_FASD_0.jpg","jpg",True)
针对其他格式要做响应的改变.如为mp4,第二个参数就改为"mp4"
AccessKeyID跟Secret_key 要去阿里云申请,挑选免费的业务进行开通
image-20210817182943205.png