|
@@ -37,15 +37,15 @@ def api_root():
|
|
|
|
|
|
@app.route('/promoterInfo/getPromoterId', methods=['POST'])
|
|
|
def webhook_get_promoter():
|
|
|
- r = redis.Redis(host='192.168.0.99', password='', port=6379, db=0)
|
|
|
+ # r = redis.Redis(host='192.168.0.99', password='', port=6379, db=0)
|
|
|
rep = json.loads(request.data)
|
|
|
promoterId = rep["promoterId"]
|
|
|
media_id = rep["mediaId"]
|
|
|
if media_id == '2' or media_id is None:
|
|
|
- if r.zcard('kuaishou_shop_click_token') == 0:
|
|
|
- cookie_update.get_click_coookie_to_redis()
|
|
|
- random_member = r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
|
- random_item = random.choice(random_member)
|
|
|
+ if media_id is None:
|
|
|
+ # cookie_update.get_click_coookie_to_redis()
|
|
|
+ # random_member = r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
|
+ # random_item = random.choice(random_member)
|
|
|
cookie = cookie_update.get_cookie_handler()[0]
|
|
|
# cookie = random_item[0].decode('utf-8')
|
|
|
roll = ReturnPromoterInfoSpider().PromoterInfoSpiderHandler(promoterId, cookie)
|
|
@@ -58,9 +58,9 @@ def webhook_get_promoter():
|
|
|
# random_item = random.choice(random_member)
|
|
|
# cookie = random_item[0].decode('utf-8')
|
|
|
cookie = cookie_update.get_cookie_handler()[0]
|
|
|
- print(cookie,'----------cookie--------------')
|
|
|
+ print(cookie, '----------cookie--------------')
|
|
|
phone_num = cookie_update.get_cookie_handler()[1]
|
|
|
- print(phone_num,'------phone_num-------')
|
|
|
+ print(phone_num, '------phone_num-------')
|
|
|
results = ReturnPromoterInfoSpider.PromoterInfoSpiderHandler(promoterId, cookie)
|
|
|
print(results, '-----results-----{promoterId}'.format(promoterId=promoterId))
|
|
|
if json.loads(results).__contains__("result"):
|
|
@@ -158,9 +158,9 @@ def webhook_update_promoter():
|
|
|
# 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')
|
|
|
- cookie= cookie_update.get_cookie_handler()[0]
|
|
|
+ cookie = cookie_update.get_cookie_handler()[0]
|
|
|
ReturnPromoterInfoSpider().PromoterUpdate(promoterId, cookie)
|
|
|
- # r.close()
|
|
|
+ # r.close()
|
|
|
return '0'
|
|
|
|
|
|
|