from fenbao_android_event.android_script import allEvent import random import requests import socket import struct import time #向短链发送点击数据 #!!!!分包需要删掉https的s URL = 'http://uri6.com/tkio/eeQfQza?noredirect=true&callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D' appkey = '8a390227254c03dbcaddbca009cd6e8b' # event = 'invoke' cmpaignid = '1122' # 广告创意ID ry_adcreative_id = '9876543' # 广告组ID ry_adgroup_id = '65432' # 广告计划ID ry_adplan_id = '4321' # 广告组名称 ry_adgroup_name = '广告组' # 广告计划名称 ry_adplan_name = '广告计划' # 广告创意名称 ry_adcreative_name = '广告创意' s = 0 w = 0 for index in range(1): #随机生成12为数组 i = ''.join(str(random.choice(range(10))) for _ in range(12)) # i = '16707072833653' #随机生成ip ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) # ip = '175.93.28.70' accountid = ''.join(str(random.choice(range(10))) for _ in range(12)) # accountid = '014067084301' try: parms = { 'click_time': str(round(time.time() * 1000)), # 'androidid': "43214532142142", 'imei': i, # "idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB', 'ip': ip, # 'campuuid': '14323122', # 'clickid': '3232331', # "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3", # 'creativeId':'21321321312123', # 'requestId':'312321321312', # 'adId': long('21231'), '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, "accountid": accountid } #timeout可以超时四秒 # verify = False p = requests.get(url=URL, params=parms, timeout=30, verify= False) print('success:',s) # print(p.text) print('imei:',i) #print('ip:',ip) s=s+1 except requests.exceptions.RequestException: print('wrong:',w) print('imei:', i) print('ip', ip) w = w+1 time.sleep(8) try: allEvent().installUpload(i, ip, appkey, cmpaignid) except Exception as err: print('install_wrong:', w) w = w + 1 print(err) # try: # allEvent().invoke_test(i, ip, appkey, cmpaignid) # except Exception as err: # print('install_wrong:', w) # w = w + 1 # print(err) # time.sleep(1) # try: # allEvent().registerEvent(i, ip, appkey) # except Exception as e: # print('注册_wrong:', w) # print(e) # # continue # time.sleep(2) # try: # allEvent().loginEvent(i, ip, appkey) # except Exception: # print('登录_wrong:', w) # time.sleep(5) # try: # allEvent().payEvent(i, ip, appkey) # except Exception: # print('付费_wrong:', w) # num = index + 1 # event = 'event_' + str(num) # event = 'event_28' # time.sleep(3) # try: # allEvent().ziding_event(i, ip, appkey,event) # except Exception: # print('自定义_wrong:', w)