Giter Site home page Giter Site logo

n0vad3v / smv2 Goto Github PK

View Code? Open in Web Editor NEW
23.0 1.0 2.0 33 KB

一个基于 sm.ms 图床 v2 API 的图片管理工具,除了普通的图片上传外还有在命令行下进行历史提交图片的管理,个人账户信息查看等功能。

License: GNU General Public License v3.0

Python 100.00%

smv2's Introduction

SMv2

forthebadge made-with-python

基于 SM.MS 图床 API v2 的小程序。

安装方法

直接用 pip 安装我啦~

$ pip3 install smv2

使用方法

查看用户基本信息

在指定了 API Token 的情况下使用 smv2 profile 查看当前用户基本信息,例如:

┌SM.MS User Profile─┬────────────────────────┐
│ username          │ [email protected]           │
├───────────────────┼────────────────────────┤
│ 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 │
└───────────────────────────────────────────────────┴─────────────────────────────────────────────────┘

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.