x_launch.py 3.99 KB
from xiaochengxu.xiaochenxu_script import allEvent
import socket
import struct
import random
import time
import requests

appkey = 'adaf8e594702fa369ada109fd49f4d5e'
# cid
cid = '21029'
# surl
surl = 'BVjQf2a'
# URL = 'http://52.80.137.106:8083/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
URL = 'http://uri6.com/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
s = 0

for index in range(1):
    # 随机生成12为数组
    i = ''.join(str(random.choice(range(10))) for _ in range(28))
    # i = '2539452844786738942022514936'
    # 随机生成ip
    ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))

    # 打开
    allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid, requestid)
# #     # time.sleep(5)
# #     # #pv
# #     # allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# #     # # # #离开
# #     # # allEvent().hidechengxu(i,ip,cid,surl,appkey)
# #     # time.sleep(2)
#     allEvent().regedchengxu(i, ip, cid, surl, appkey)
# #     # time.sleep(2)
#     allEvent().loggedinchengxu(i, ip, cid, surl, appkey)
#     time.sleep(2)
#     allEvent().paymentchengxu(i,ip,cid,surl,appkey)
#     time.sleep(2)
#     num = index + 1
#     event = 'event_' + str(num)
#     allEvent().eventchengxu(i,ip,cid,surl,appkey,event)


# for index in range(1):
#     i = ''.join(str(random.choice(range(10))) for _ in range(28))
#     # i = '1761453021140876860117396099'
#
#
#     # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
#     # 随机生成12为数组
#     # impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
#     impressionid = '111222334455667788'
#     # requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
#     requestid = '111222334455'
#     accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
#     # 随机生成ip
#     ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
#     # ip = '156.119.456.190'
#     try:
#         parms = {
#             'click_time': str(round(time.time() * 1000)),
#             # 'click_time': '1667308011000',
#             'wechat_openid': i,
#             'click_id':'123456789',
#             'accountid': accountid,
#             'ip': ip,
#             'impression_id': impressionid,
#             'request_id': requestid,
#             '_ry_adgroup_id': '222',
#             '_ry_adplan_id': "222",
#             '_ry_adcreative_id': '222'
#         }
#         # timeout可以超时四秒
#         # verify = False
#         p = requests.get(url=URL, params=parms, timeout=10, verify=False)
#         print('imei:', i)
#
#         print("ip:", ip)
#         # print("accountid:", accountid)
#         print(p.text)
#         print(p.url)
#         # print("oaid:",o)
#         print('success:', s)
#         print(p.status_code)
#         print(p.content)
#         # print('androidid:',a)
#         # print(nowTime)
#         s = s + 1
#     except Exception as err:
#         print(err)
#         print('wrong:', w)
#         print('imei:', i)
#         print("ip:", ip)
#         # print(p.status_code)
#         # print('androidid', a)
#         w = w + 1
#
#     time.sleep(6)
#     try:
#         allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid, requestid)
#
#     except Exception:
#         print('install_wrong:', w)
#         w = w + 1

#     # pv
#     time.sleep(2)
#     allEvent().pviaochengxu(i, ip, cid, surl, appkey)
#     # #离开
#     time.sleep(2)
#     allEvent().hidechengxu(i,ip,cid,surl,appkey)
#     time.sleep(2)
#     allEvent().regedchengxu(i, ip, cid, surl, appkey)
#     time.sleep(2)
#     allEvent().loggedinchengxu(i,ip,cid,surl,appkey)
#     time.sleep(2)
#     allEvent().paymentchengxu(i, ip, cid, surl, appkey)
#     time.sleep(2)
#     allEvent().eventchengxu(i, ip, cid, surl, appkey)