فهرست منبع

[update] 添加代理获取函数配置

jhao104 9 سال پیش
والد
کامیت
67bbb08349
3فایلهای تغییر یافته به همراه18 افزوده شده و 5 حذف شده
  1. 12 4
      Config.ini
  2. 1 1
      README.md
  3. 5 0
      Util/GetConfig.py

+ 12 - 4
Config.ini

@@ -1,6 +1,14 @@
-
 [DB]
 type = SSDB
-host = localhost
-port = 8080
-name = proxy
+host = 42.123.99.64
+port = 8889
+name = proxy
+
+[ProxyGetter]
+;register the proxy getter function
+freeProxyFirst  = 1
+freeProxySecond = 1
+freeProxyThird  = 1
+freeProxyFourth = 1
+freeProxyFifth  = 1
+

+ 1 - 1
README.md

@@ -32,7 +32,7 @@
 
 * DB:
 
-  用于存放代理IP,现在暂时只支持SSDB。至于为什么选择SSDB,大家可以参考这篇[文章](https://www.sdk.cn/news/2684),个人觉得SSDB是个不错的Redis替代方案;
+  用于存放代理IP,现在暂时只支持SSDB。至于为什么选择SSDB,大家可以参考这篇[文章](https://www.sdk.cn/news/2684),个人觉得SSDB是个不错的Redis替代方案,如果你没有用过SSDB,安装起来也很简单,可以参考[这里](https://github.com/jhao104/memory-notes/blob/master/SSDB/SSDB%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE%E8%AE%B0%E5%BD%95.md)
 
 * Schedule:
 

+ 5 - 0
Util/GetConfig.py

@@ -44,6 +44,10 @@ class GetConfig(object):
     def db_port(self):
         return int(self.config_file.get('DB', 'port'))
 
+    @LazyProperty
+    def proxy_getter_functions(self):
+        return self.config_file.options('ProxyGetter')
+
 
 if __name__ == '__main__':
     gg = GetConfig()
@@ -51,3 +55,4 @@ if __name__ == '__main__':
     print gg.db_name
     print gg.db_host
     print gg.db_port
+    print gg.proxy_getter_functions