菜鸡源码,专注精品下载!
当前位置:首页 > 建站教程 > 建站知识

分享Python和彩云自动签到云函数脚本

发布时间:2024-01-05  栏目:建站知识   浏览:   分类:python教程 Python云函数 python函数 云函数

Python是一种广泛使用的高级编程语言,其设计哲学强调代码的可读性和简洁性。彩云自动签到云函数脚本是一种使用Python编写的自动化脚本,用于在彩云平台上自动完成签到任务。这种脚本通常包含一系列预先定义好的操作,如打开浏览器、导航到指定页面、填写表单数据等。通过运行这些操作,脚本可以模拟用户在网页上的行为,从而实现自动签到的目的。这种方式可以帮助用户节省时间和精力,提高工作效率。然而,需要注意的是,使用此类脚本可能违反相关平台的使用规定,因此在使用前请确保了解并遵守相关规定。

教程说明

一段Python和彩云自动签到云函数脚本,可领爱奇艺,腾讯,芒果等会员。

腾讯云函数里面的执行时间调大点,要不执行不完,懂的朋友看。

Python签到脚本

importjsonimportrequestsOpenLuckDraw=False#是否开启自动幸运抽奖(首次免费,第二次5积分/次)不建议开启否则会导致多次执行时消耗积分Skey=""#酷推skeyCookie=''#抓包Cookie存在引号时请使用转义Referer=""#抓包refererUA="Mozilla/5.0(Linux;Android10;M2007J3SCBuild/QKQ1.191222.002;wv)AppleWebKit/537.36(KHTML,likeGecko)Version/4.0Chrome/83.0.4103.106MobileSafari/537.36MCloudApp/7.6.0"defpush(title,content):url="https://push.xuthus.cc/send/"+Skeydata=title+"n"+content#发送请求res=requests.post(url=url,data=data.encode('utf-8')).textdefgetEncryptTime():target="http://caiyun.feixin.10086.cn:7070/portal/ajax/tools/opRequest.action"headers={"Host":"caiyun.feixin.10086.cn:7070","Accept":"*/*","X-Requested-With":"XMLHttpRequest","User-Agent":UA,"Content-Type":"application/x-www-form-urlencoded","Origin":"http://caiyun.feixin.10086.cn:7070","Referer":Referer,"Accept-Encoding":"gzip,deflate","Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8","Cookie":Cookie,}payload=({"op":"currentTimeMillis"})resp=json.loads(requests.post(target,headers=headers,data=payload).text)ifresp['code']!=10000:print('获取时间戳失败:',resp['msg'])return0returnresp['result']defgetTicket():target="https://hecaiyun.vercel.app/api/10086_calc_sign"payload={"sourceId":1003,"type":1,"encryptTime":getEncryptTime()}resp=json.loads(requests.post(target,data=payload).text)ifresp['code']!=200:print('加密失败:',resp['msg'])returnresp['data']defluckDraw():target="http://caiyun.feixin.10086.cn:7070/portal/ajax/common/caiYunSignIn.action"headers={"Host":"caiyun.feixin.10086.cn:7070","Accept":"*/*","X-Requested-With":"XMLHttpRequest","User-Agent":UA,"Content-Type":"application/x-www-form-urlencoded","Origin":"http://caiyun.feixin.10086.cn:7070","Referer":Referer,"Accept-Encoding":"gzip,deflate","Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8","Cookie":Cookie,}payload=({"op":"luckDraw","data":getTicket()})resp=json.loads(requests.post(target,headers=headers,data=payload).text)ifresp['code']!=10000:print('自动抽奖失败:',resp['msg'])return'自动抽奖失败:'+resp['msg']else:ifresp['result']['type']=='40160':return'自动抽奖成功:小狗电器小型手持床铺除螨仪'elifresp['result']['type']=='40175':return'自动抽奖成功:飞科男士剃须刀'elifresp['result']['type']=='40120':return'自动抽奖成功:京东京造电动牙刷'elifresp['result']['type']=='40140':return'自动抽奖成功:10-100M随机长期存储空间'elifresp['result']['type']=='40165':return'自动抽奖成功:夏新蓝牙耳机'elifresp['result']['type']=='40170':return'自动抽奖成功:欧莱雅葡萄籽护肤套餐'else:return'自动抽奖成功:谢谢参与'defrun():target="http://caiyun.feixin.10086.cn:7070/portal/ajax/common/caiYunSignIn.action"headers={"Host":"caiyun.feixin.10086.cn:7070","Accept":"*/*","X-Requested-With":"XMLHttpRequest","User-Agent":UA,"Content-Type":"application/x-www-form-urlencoded","Origin":"http://caiyun.feixin.10086.cn:7070","Referer":Referer,"Accept-Encoding":"gzip,deflate","Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8","Cookie":Cookie,}ticket=getTicket()payload=({"op":"receive","data":ticket,})resp=json.loads(requests.post(target,headers=headers,data=payload).text)ifresp['code']!=10000:push('和彩云签到','失败:'+resp['msg'])else:content='签到成功n月签到天数:'+str(resp['result']['monthDays'])+'n总积分:'+str(resp['result']['totalPoints'])ifOpenLuckDraw:content+='nn'+luckDraw()push('和彩云签到',content)defmain_handler(event,context):run()#本地测试if__name__=='__main__':run()


相关文章

    无相关信息
评论
建站知识
建站知识
使用技巧
调试安装
运营推广