一、请求地址:
https://www.lytcreate.com/api/qsy/
二、请求方式:POST
三、请求体:JSON
body = {
"token": "个人中心的token",
"url": "视频分享地址"
}
token获取地址,访问:https://www.lytcreate.com/information.html 登录后获取token值
四、响应体:JSON
可能的情况:
res_info = {
"code": 404,
"msg": "缺失url或token",
"data": "",
"num": 0
}
res_info = {
"code": 404,
"msg": "该token不存在",
"data": "",
"num": 0
}
res_info = {
"code": 405,
"msg": "去水印解析次数不足",
"data": "",
"num": 0
}
res_info = {
"code": 200,
"msg": "去水印解析成功",
"data": video_url,
"num": user_info.yin_api - 1
}
res_info = {
"code": 500,
"msg": "去水印解析失败",
"data": "",
"num": user_info.yin_api
}
其中,只有code为200时,解析正确,返回的data为视频的url地址
五、python请求示例:
def qsy():
url = 'https://www.lytcreate.com/api/qsy/'
body = {
"token": "q3hdu*****************",
"url": "0.53 复制打开抖音,看看【德芙小帅哥的作品】没事哒没事哒妈妈酱# 谁还不是只爱干净的猫猫了 https://v.douyin.com/i6mXyxBH/ 11/06 Kjc:/ u@f.Bg"
}
res = requests.post(url, json=body)
content = json.loads(res.content)
print('视频地址:', content["data"])
# 保存视频为test.mp4文件
video_data = requests.get(content["data"])
with open('test.mp4', 'wb') as f:
f.write(video_data.content)
注意:视频链接有效期截止当天24点,过期自动删除,如需长久保存,请自行下载本地保存!