|
@@ -46,7 +46,7 @@ def webhook_get_promoter():
|
|
|
cookie_update.get_click_coookie_to_redis()
|
|
|
|
|
|
else:
|
|
|
- random_member = cookie_update.r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
|
+ random_member = r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
|
random_item = random.choice(random_member)
|
|
|
cookie = random_item[0].decode('utf-8')
|
|
|
phone_num = int(random_item[1])
|
|
@@ -54,7 +54,7 @@ def webhook_get_promoter():
|
|
|
|
|
|
if json.loads(roll).__contains__("result"):
|
|
|
if json.loads(roll)["result"] == 100110000:
|
|
|
- cookie_update.r.zrem('kuaishou_shop_click_token', random_item[0])
|
|
|
+ r.zrem('kuaishou_shop_click_token', random_item[0])
|
|
|
SendFeiShuMsg.send_cookie_robot_msg(
|
|
|
"cookie 永久失效 轻更新cookie 唯一电话为{phone_num}".format(phone_num=phone_num))
|
|
|
retry_item = cookie_update.r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
@@ -78,7 +78,7 @@ def webhook_get_promoter():
|
|
|
|
|
|
else:
|
|
|
cookie_update.update_temporary_cookie_handler(phone_num)
|
|
|
- cookie_update.r.zrem('kuaishou_shop_click_token', random_item[0])
|
|
|
+ r.zrem('kuaishou_shop_click_token', random_item[0])
|
|
|
|
|
|
retry_item = cookie_update.r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
|
retry_cookie = retry_item[0].decode('utf-8')
|
|
@@ -111,7 +111,7 @@ def webhook_get_promoter():
|
|
|
p3.start()
|
|
|
p4.start()
|
|
|
p5.start()
|
|
|
- cookie_update.r.zrem('kuaishou_shop_click_token', random_item[0])
|
|
|
+ r.zrem('kuaishou_shop_click_token', random_item[0])
|
|
|
return roll
|
|
|
else:
|
|
|
rep = json.loads(request.data)
|
|
@@ -129,10 +129,17 @@ def webhook_get_promoter():
|
|
|
|
|
|
@app.route('/promoterInfo/updatePromoter', methods=['POST'])
|
|
|
def webhook_update_promoter():
|
|
|
+ r = redis.Redis(host='192.168.0.193', password='hcst@2022', port=6379, db=0)
|
|
|
rep = json.loads(request.data)
|
|
|
promoterId = rep["promoterId"]
|
|
|
- cookie = cookie_update.get_cookie_handler()[0]
|
|
|
- ReturnPromoterInfoSpider().PromoterUpdate(promoterId, cookie)
|
|
|
+ if r.zcard('kuaishou_shop_click_token') == 0:
|
|
|
+ cookie_update.get_click_coookie_to_redis()
|
|
|
+
|
|
|
+ else:
|
|
|
+ random_member = r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
|
+ random_item = random.choice(random_member)
|
|
|
+ cookie = random_item[0].decode('utf-8')
|
|
|
+ ReturnPromoterInfoSpider().PromoterUpdate(promoterId, cookie)
|
|
|
return '0'
|
|
|
|
|
|
|