昨天看到某位站长在分享新浪微博图床插件,据我所知,新浪微博早就对图片外链做了非常严格的防盗链。好奇之下看了看这款浏览器插件的源码,里面的源码还是挺有意思的。
注意:使用此接口需要登录新浪微博账号。
post接口地址
复制
https://picupload.weibo.com/interface/pic_upload.php?ori=1&mime=image%2Fjpeg&data=base64&url=0&markpos=1&logo=&nick=0&marks=1&app=miniblog
请求体中携带图片数据就行了,请求键名为b64_data
,没错,图片数据以base64发送。
举个例子,首先将一张图片转换为base64,可以使用本站工具图片转base64,如下
复制
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAgAElEQVR4nO2dCdhORRvHh5Ata3YqFIU2slWk5Ys2tCjti4pKtKCVok2blEqLUOqrr0VSaNGq5aOQosi+tFgj+/vyznf9xrlP9zPvOed5Hkmf6/K/rnO9884zZ86cM2f+c28zp4C11prd2OVQcHeX7ZrY3XG7KHZ33C6K3R23i6JQJs3+448/zKxZs8zGjRszvsvq1aubWrVqxf7+008/mdKlS5tKlSq5dNmyZU2FChV22FP84Ycf3PWLFi2akj99+nTToEGDfGmNGTNmmPr16+cr8/3335uDDz448VzB3/HMUmAT8MMPP9j27dvbMmXKIHlmfRx44IH2gQceyHeBTz75xP2+zz772Oeee86lixcvbhcuXJjUnIzx8MMPuzoPO+wwu3Xr1vC0e++91+VfeeWV9pFHHnHp448/PqXaa6+91uVff/319o477nDp2267zd55550ufdddd9nbb789rMfH3/XMfMSOuNmzZ5tDDjnEbNmyJeM3xsfMmTNNr169zJw5c8zTTz8d/rps2TL3d9GiRe46YMOGDWbdunXbfS0NrgeWLFliChQoEP4i+T///HM4EufNm5dyLqNKysIIYPHixSYvLy9MM5pMMOo0/s5n5iO246666qp8DWAocySBDuDmtXr4zDPPmMsvv9w0btzY/d+hQwczYsQIU6VKFXP88ce7h1K3bl1Tr1692Jq//fZbU61atXx0OmXKFHPAAQeYvfbaK8x78sknTZEiRcz555/vOm7y5MmO1p577jlTrFgx92D22Wcfd91rr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Ilf4WGSINEogk9k/oVhR5XjYxB/KyIWWaYKGnpHG+Slp/Z0dTJS9V6dLb9o7e7g9GENzCrtxYuAkWygYsYGRhI7uD64WGPrCKE3eCF4JtbQkSYpFju3bt3OZsWMz1VyBZe86KFvaD1N4HYkGwpvNNHFboEPTD7u0ShwKw2LMCR+JLBCxgHDFihNuxnDopx1a7GkQpjxw50sW+EL1MwA9BRFj+OZ9Ia2JFCAoiwAgPCEFFeDRYI06MC7EoeAjGjBnjVikJiPQeN26c2w+TVU3s1M43x/ESxKGAlS8O7cYuhUh/3G78/2N3x+2i2N1xuyh2d9wuit0dtyvCGPM/DmuEStvaIMMAAAAASUVORK5CYII=
再来认识下这段base64图片数据,开头的data:image/png;
表示这段数据的类型是png图片,紧接着的base64,
表示后面的数据以base64进行编码。接口在请求时,只需携带后面的base64数据即可。
最后在请求头部添加上你的新浪微博账号cookie用以登录验证,大功告成,最后返回数据如下。
只需要pid即可,这个就是新浪的图片文件名,最后拼接成
复制
https://wx2.sinaimg.cn/large/pid.jpg
其中wx2这个二级域名可以更换成别的,看你自己喜好了,比如tvax1、tvax2、tvax3、tvax4等等,这里就不多举例了。
直接访问这个图片地址是不能正常请求到数据的,需要携带新浪的域名才行,并且图片不允许跨指定域请求。
评论 (1)