|
@@ -39,7 +39,6 @@ class SpiderWeekPromoterInfo:
|
|
roll = ReturnPromoterInfoSpider().PromoterInfoSpiderHandler(promoterId, cookie)
|
|
roll = ReturnPromoterInfoSpider().PromoterInfoSpiderHandler(promoterId, cookie)
|
|
|
|
|
|
if json.loads(roll).__contains__("result"):
|
|
if json.loads(roll).__contains__("result"):
|
|
- print(11111)
|
|
|
|
if json.loads(roll)["result"] == 100110000:
|
|
if json.loads(roll)["result"] == 100110000:
|
|
cookie_update.r.zrem('kuaishou_shop_token', random_item[0])
|
|
cookie_update.r.zrem('kuaishou_shop_token', random_item[0])
|
|
SendFeiShuMsg.send_cookie_robot_msg(
|
|
SendFeiShuMsg.send_cookie_robot_msg(
|
|
@@ -47,11 +46,11 @@ class SpiderWeekPromoterInfo:
|
|
retry_item = cookie_update.r.zrange('kuaishou_shop_token', 0, -1, withscores=True)
|
|
retry_item = cookie_update.r.zrange('kuaishou_shop_token', 0, -1, withscores=True)
|
|
retry_cookie = retry_item[0].decode('utf-8')
|
|
retry_cookie = retry_item[0].decode('utf-8')
|
|
cookie_update.update_cookie_handler(phone_num)
|
|
cookie_update.update_cookie_handler(phone_num)
|
|
- PromoterInfoSpider().PromoterInfoSpiderHandler(promoterId, retry_cookie)
|
|
|
|
- PromoterFansInfo().PromoterFansInfoHandler(promoterId, retry_cookie)
|
|
|
|
- PromoterLiveInfoSpider().PromoterLiveInfoSpiderHander(promoterId, retry_cookie)
|
|
|
|
- PromoterVideoAnalysisInfo().PromoterVideoAnalysisInfoHandler(promoterId, retry_cookie)
|
|
|
|
- PromoterVideoAnalysisTrend().PromoterVideoAnalysisTrendHandler(promoterId, retry_cookie)
|
|
|
|
|
|
+ # PromoterInfoSpider().PromoterInfoSpiderHandler(promoterId, retry_cookie)
|
|
|
|
+ # PromoterFansInfo().PromoterFansInfoHandler(promoterId, retry_cookie)
|
|
|
|
+ # PromoterLiveInfoSpider().PromoterLiveInfoSpiderHander(promoterId, retry_cookie)
|
|
|
|
+ # PromoterVideoAnalysisInfo().PromoterVideoAnalysisInfoHandler(promoterId, retry_cookie)
|
|
|
|
+ # PromoterVideoAnalysisTrend().PromoterVideoAnalysisTrendHandler(promoterId, retry_cookie)
|
|
|
|
|
|
else:
|
|
else:
|
|
|
|
|
|
@@ -63,22 +62,29 @@ class SpiderWeekPromoterInfo:
|
|
|
|
|
|
retry_item = cookie_update.r.zrange('kuaishou_shop_token', 0, -1, withscores=True)
|
|
retry_item = cookie_update.r.zrange('kuaishou_shop_token', 0, -1, withscores=True)
|
|
retry_cookie = retry_item[0].decode('utf-8')
|
|
retry_cookie = retry_item[0].decode('utf-8')
|
|
- PromoterInfoSpider().PromoterInfoSpiderHandler(promoterId, retry_cookie)
|
|
|
|
- PromoterFansInfo().PromoterFansInfoHandler(promoterId, retry_cookie)
|
|
|
|
- PromoterLiveInfoSpider().PromoterLiveInfoSpiderHander(promoterId, retry_cookie)
|
|
|
|
- PromoterVideoAnalysisInfo().PromoterVideoAnalysisInfoHandler(promoterId, retry_cookie)
|
|
|
|
- PromoterVideoAnalysisTrend().PromoterVideoAnalysisTrendHandler(promoterId, retry_cookie)
|
|
|
|
|
|
+ # PromoterInfoSpider().PromoterInfoSpiderHandler(promoterId, retry_cookie)
|
|
|
|
+ # PromoterFansInfo().PromoterFansInfoHandler(promoterId, retry_cookie)
|
|
|
|
+ # PromoterLiveInfoSpider().PromoterLiveInfoSpiderHander(promoterId, retry_cookie)
|
|
|
|
+ # PromoterVideoAnalysisInfo().PromoterVideoAnalysisInfoHandler(promoterId, retry_cookie)
|
|
|
|
+ # PromoterVideoAnalysisTrend().PromoterVideoAnalysisTrendHandler(promoterId, retry_cookie)
|
|
|
|
|
|
else:
|
|
else:
|
|
- self.update_promoter_info(promoterId)
|
|
|
|
- PromoterInfoSpider().PromoterInfoSpiderHandler(promoterId, cookie)
|
|
|
|
- PromoterFansInfo().PromoterFansInfoHandler(promoterId, cookie)
|
|
|
|
- PromoterLiveInfoSpider().PromoterLiveInfoSpiderHander(promoterId, cookie)
|
|
|
|
- PromoterVideoAnalysisInfo().PromoterVideoAnalysisInfoHandler(promoterId, cookie)
|
|
|
|
- PromoterVideoAnalysisTrend().PromoterVideoAnalysisTrendHandler(promoterId, cookie)
|
|
|
|
-
|
|
|
|
|
|
+ # PromoterInfoSpider().PromoterInfoSpiderHandler(promoterId, cookie)
|
|
|
|
+ # PromoterFansInfo().PromoterFansInfoHandler(promoterId, cookie)
|
|
|
|
+ # PromoterLiveInfoSpider().PromoterLiveInfoSpiderHander(promoterId, cookie)
|
|
|
|
+ # PromoterVideoAnalysisInfo().PromoterVideoAnalysisInfoHandler(promoterId, cookie)
|
|
|
|
+ # PromoterVideoAnalysisTrend().PromoterVideoAnalysisTrendHandler(promoterId, cookie)
|
|
|
|
+ roll = json.loads(roll)
|
|
|
|
+ fanNum = roll["fanNum"]
|
|
|
|
+ totalSale = roll["totalSale"]
|
|
|
|
+ avgVideoSales = roll["avgVideoSales"]
|
|
|
|
+ videoSales = roll["videoSales"]
|
|
|
|
+ sql = """ replace into ruixuan.promoter_sales_info(promoter_id, total_sale, fans_number, avg_video_sales, video_sales) values (
|
|
|
|
+ {promoterId},'{totalSale}',{fanNum},'{avgVideoSales}','{videoSales}'
|
|
|
|
+ ) """.format(totalSale=totalSale, fanNum=fanNum, avgVideoSales=avgVideoSales, videoSales=videoSales,
|
|
|
|
+ promoterId=promoterId)
|
|
|
|
+ MysqlProUtils().Operate(sql=sql)
|
|
cookie_update.r.zrem('kuaishou_shop_token', random_item[0])
|
|
cookie_update.r.zrem('kuaishou_shop_token', random_item[0])
|
|
- return roll
|
|
|
|
|
|
|
|
def get_promoter_info(self):
|
|
def get_promoter_info(self):
|
|
sql = """
|
|
sql = """
|
|
@@ -90,18 +96,6 @@ class SpiderWeekPromoterInfo:
|
|
self.get_promoter(promoter_id)
|
|
self.get_promoter(promoter_id)
|
|
time.sleep(2)
|
|
time.sleep(2)
|
|
|
|
|
|
- def update_promoter_info(self, promoter_id):
|
|
|
|
- roll = self.get_promoter(promoter_id)
|
|
|
|
- fanNum = roll['fanNum']
|
|
|
|
- totalSale = roll["promoteBaseInfo"]["totalSale"]
|
|
|
|
- avgVideoSales = roll["promoteBaseInfo"]["avgVideoSales"]
|
|
|
|
- videoSales = roll["promoteBaseInfo"]["videoSales"]
|
|
|
|
- sql = """ replace into ruixuan.promoter_sales_info(promoter_id, total_sale, fans_number, avg_video_sales, video_sales) values (
|
|
|
|
- {promoterId},'{totalSale}',{fanNum},'{avgVideoSales}','{videoSales}'
|
|
|
|
- """.format(totalSale=totalSale, fanNum=fanNum, avgVideoSales=avgVideoSales, videoSales=videoSales,
|
|
|
|
- promoterId=promoter_id)
|
|
|
|
- MysqlProUtils().Operate(sql=sql)
|
|
|
|
-
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
SpiderWeekPromoterInfo().get_promoter_info()
|
|
SpiderWeekPromoterInfo().get_promoter_info()
|