于2020/7/1-3日编写,仅供个人学习参考,请勿用于非法途径。
[Python] 纯文本查看 复制代码
import requestsimport time# -------------获取验证码所需参数# code地址codeurl = 'https://nuc.api.mgtv.com/v1/LoginCaptcha?'# code参数codedata = {'_support':'10000000','deviceid':'1e92894d-daac-497d-b4d9-25d41da0568e','appVersion':'pcweb-6.3.0.gray','dname':'','src':'intelmgtv','invoker':'pcweb','username':'','smscode':'86','t':'',}# -------------post登陆所需参数# post地址loginurl = 'https://nuc.api.mgtv.com/v1/Login'# post提交数据logindata = {'_support':'10000000','deviceid':'1e92894d-daac-497d-b4d9-25d41da0568e','appVersion':'pcweb-6.3.0.gray','dname':'','src':'intelmgtv','invoker':'pcweb','username':'','password':'','smscode':'86','captcha':'',}# -------------获取验证码# 时间戳t = int(round(time.time() * 1000))# 替换数据codedata['username'] = '@账号'codedata['t'] = t# get验证码写出文件coderes = requests.get(codeurl,params=codedata)with open('code.png', 'wb') as file: file.write(coderes.content)# -------------验证码识别# 验证码处理 # 暂不放出# 验证码识别 # 暂不放出# -------------账号登入# 替换数据logindata['username'] = '@账号'logindata['password'] = '@密码'logindata['captcha'] = '@验证码'# post提交loginloginres =requests.post(loginurl,logindata)# 结果判断# -------------账号登出# get提交logoutrequests.get('https://i.mgtv.com/account/logout?from=https://www.mgtv.com/#')
声明:本站所有资源均由网友分享,如有侵权内容,请在文章下方留言,本站会立即处理。