Skip to content

Commit 7a5d479

Browse files
committed
bug
1 parent 333b6e1 commit 7a5d479

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

jdBuyMask_V2.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ def get_checkout_page_detail():
284284
if not response_status(resp):
285285
logger.error('获取订单结算页信息失败')
286286
return ''
287-
287+
if '刷新太频繁了' in resp.text:
288+
return '刷新太频繁了'
288289
soup = BeautifulSoup(resp.text, "html.parser")
289290
risk_control = get_tag_value(soup.select('input#riskControl'), 'value')
290291

@@ -296,7 +297,7 @@ def get_checkout_page_detail():
296297
}
297298

298299
logger.info("下单信息:%s", order_detail)
299-
return order_detail
300+
# return order_detail
300301
except requests.exceptions.RequestException as e:
301302
logger.error('订单结算页面获取异常:%s' % e)
302303
except Exception as e:
@@ -443,6 +444,8 @@ def normalModeBuyMask(sku_id):
443444
else:
444445
add_item_to_cart(sku_id)
445446
risk_control = get_checkout_page_detail()
447+
if risk_control == '刷新太频繁了':
448+
return False
446449
if len(risk_control) > 0:
447450
if submit_order(risk_control, sku_id):
448451
return True
@@ -452,6 +455,8 @@ def normalModeBuyMask(sku_id):
452455
def fastModeBuyMask(sku_id):
453456
add_item_to_cart(sku_id)
454457
risk_control = get_checkout_page_detail()
458+
if risk_control == '刷新太频繁了':
459+
return False
455460
if len(risk_control) > 0:
456461
if submit_order(risk_control, sku_id):
457462
return True

jdBuyMask_V3.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ def get_checkout_page_detail():
329329
if not response_status(resp):
330330
logger.error('获取订单结算页信息失败')
331331
return ''
332-
332+
if '刷新太频繁了' in resp.text:
333+
return '刷新太频繁了'
333334
soup = BeautifulSoup(resp.text, "html.parser")
334335
risk_control = get_tag_value(soup.select('input#riskControl'), 'value')
335336

@@ -469,7 +470,10 @@ def item_removed(sku_id):
469470

470471

471472
def buyMask(sku_id):
473+
472474
risk_control = get_checkout_page_detail()
475+
if risk_control == '刷新太频繁了':
476+
return False
473477
if len(risk_control) > 0:
474478
if submit_order(risk_control, sku_id):
475479
return True

0 commit comments

Comments
 (0)