zhaozhen 1 year ago
parent
commit
28b91594d9
1 changed files with 9 additions and 2 deletions
  1. 9 2
      douyin_scraper_register.py

+ 9 - 2
douyin_scraper_register.py

3
 from rds_model.db_redis import DbRedis
3
 from rds_model.db_redis import DbRedis
4
 from log.print_log import PrintLog
4
 from log.print_log import PrintLog
5
 import douyin_class
5
 import douyin_class
6
+from libs.proxy import Proxy
6
 
7
 
7
 redisModel = DbRedis.outer_net_connect()
8
 redisModel = DbRedis.outer_net_connect()
8
 
9
 
24
         try:
25
         try:
25
             llen = redisModel.llen(rkey)
26
             llen = redisModel.llen(rkey)
26
             if llen < 50:
27
             if llen < 50:
28
+                # 获取代理
29
+                proxy = Proxy.rola_get()
27
                 proxies = {
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
                 print(str_time + ' 注册代理:' + str(proxies))
39
                 print(str_time + ' 注册代理:' + str(proxies))
33
                 PrintLog.print(str_time + ' 注册代理:' + str(proxies))
40
                 PrintLog.print(str_time + ' 注册代理:' + str(proxies))