Browse Source

live_lottery

shensong00 3 years ago
parent
commit
cc5964bba2
1 changed files with 5 additions and 5 deletions
  1. 5 5
      douyin_live_lottery_scraper.py

+ 5 - 5
douyin_live_lottery_scraper.py

@@ -128,7 +128,7 @@ def get_live_lottery_data(room_id):
128 128
     response_json = None
129 129
 
130 130
     while True:
131
-        if retry > 20:
131
+        if retry > 10:
132 132
             break
133 133
 
134 134
         retry += 1
@@ -234,8 +234,8 @@ def scrape():
234 234
         response_json = get_live_lottery_data(room_id)
235 235
        
236 236
         if response_json is None:
237
-            rds_list.record_score(0)
238
-            rds_list.push_request_id(room_id)
237
+            # rds_list.record_score(0)
238
+            # rds_list.push_request_id(room_id)
239 239
             print(
240 240
                 time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 
241 241
                 + ' 数据获取失败!响应数据为空!' 
@@ -252,10 +252,10 @@ def scrape():
252 252
             }
253 253
         })
254 254
 
255
-        rds_list.record_score(1)
255
+        # rds_list.record_score(1)
256 256
         rds_list.push_data_list(data)
257 257
     except Exception as e:
258
-        rds_list.record_score(0)
258
+        # rds_list.record_score(0)
259 259
         rds_list.push_request_id(room_id)
260 260
         print(
261 261
             time.strftime("%H:%M:%S", time.localtime())