zhaozhen 1 год назад
Родитель
Сommit
28b91594d9
1 измененных файлов с 9 добавлено и 2 удалено
  1. 9 2
      douyin_scraper_register.py

+ 9 - 2
douyin_scraper_register.py

@@ -3,6 +3,7 @@ from xlog03 import *
3 3
 from rds_model.db_redis import DbRedis
4 4
 from log.print_log import PrintLog
5 5
 import douyin_class
6
+from libs.proxy import Proxy
6 7
 
7 8
 redisModel = DbRedis.outer_net_connect()
8 9
 
@@ -24,10 +25,16 @@ if __name__ == '__main__':
24 25
         try:
25 26
             llen = redisModel.llen(rkey)
26 27
             if llen < 50:
28
+                # 获取代理
29
+                proxy = Proxy.rola_get()
27 30
                 proxies = {
28
-                    "http": "http://lum-customer-c_44eb09ec-zone-data_center:4jme8s5hf9x6@zproxy.lum-superproxy.io:22225",
29
-                    "https": "http://lum-customer-c_44eb09ec-zone-data_center:4jme8s5hf9x6@zproxy.lum-superproxy.io:22225"
31
+                    "http": "http://" + proxy,
32
+                    "https": "http://" + proxy
30 33
                 }
34
+                # proxies = {
35
+                #     "http": "http://lum-customer-c_44eb09ec-zone-data_center:4jme8s5hf9x6@zproxy.lum-superproxy.io:22225",
36
+                #     "https": "http://lum-customer-c_44eb09ec-zone-data_center:4jme8s5hf9x6@zproxy.lum-superproxy.io:22225"
37
+                # }
31 38
 
32 39
                 print(str_time + ' 注册代理:' + str(proxies))
33 40
                 PrintLog.print(str_time + ' 注册代理:' + str(proxies))