def userShiMing(self): """ 1.登录 2.首页 3.实名 4.实名状态 """ publicData = PublicDataClass(self) self.login_res = publicData.login(self.apikey, self.header) #登录 if self.login_res: # is_safe = self.publicData.index(self.apikey,self.header,self.login_res) #获取首页 # self.publicData.setMiBao(self.apikey, self.header,self.login_res,is_safe) # 设置密保 taskdata = publicData.getUserType(self.apikey, self.header, self.login_res) #查看实名状态/获取任务
class YunQianBaoMan(TaskSet): def on_start(self): # self.header ={ # "Connection":"keep-alive", # "app-type":"android", #android # "mobile-unid":str(int(round(time.time() * 100000))), # "app-version":"5.5.4.1", # "mobile-type":"HUAWEIALP-TL00(8.0.0)", # "mobile-system":"android8.0.0", # "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # # "User-Agent":random.choice(UserAgent.random_userAgent()), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", # "Content-Type": "application/x-www-form-urlencoded" # } self.header = { "Connection": "keep-alive", "app-type": "android", #android "mobile-unid": str(int(round(time.time() * 100000))), "app-version": "5.5.4.1", "mobile-type": "HUAWEIALP-TL00(8.0.0)", "mobile-system": "android8.0.0", "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # "User-Agent": random.choice( UserAgent.random_userAgent() ), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", "Content-Type": "application/x-www-form-urlencoded", "app-type": "ios", "app-version": "5.6.1", "device-tokens": "324bf4fa8b6d8c37b98e86f6366833fa9f2b73df648ee83e062b660f0e19ad43", "Content-Type": "application/x-www-form-urlencoded", "mobile-unid": "c8eb9ab231654cb58a14bd24f9062781", "mobile-system": "12.4.8", "User-Agent": "(iPhone; iOS 12.4.8; Scale/2.00) YunZhangBen/5.6.1", "mobile-type": "iPhone 6" } self.apikey = "djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh" self.publicData = PublicDataClass(self) self.rmhd = ReMenHuoDong(self) self.login_res = self.publicData.login(self.apikey, self.header) #登录 @task def tiJiaoShenQing(self): zmgddbres = self.rmhd.recruitingRepresentatives( self.apikey, self.header, self.login_res) #招募股东代表(申请状态) if zmgddbres: if zmgddbres["sub_status"] == "1": #申请成为股东代表 self.rmhd.submitApplication(self.apikey, self.header, self.login_res) #提交申请 elif zmgddbres["sub_status"] == "2": #已提交表决中 print("已提交表决中") elif zmgddbres["sub_status"] == "3": #表决未通过 重新申请 tjsqres = self.rmhd.ReSubmitApplication( self.apikey, self.header, self.login_res, zmgddbres["applyInfo"]["applyId"]) elif zmgddbres["sub_status"] == "8": print("邀请好友投票") elif zmgddbres["sub_status"] == "10": #已加入其它合作社 print("已加入其它合作社") else: print("状态未知===", zmgddbres["sub_status"])
class YunQianBaoMan(TaskSet): def on_start(self): self.header ={ "Connection":"keep-alive", "app-type":"android", #android "mobile-unid":str(int(round(time.time() * 100000))), "app-version":"5.5.4.1", "mobile-type":"HUAWEIALP-TL00(8.0.0)", "mobile-system":"android8.0.0", "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # "User-Agent":random.choice(UserAgent.random_userAgent()), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", "Content-Type": "application/x-www-form-urlencoded", } self.apikey="djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh" # self.sfz_path = "F:/myTestFile/TestObject/YouTime/yunqianbao/static/shenfenzheng.txt" self.publicData = PublicDataClass(self) self.PengYou = PengYouClass(self) self.login_res = self.PengYou.login(self.apikey,self.header) #登录 @task def userShiMing(self): """ 1.登录 2.实名状态 3.抢红包 4.打开红包 """ # print("开始集合") # all_locusts_spawned.wait(timeout=60) #在此设置了集合点 # print("集合释放") if self.login_res: taskdata = self.publicData.getUserType(self.apikey,self.header,self.login_res) #查看实名状态/获取任务
def on_start(self): self.header ={ "Connection":"keep-alive", "app-type":"android", #android "mobile-unid":str(int(round(time.time() * 100000))), "app-version":"5.5.4.1", "mobile-type":"HUAWEIALP-TL00(8.0.0)", "mobile-system":"android8.0.0", "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # "User-Agent":random.choice(UserAgent.random_userAgent()), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", "Content-Type": "application/x-www-form-urlencoded", } self.apikey="djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh" self.publicData = PublicDataClass(self) self.PengYou = PengYouClass(self) self.login_res = self.PengYou.login(self.apikey,self.header) #登录
class YunQianBaoMan(TaskSet): def on_start(self): self.header = { "Connection": "keep-alive", "app-type": "android", #android "mobile-unid": str(int(round(time.time() * 100000))), "app-version": "5.5.4.1", "mobile-type": "HUAWEIALP-TL00(8.0.0)", "mobile-system": "android8.0.0", "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # "User-Agent": random.choice( UserAgent.random_userAgent() ), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", "Content-Type": "application/x-www-form-urlencoded", } self.apikey = "djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh" self.publicData = PublicDataClass(self) self.PengYou = PengYouClass(self) self.login_res = self.PengYou.login(self.apikey, self.header) #登录 @task def userShiMing(self): """ 1.登录 2.实名状态 3.抢红包 4.打开红包 """ # print("开始集合") # all_locusts_spawned.wait(timeout=60) #在此设置了集合点 # print("集合释放") if self.login_res: zhuangtai = self.publicData.getUserType(self.apikey, self.header, self.login_res) #实名状态 if zhuangtai and zhuangtai == 5: queryRes = self.publicData.queryPaymentPassword( self.apikey, self.header, self.login_res) #查询用户是否设置了交易密码 if not queryRes["paypwd_set"]: self.publicData.setPaymentPassword(self.apikey, self.header, self.login_res) #设置支付密码 group_id = "809" #群id hbid = self.PengYou.hairRedEnvelopes(self.apikey, self.header, self.login_res, group_id) #发红包
class YunQianBaoMan(TaskSet): def on_start(self): self.header ={ "Connection":"keep-alive", "app-type":"android", #android "mobile-unid":str(int(round(time.time() * 100000))), "app-version":"5.5.4.1", "mobile-type":"HUAWEIALP-TL00(8.0.0)", "mobile-system":"android8.0.0", "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # "User-Agent":random.choice(UserAgent.random_userAgent()), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", "Content-Type": "application/x-www-form-urlencoded", } self.apikey="djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh" self.publicData = PublicDataClass(self) self.PengYou = PengYouClass(self) self.login_res = self.PengYou.login(self.apikey,self.header) #登录 @task def userShiMing(self): """ 1.登录 2.实名状态 3.抢红包 4.打开红包 """ # print("开始集合") # all_locusts_spawned.wait(timeout=60) #在此设置了集合点 # print("集合释放") if self.login_res: # taskdata = self.publicData.getUserType(self.apikey,self.header,self.login_res) #查看实名状态/获取任务 # if taskdata == 5: gift_ids = ["547"] #红包id for gift_id in gift_ids: group_id = "809" #群id hb_respons = self.PengYou.robRedEnvelopes(self.apikey,self.header,self.login_res,gift_id) if hb_respons: if int(hb_respons["aic"]) == 0 and int(hb_respons["aic_receive"]) < int(hb_respons["aic_total"]): redEnvelopes = self.PengYou.openRedEnvelopes(self.apikey,self.header,self.login_res,gift_id,group_id) if redEnvelopes : if redEnvelopes["status"] == 200: print("抢到{}个aic".format(redEnvelopes["data"]["aic"])) elif redEnvelopes["status"] == 400: self.publicData.getUserType(self.apikey,self.header,self.login_res) #查看实名状态/获取任务
def on_start(self): # self.header ={ # "Connection":"keep-alive", # "app-type":"android", #android # "mobile-unid":str(int(round(time.time() * 100000))), # "app-version":"5.5.4.1", # "mobile-type":"HUAWEIALP-TL00(8.0.0)", # "mobile-system":"android8.0.0", # "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # # "User-Agent":random.choice(UserAgent.random_userAgent()), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", # "Content-Type": "application/x-www-form-urlencoded" # } self.header = { "Connection": "keep-alive", "app-type": "android", #android "mobile-unid": str(int(round(time.time() * 100000))), "app-version": "5.5.4.1", "mobile-type": "HUAWEIALP-TL00(8.0.0)", "mobile-system": "android8.0.0", "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # "User-Agent": random.choice( UserAgent.random_userAgent() ), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", "Content-Type": "application/x-www-form-urlencoded", "app-type": "ios", "app-version": "5.6.1", "device-tokens": "324bf4fa8b6d8c37b98e86f6366833fa9f2b73df648ee83e062b660f0e19ad43", "Content-Type": "application/x-www-form-urlencoded", "mobile-unid": "c8eb9ab231654cb58a14bd24f9062781", "mobile-system": "12.4.8", "User-Agent": "(iPhone; iOS 12.4.8; Scale/2.00) YunZhangBen/5.6.1", "mobile-type": "iPhone 6" } self.apikey = "djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh" self.publicData = PublicDataClass(self) self.rmhd = ReMenHuoDong(self) self.login_res = self.publicData.login(self.apikey, self.header) #登录
def zhuCeUser(self): self.header["mobile-unid"] = str(int(round(time.time() * 100000))) self.header["device-tokens"] = str(int(round(time.time() * 1000))) self.header["User-Agent"] = str(int(round(time.time() * 100000))) self.header["mobile-type"] = str(int(round(time.time() * 1000))) PublicDataClass(self).zhuceUser(self.apikey,self.header)
def userlogin(self): PublicDataClass(self).login(self.apikey,self.header)