![CloudCone抢购脚本Python,为即将到来的黑五预热一下吧](https://www.netjue.com/wp-content/uploads/2023/10/image-276.png)
token获取:
![CloudCone抢购脚本Python,为即将到来的黑五预热一下吧](https://www.netjue.com/wp-content/uploads/2023/10/image-277.png)
抢购成功:
![CloudCone抢购脚本Python,为即将到来的黑五预热一下吧](https://www.netjue.com/wp-content/uploads/2023/10/image-278.png)
#!/usr/bin/python
# 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': 'baidu.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()