cc抢购脚本

py

#!/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": "替换自己"
}
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': '替换自己'
}
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()

正文完
 0
admin
版权声明:本站原创文章,由 admin 于2023-01-25发表,共计984字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。