typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.54k stars 56 forks source link

PicGo-Core Image Upload uses deprecated API version (v1) #3327

Closed rmonvfer closed 4 years ago

rmonvfer commented 4 years ago

When trying to test the PicGo Upload feature using the test feature within the Image section in typora settings. Typora runs the following:

@chcp 65001 >nul & cmd /d/s/c C:\Users\ramon\AppData\Roaming\Typora\picgo\win64\picgo.exe u "C:\\Users\\ramon\\AppData\\Local\\Temp/typora-icon2.png" "C:\\Users\\ramon\\AppData\\Local\\Temp/typora-icon.png"

Which outputs the following:

[PicGo INFO]: Before transform
[PicGo INFO]: Transforming...
[PicGo INFO]: Before upload
[PicGo INFO]: Uploading...
[PicGo WARN]: failed
[PicGo ERROR]: Error: API v1 is deprecated, please refer to https://doc.sm.ms/ for v2 API documentation.

As far as I can tell, the only viable solution would be rewritting the API handler to adapt to the new version.

Molunerfinn commented 4 years ago

For now you can use the picgo-plugin-smms-user to use the smms v2.

The next version of picgo-core will support smms v2. I don't think this is a problem with typora.

Molunerfinn commented 4 years ago

Install and setup smms-user plugin. Please register the smms and get the auth token.

npm install picgo -g
picgo install smms-user
picgo set uploader smms-user

image

Use the uploader

picgo use uploader

image

Choose smms-user

Done.

Molunerfinn commented 4 years ago

If you use the picgo.exe provide by Typora, you can also use the install command & don't need to use the npm.

lzskyline commented 4 years ago

I've solved this. https://www.lzskyline.com/archives/87/