The CLI Tool for SM.MS, based on API v2.
Project description
SMv2
基于 SM.MS 图床 API v2 的小程序。
安装方法
直接用 pip 安装我啦~
$ pip3 install smv2
使用方法
查看用户基本信息
在指定了 API Token 的情况下使用 smv2 profile
查看当前用户基本信息,例如:
┌SM.MS User Profile─┬────────────────────────┐
│ username │ noc@nova.moe │
├───────────────────┼────────────────────────┤
│ Role │ user │
├───────────────────┼────────────────────────┤
│ Group Expire Time │ 2020-02-18 │
├───────────────────┼────────────────────────┤
│ Disk Usage │ 2.12 MB │
├───────────────────┼────────────────────────┤
│ Disk Limit │ 5.00 GB │
└───────────────────┴────────────────────────┘
上传图片
直接使用:
$ smv2 /path/to/image
例如:
➜ smv2 poster36.jpg
Upload without Token.
┌SM.MS Upload Status───────────────────────────────────────────────┐
│ Image URL │ https://i.loli.net/2019/02/18/Q123f2TWhtnk1FR.jpg │
├──────────────┼───────────────────────────────────────────────────┤
│ Deletion URL │ https://sm.ms/delete/8Ymbq218218XlPIDg4ReE2rcTi │
└──────────────┴───────────────────────────────────────────────────┘
若有 API Token,则可以在 ~/.smms
文件中以如下形式写入后使用:
[sm.ms]
api_token=<Enter Your Token Here>
此时上传的文件就可以在 sm.ms 后台看到了,例如:
➜ smv2 potw1144a.jpg
Upload with Token:1A0G******IhBV
┌SM.MS Upload Status───────────────────────────────────────────────┐
│ Image URL │ https://i.loli.net/2019/02/18/Q123f2TWhtnk1FR.jpg │
├──────────────┼───────────────────────────────────────────────────┤
│ Deletion URL │ https://sm.ms/delete/8Ymbq218218XlPIDg4ReE2rcTi │
└──────────────┴───────────────────────────────────────────────────┘
查看历史图片
对于用户已经上传的图片,可以在指定了 API Token 的情况下使用 smv2 history
进行查看,例如:
┌SM.MS User History─────────────────────────────────┬─────────────────────────────────────────────────┐
│ Image URL │ Delete URL │
├───────────────────────────────────────────────────┼─────────────────────────────────────────────────┤
│ https://i.loli.net/2019/02/18/Q123f2TWhtnk1FR.jpg │ https://sm.ms/delete/8Ymbq218218XlPIDg4ReE2rcTi │
├───────────────────────────────────────────────────┼─────────────────────────────────────────────────┤
│ https://i.loli.net/2019/02/18/Q123f2TWhtnk1FR.jpg │ https://sm.ms/delete/8Ymbq218218XlPIDg4ReE2rcTi │
├───────────────────────────────────────────────────┼─────────────────────────────────────────────────┤
│ https://i.loli.net/2019/02/18/Q123f2TWhtnk1FR.png │ https://sm.ms/delete/8Ymbq218218XlPIDg4ReE2rcTi │
├───────────────────────────────────────────────────┼─────────────────────────────────────────────────┤
│ https://i.loli.net/2019/02/18/Q123f2TWhtnk1FR.jpg │ https://sm.ms/delete/8Ymbq218218XlPIDg4ReE2rcTi │
└───────────────────────────────────────────────────┴─────────────────────────────────────────────────┘
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
smv2-0.0.6.tar.gz
(4.0 kB
view details)
Built Distribution
smv2-0.0.6-py3-none-any.whl
(16.7 kB
view details)
File details
Details for the file smv2-0.0.6.tar.gz
.
File metadata
- Download URL: smv2-0.0.6.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55bec2ead12e0aa846928fae4baee5661f573bb9537d6f34cc668725f7adf585 |
|
MD5 | 718a03f18ba4a9442b64531f196f8060 |
|
BLAKE2b-256 | 22c719cb15d1fd4f03dd999fc507953be89b66ae3e64a05aaba011aa879b6570 |
File details
Details for the file smv2-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: smv2-0.0.6-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac712800885606cb211fc7b428d5a1400aaee76ad553b01d0faf5ee1d7535b44 |
|
MD5 | 75c5aff0084622ff83a4a9fe3caf9918 |
|
BLAKE2b-256 | 1ddd8e5aab6522d257d4c590cd7ecf9a2155a82124b8450f62f8633d00ad5f89 |