shensong00 3 years ago
parent
commit
d2bfebdc36

+ 11 - 1
douyin_hourly_ranklist_commerce_scraper.py

@@ -241,9 +241,19 @@ def get_commerce_rank_list_data(room_id, sec_anchor_id, anchor_id, result):
241 241
 def scrape(room_id,sec_anchor_id,anchor_id):
242 242
     rds_list = RdsDouyinHourlyRankList()
243 243
 
244
+    key = 'DOUYIN_SCRAPE_DID_IID_TTREQ_1221'
245
+    rdid = DbRedis.connect().rpop(key)
246
+    if rdid:
247
+        result = rdid.split('@@@')
248
+    else:
249
+        result = []
250
+        return None
251
+
252
+    DbRedis.connect().lpush(key, rdid)
253
+
244 254
     try:
245 255
         # 带货小时榜
246
-        commerce_response_json = get_commerce_rank_list_data(room_id=room_id, sec_anchor_id=sec_anchor_id, anchor_id=anchor_id)
256
+        commerce_response_json = get_commerce_rank_list_data(room_id=room_id, sec_anchor_id=sec_anchor_id, anchor_id=anchor_id, result=result)
247 257
         
248 258
         if commerce_response_json is None:
249 259
             print(

+ 2 - 1
douyin_hourly_ranklist_whole_scraper.py

@@ -241,13 +241,14 @@ def scrape(room_id,sec_anchor_id,anchor_id):
241 241
     if rdid:
242 242
         result = rdid.split('@@@')
243 243
     else:
244
+        result = []
244 245
         return None
245 246
 
246 247
     DbRedis.connect().lpush(key, rdid)
247 248
 
248 249
     try:
249 250
         # 全站小时榜
250
-        whole_station_response_json = get_whole_station_rank_data(room_id=room_id, sec_anchor_id=sec_anchor_id, anchor_id=anchor_id, result)
251
+        whole_station_response_json = get_whole_station_rank_data(room_id=room_id, sec_anchor_id=sec_anchor_id, anchor_id=anchor_id, result=result)
251 252
        
252 253
         if whole_station_response_json is None:
253 254
             print(