0

CloudCone抢购脚本Python,为即将到来的黑五预热一下吧

sgdssgds
3月前 364

token获取:

抢购成功:CloudCone抢购脚本Python,为即将到来的黑五预热一下吧

#!/usr/bin/python
#站长论坛:www.mbbsm.com
# coding=utf-8
import time
import random
import requests
import json
def run():
    while True:
        url = 'https://app.cloudcone.com/blackfriday/offers'  # cc链接
        url2 = "https://app.cloudcone.com/ajax/vps"  # 返回结果链接
        try:
            req_header = {
                "Host": "app.cloudcone.com",
                "Sec-Fetch-Dest": "empty",
                "Sec-Fetch-Mode": "cors",
                "Sec-Fetch-Site": "same-origin",
                "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36",
                "X-Requested-With": "XMLHttpRequest",
                "Cookie": "tihuan"
            }
            response = requests.get(url, req_header)
            html1 = str(response.content, "utf-8")
            jsondata = json.loads(html1)['__data']['vps_data']
            for num in jsondata:
                if jsondata[num]['usd_price'] < 12:  # 小于多少刀
                    payload = {'os': '1007',
                            'hostname': 'mbbsm.com',
                            'location': '2',
                            'plan': num,
                            'method': 'provision',
                            '_token': 'tihuan',
                            }
                    response = requests.post(
                        url2, headers=req_header, data=payload, timeout=3)
                    if response.status_code == 200:
                        print(response.text)
        except Exception as e:
            print(e.__str__())
            continue
        #time.sleep(2.5*random.randint(2, 10))
if __name__ == '__main__':
    run()

使用中注意一下,如果少依赖就 pip install一下。

首先登录,登录后将获取的cookie值复制到python中替换 “tihuan” 里边的内容,然后直接 python this.py运行就可以了。

最新回复 (0)

    暂无评论

请先登录后发表评论!

返回