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 │
└───────────────────────────────────────────────────┴─────────────────────────────────────────────────┘
Metadata
Release files for smv2 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smv2-0.0.6.tar.gz | 4.0 kB | Without provenance | Details for smv2-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smv2-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for smv2-0.0.6-py3-none-any.whl |
Total release size: 20.6 kB
Release files / smv2-0.0.6.tar.gz
| Download URL | smv2-0.0.6.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55bec2ead12e0aa846928fae4baee5661f573bb9537d6f34cc668725f7adf585
|
|
BLAKE2b-256 checksum How to use checksums |
22c719cb15d1fd4f03dd999fc507953be89b66ae3e64a05aaba011aa879b6570
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / smv2-0.0.6-py3-none-any.whl
| Download URL | smv2-0.0.6-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac712800885606cb211fc7b428d5a1400aaee76ad553b01d0faf5ee1d7535b44
|
|
BLAKE2b-256 checksum How to use checksums |
1ddd8e5aab6522d257d4c590cd7ecf9a2155a82124b8450f62f8633d00ad5f89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for smv2 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.