Wsine / picgo-plugin-sspai

PicGo插件自动化上传图片到少数派平台

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PicGo plugin for sspai

This repository is a PicGo plugin implementation for conveniently and quickly uploading images to SSPAI website.

How to install

  1. Clone/Download this repository to PicGo configuration folder.

In windows, it's C:\Users\<your username>\.picgo\

In linux and mac, it's ~/.picgo/

  1. Create a folder named node_modules and make a soft link to this repository.
  2. Edit package.json with dependencies.
{
  "dependencies": {
    "picgo-plugin-sspai": "file:picgo-plugin-sspai"
  }
}
  1. Edit package-lock.json like this.
{
  "name": "picgo-plugins",
  "requires": true,
  "lockfileVersion": 1,
  "dependencies": {
    "picgo-plugin-sspai": {
      "version": "file:picgo-plugin-sspai"
    }
  }
}

The final structure should be like this.

~/.picgo > tree
.
├── config.json
├── node_modules
│   └── picgo-plugin-sspai <soft link>
├── package.json
├── package-lock.json
├── picgo.log
└── picgo-plugin-sspai
    ├── index.js
    ├── License
    ├── md5.min.js
    ├── package.json
    └── README.md

How to config

Login in to your account in sspai.com website.

Press F12 to open the console and the type:

document.cookie.split('; sspai_cross_token=').pop().split(';').shift()

Replace the cross_token with the return string in config.json

Example config file in PicGo.

{
  "picBed": {
    "current": "sspai",
    "uploader": "sspai",
    "transformer": "base64",
    "sspai": {
      "cross_token": "<replace here>"
    }
  },
  "picgoPlugins": {
    "picgo-plugin-sspai": true
  }
}

That's all and enjoy !

About

PicGo插件自动化上传图片到少数派平台

License:MIT License


Languages

Language:JavaScript 100.0%