图床上传工具
Project description
介绍
在上传图片的时候, 经常会用到图床功能.
此工具聚合了一些常用的图床, 以便于快速使用. 免费图床大部分都不支持定义文件名称
说明
因为使用各种免费服务, 稳定性无法保证
若各位在使用过程中碰到问题, 欢迎下列任选一种方式补充:
- 提交
isuse
说明问题 - 将问题写到
DepotType
的对应文档上
如果你有其他优秀的图床推荐, 欢迎提交isuse
或PR
当前支持的所有图床, 可查看文件DepotType
使用
安装:
pip install image-depot
from image_depot import image_depot, DepotType, upload, upload_file, DepotConfig
# 部分图床需要添加配置才能使用
token = ''
DepotConfig.SmMs(token)
# 选择图床对象
d = image_depot(DepotType.CatBox)
# 上传图片. 二进制内容
image_content = ''
image_url = d.upload(image_content)
if not image_url: # 图片上传失败, 获取失败原因
print(d.error())
# 上传图片, 使用本地文件路径
file_path = ''
image_url = d.upload_file(file_path)
# 依次尝试所有图床, 返回第一个成功的.
url, err = upload(image_content)
upload_file(file_path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
image_depot-0.8.1.tar.gz
(10.6 kB
view details)
Built Distribution
File details
Details for the file image_depot-0.8.1.tar.gz
.
File metadata
- Download URL: image_depot-0.8.1.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7fc44089a44fb68bbeae3477205fdcbe9a2c21d863d6bbdd6b9a8cc9a596cbd |
|
MD5 | ef028a4b8efd59baa9840145239c24e2 |
|
BLAKE2b-256 | 0a943645d75b101795a5a2df0fc720ad8c3ea59d1e7f717d9aefaa72e6f34a43 |
File details
Details for the file image_depot-0.8.1-py3-none-any.whl
.
File metadata
- Download URL: image_depot-0.8.1-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7b8ce5e80fc196c186beb75fce6d40dee5e2be84a709ec680213a8147754484 |
|
MD5 | 8ad47a8b6137cb07fd4ec8dee795d7cf |
|
BLAKE2b-256 | 86fe4855b1b8ad0950d933022c5c433453b7c7dccc5dd3a192e9f8c8c56a91e0 |