From 8348c18f69e041f28fee6002230d30ab4e529ab1 Mon Sep 17 00:00:00 2001 From: gaoyuan Date: Wed, 21 Feb 2024 09:28:29 +0800 Subject: [PATCH] 11 --- iMTShop.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iMTShop.py b/iMTShop.py index aac6b63..d060944 100644 --- a/iMTShop.py +++ b/iMTShop.py @@ -118,6 +118,7 @@ def get_shop_item(sessionId, itemId, device_id, token, province, city): data = response.json().get('data', {}) shops = data.get('shops', []) shop_id_ = p_c_map[province][city] + shopIdList=[] for shop in shops: if not shop.get('shopId') in shop_id_: continue @@ -127,7 +128,13 @@ def get_shop_item(sessionId, itemId, device_id, token, province, city): continue else: print("申购详情:itemId:",itemId,"shopId:",shop.get('shopId')) - return shop.get('shopId') + shopIdList.append(shop.get('shopId')) + continue + # 随机一个无锡市内的shop + print("可选shop数量:",len(shopIdList)) + randomIndex=random.randint(0, len(shopIdList)-1) + print("可选randomIndex:",randomIndex) + return shopIdList[randomIndex] def get_user_id(token, Device_ID):