Ver código fonte

Merge pull request #45 from halleywj/master

bug fix
J_hao104 9 anos atrás
pai
commit
393b5a4c1a
3 arquivos alterados com 5 adições e 5 exclusões
  1. 2 3
      Config.ini
  2. 1 1
      Schedule/ProxyValidSchedule.py
  3. 2 1
      Util/utilFunction.py

+ 2 - 3
Config.ini

@@ -1,7 +1,7 @@
 [DB]
-type = SSDB
+type = REDIS
 host = localhost
-port = 8888
+port = 6379
 name = proxy
 
 [ProxyGetter]
@@ -11,4 +11,3 @@ freeProxySecond = 1
 freeProxyThird  = 1
 freeProxyFourth = 1
 freeProxyFifth  = 1
-

+ 1 - 1
Schedule/ProxyValidSchedule.py

@@ -47,7 +47,7 @@ class ProxyValidSchedule(ProxyManager):
                     # self.db.delete(each_proxy)
                     self.log.info('validProxy_b: {} validation fail'.format(each_proxy))
                 value = self.db.getvalue(each_proxy)
-                if value and value < -5:
+                if value and int(value) < -5:
                     # 计数器小于-5删除该代理
                     self.db.delete(each_proxy)
         self.log.info('validProxy_a running normal')

+ 2 - 1
Util/utilFunction.py

@@ -28,7 +28,8 @@ def getHTMLText(url, headers={'user': 'Mozilla/5.0'}):
         response.encoding = response.apparent_encoding
         return response.text
     except:
-        return response.status_code
+        return
+        # return response.status_code
 
 
 # noinspection PyPep8Naming