|
|
@@ -104,7 +104,7 @@ class OfpayGrabber:
|
|
|
OfpayGrabber.CheckBuyRepeatEnable = True;
|
|
|
else:
|
|
|
OfpayGrabber.CheckBuyRepeatEnable = False;
|
|
|
-
|
|
|
+ self.app_version = 602;
|
|
|
self.award_want_discount_dict = None;
|
|
|
self.activities_data = activities_data;
|
|
|
self.enable = True if accout_data['enable'] == 1 else False;
|
|
|
@@ -289,9 +289,16 @@ class OfpayGrabber:
|
|
|
award_list = activity_data['awardList'];
|
|
|
ret_list = [];
|
|
|
for i in range(len(buy_list)):
|
|
|
- one_ret = self.check_to_buy_one(activity_id, sub_activity_id, sub_login_type, buy_list[i], award_list);
|
|
|
- if one_ret:
|
|
|
- ret_list.append(one_ret);
|
|
|
+ try:
|
|
|
+ one_ret = self.check_to_buy_one(activity_id, sub_activity_id, sub_login_type, buy_list[i], award_list);
|
|
|
+ if one_ret:
|
|
|
+ ret_list.append(one_ret);
|
|
|
+ except Exception as e:
|
|
|
+ print(e);
|
|
|
+ else:
|
|
|
+ pass
|
|
|
+ finally:
|
|
|
+ pass
|
|
|
return ret_list;
|
|
|
|
|
|
def check_to_buy_one(self, activity_id, sub_activity_id, sub_login_type, item_name, award_list):
|
|
|
@@ -384,7 +391,7 @@ class OfpayGrabber:
|
|
|
"detailId": detail_id,
|
|
|
"rechargeAccount": account_phone,
|
|
|
"account": account_phone,
|
|
|
- "appVersion": appVersion,
|
|
|
+ "appVersion": self.app_version,
|
|
|
};
|
|
|
url = f"https://{self.host}/h5/api/mobile/activity/pay/{activity_id}?eventVisitorId={event_visitor_id}";
|
|
|
body = json.dumps(post_data);
|
|
|
@@ -529,11 +536,11 @@ class OfpayGrabber:
|
|
|
print("请求活动描述发生错误");
|
|
|
return None;
|
|
|
|
|
|
- def get_request(self, url, params=None, timeout=15):
|
|
|
+ def get_request(self, url, params=None, timeout=9):
|
|
|
response = requests.get(url, headers=self.headers, params=params, cookies=self.cookies, timeout=timeout);
|
|
|
return response;
|
|
|
|
|
|
- def post_request(self, url, data, timeout=15):
|
|
|
+ def post_request(self, url, data, timeout=9):
|
|
|
response = requests.post(url, data=data, headers=self.headers, cookies=self.cookies, timeout=timeout);
|
|
|
return response;
|
|
|
|