python 获取二次元图片地址
使用 python 调用图片地址接口,然后将地址之间粘贴到 clipboard 。
import requests
#importing the module
import pyperclip
res = requests.get('https://api.mtyqx.cn/api/random.php?return=json')
imgurl = res.json().get('imgurl')
print(imgurl)
# copies all the data the user has copied
pyperclip.copy(imgurl)
# paste the copied data from clipboard
pyperclip.paste()