rD87lQ.jpg

#!/bin/bash
#echo {1##*/} shortfilename
josn_post=`curl -s -F "smfile=@1; filename={1##*/}" 'https://sm.ms/api/upload?ssl=1' 2>>/dev/null` 
echojosn_post |jq '.data.url' |sed 's/\"//g'

#api地址https://sm.ms/doc/
#json格式
#{
#  "code": "success",
#  "data": {
#    "width": 640,
#    "height": 640,
#    "filename": "zyh.jpg",
#    "storename": "5c07e91b36073.jpg",
#    "size": 54155,
#    "path": "/2018/12/05/5c07e91b36073.jpg",
#    "hash": "hzcJX6jL9fevrZ7",
#    "timestamp": 1544022299,
#    "ip": "1.232.1.1",
#    "url": "https://i.loli.net/2018/12/05/5c07e91b36073.jpg",
#    "delete": "https://sm.ms/delete/hzcJX6jL9fevrZ7"
#  }
#}

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code