click.py 5.52 KB
Newer Older
liuxiaoxing committed
1 2 3 4 5 6 7 8 9 10
from ios_event.ios_script import allEvent
import random
import requests
import socket
import struct
import time
import string

#向短链发送点击数据
#渠道短链
liuxiaoxing committed
11 12 13
# URL = 'http://52.80.137.106:8083/tkio/JF7JFja?noredirect=true'
URL = 'http://uri6.com/tkio/NJVNjaa?noredirect=true'
appkey = '017bf97c10d7bc79df1b4ed37e77b283'
liuxiaoxing committed
14
# URL = 'http://172.31.19.255:8083/tkio/VNNjQra'
liuxiaoxing committed
15
event = 'invoke'
liuxiaoxing committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
# 广告创意ID
ry_adcreative_id = '8886453253'
# 广告组ID
ry_adgroup_id = '88887645342536'
# 广告计划ID
ry_adplan_id = '888543213423'
# 广告组名称
ry_adgroup_name = 'ry_adgroup_name'
# 广告计划名称
ry_adplan_name = 'ry_adplan_name'
# 广告创意名称
ry_adcreative_name = 'ry_adcreative_name'


s=0
w=0
for _ in range(1):

    #随机生成12为数组

    a = "".join(random.sample(string.ascii_letters+string.digits, 8))
    b = "".join(random.sample(string.ascii_letters+string.digits, 4))
    c = "".join(random.sample(string.ascii_letters+string.digits, 4))
    d = "".join(random.sample(string.ascii_letters+string.digits, 4))
    e = "".join(random.sample(string.ascii_letters+string.digits, 12))

liuxiaoxing committed
42
    i = (a+"-"+b+"-"+c+"-"+d+"-"+e).upper()
liuxiaoxing committed
43
    # i = '00000000-0000-0000-0000-000000000000'
liuxiaoxing committed
44
    # i = '8a517deb7c54ac34e4a3e21f84ab6aae84d7696e'
liuxiaoxing committed
45
    # i = 'IFV_05B50501-E0FC-4B83-BE74-F18ACEDEF37Bwew'
liuxiaoxing committed
46

liuxiaoxing committed
47 48 49 50 51 52 53 54 55 56 57 58
    adid = ''.join(str(random.choice(range(10))) for _ in range(12))
    p1 = ''.join(str(random.choice(range(10))) for _ in range(12))
    se = ''.join(str(random.choice(range(10))) for _ in range(12))


    #随机生成ip
    ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
    # ip = '222.5.94.150'
    # mac = '0f607264fc6318a92b9e13c65db7cd3c'
    try:

        parms = {
liuxiaoxing committed
59 60
                # 点击时间
                'click_time': str(round(time.time() * 1000)),
liuxiaoxing committed
61
                'idfa': i,
liuxiaoxing committed
62
                # 'idfa_MD5': '4f17acf12727bfb060422996db969365',
liuxiaoxing committed
63
                # 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287',
liuxiaoxing committed
64
                # 'oaid_MD5': 'FCAF473729CE701E95A9422F5FBCD607',
liuxiaoxing committed
65
                # 'muid':i,
liuxiaoxing committed
66
                # 'oaid':'654324352124312232',
liuxiaoxing committed
67
                'ip': ip,
liuxiaoxing committed
68
                'ua': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.30.0 baiduboxapp/12.13.0.10 (Baidu; P2 13.6.1)',
liuxiaoxing committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
                # ios
                # Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.30.0 baiduboxapp/12.13.0.10 (Baidu; P2 13.6.1)
                # android
                # Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36
                # 'ry_adgroup_name': ry_adgroup_name,
                # 'ry_adplan_name': ry_adplan_name,
                # 'ry_adcreative_name': ry_adcreative_name,
                # "ry_adgroup_id": ry_adgroup_id,
                # "ry_adplan_id": ry_adplan_id,
                # "ry_adcreative_id": ry_adcreative_id,
                #'mac': mac
            }
        #timeout可以超时四秒
        p = requests.get(url=URL,params=parms,timeout=4, verify=False)
        print('success:',s)
        print('idfa:',i)
        print('ip:',ip)
        # print(p.content)
        # print(p.url)
        s=s+1
    except Exception as err:
        print(err)
        print('wrong:',w)
        print('idfa:', i)
        print('ip', ip)
        w=w+1
liuxiaoxing committed
95 96 97 98 99 100 101 102
    time.sleep(10)
    try:
        allEvent().installUpload(i, ip, appkey)
        # allEvent().formevent(i, ip, appkey)

    except Exception:
        print('install_wrong:', w)
        w = w + 1
liuxiaoxing committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
    # time.sleep(3)
    # try:
    #     allEvent().adshow(i, ip, appkey,adid)
    #     # allEvent().formevent(i, ip, appkey)
    # except Exception:
    #     print('adshow_wrong:', w)
    #     w = w + 1
    # time.sleep(3)
    # try:
    #     allEvent().adclick(i, ip, appkey, adid)
    #     # allEvent().formevent(i, ip, appkey)
    # except Exception:
    #     print('adshow_wrong:', w)
    #     w = w + 1
    # time.sleep(5)
    # try:
    #     allEvent().appduration(i, ip, appkey,se)
    #     # allEvent().formevent(i, ip, appkey)
    #     print("session:"+se)
    # except Exception:
    #     print('install_wrong:', w)
    #     w = w + 1
    # time.sleep(5)
    # try:
    #     allEvent().pageduration(i, ip, appkey, se, p1)
    #     # allEvent().formevent(i, ip, appkey)
    # except Exception:
    #     print('pageduration_wrong:', w)
    #     w = w + 1
    # time.sleep(3)
    # try:
    #     allEvent().startupEvent(i, ip, appkey)
    #
    # except Exception:
    #     print('install_wrong:', w)
    #     w = w + 1
liuxiaoxing committed
139 140 141 142 143 144 145 146 147 148 149
    # time.sleep(5)
    # try:
    #     allEvent().registerEvent(i, ip, appkey)
    # except Exception as e:
    #     print('注册_wrong:', w)
    #     print(e)
    # time.sleep(4)
    # try:
    #     allEvent().loginEvent(i, ip, appkey)
    # except Exception:
    #     print('登录_wrong:', w)
liuxiaoxing committed
150 151 152 153 154 155
    # time.sleep(10)
    # try:
    #     allEvent().ziding_event(i, ip, appkey, event)
    # except Exception as err:
    #     print(err)
    #     print('自定义_wrong:', w)
liuxiaoxing committed
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
    #
    # time.sleep(10)
    # try:
    #     allEvent().payEvent(i, ip, appkey)
    # except Exception as err:
    #     print(err)
    #     print('付费_wrong:', w)
    # time.sleep(3)
    # try:
    #     allEvent().payorder(i, ip, appkey)
    # except Exception:
    #     print('订单_wrong:', w)
    # print("结束时间" + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))