Browse Source

[add] new proxy source http://www.xiladaili.com/

jhao 6 năm trước cách đây
mục cha
commit
42206fd1d8
4 tập tin đã thay đổi với 26 bổ sung5 xóa
  1. 6 3
      Config/setting.py
  2. 16 2
      ProxyGetter/getFreeProxy.py
  3. 4 0
      doc/release_notes.md
  4. 0 0
      log/log

+ 6 - 3
Config/setting.py

@@ -54,14 +54,17 @@ DATABASES = {
 
 PROXY_GETTER = [
     "freeProxy01",
-    "freeProxy02",
+    # "freeProxy02",
     "freeProxy03",
     "freeProxy04",
     "freeProxy05",
-    "freeProxy06",
+    # "freeProxy06",
     "freeProxy07",
-    "freeProxy08",
+    # "freeProxy08",
     "freeProxy09",
+    "freeProxy13",
+    "freeProxy14",
+    "freeProxy14",
 ]
 
 """ API config http://127.0.0.1:5010 """

+ 16 - 2
ProxyGetter/getFreeProxy.py

@@ -322,6 +322,19 @@ class GetFreeProxy(object):
             for proxy in proxies:
                 yield ':'.join(proxy)
 
+    @staticmethod
+    def freeProxy15():
+        urls = ['http://www.xiladaili.com/putong/',
+                "http://www.xiladaili.com/gaoni/",
+                "http://www.xiladaili.com/http/",
+                "http://www.xiladaili.com/https/"]
+        request = WebRequest()
+        for url in urls:
+            r = request.get(url, timeout=10)
+            ips = re.findall(r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,5}", r.text)
+            for ip in ips:
+                yield ip.strip()
+
 
 if __name__ == '__main__':
     from CheckProxy import CheckProxy
@@ -334,8 +347,9 @@ if __name__ == '__main__':
     # CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy06)
     # CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy07)
     # CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy08)
-    CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy09)
+    # CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy09)
     # CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy13)
     # CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy14)
+    # CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy15)
 
-    # CheckProxy.checkAllGetProxyFunc()
+    CheckProxy.checkAllGetProxyFunc()

+ 4 - 0
doc/release_notes.md

@@ -1,5 +1,9 @@
 ## Release Notes
 
+* master
+
+    1. 新增免费代理源 `西拉代理`  (2020-03-30)
+
 * 2.0.1 
 
     1. 新增免费代理源 `89免费代理`;

+ 0 - 0
log/log