Jelajahi Sumber

Merge pull request #1 from jhao104/master

合并原作者更新
highroom 8 tahun lalu
induk
melakukan
b4411bccae

+ 18 - 5
Api/ProxyApi.py

@@ -14,16 +14,29 @@
 __author__ = 'JHao'
 
 import sys
+from werkzeug.wrappers import Response
+from flask import Flask, jsonify, request
 
 sys.path.append('../')
 
-from flask import Flask, jsonify, request
 from Util.GetConfig import GetConfig
-
 from Manager.ProxyManager import ProxyManager
 
 app = Flask(__name__)
 
+
+class JsonResponse(Response):
+
+    @classmethod
+    def force_type(cls, response, environ=None):
+        if isinstance(response, (dict, list)):
+            response = jsonify(response)
+
+        return super(JsonResponse, cls).force_type(response, environ)
+
+
+app.response_class = JsonResponse
+
 api_list = {
     'get': u'get an usable proxy',
     # 'refresh': u'refresh proxy pool',
@@ -35,7 +48,7 @@ api_list = {
 
 @app.route('/')
 def index():
-    return jsonify(api_list)
+    return api_list
 
 
 @app.route('/get/')
@@ -55,7 +68,7 @@ def refresh():
 @app.route('/get_all/')
 def getAll():
     proxies = ProxyManager().getAll()
-    return jsonify(proxies)
+    return proxies
 
 
 @app.route('/delete/', methods=['GET'])
@@ -68,7 +81,7 @@ def delete():
 @app.route('/get_status/')
 def getStatus():
     status = ProxyManager().getNumber()
-    return jsonify(status)
+    return status
 
 
 def run():

+ 11 - 7
Config.ini

@@ -3,8 +3,8 @@
 ;type: SSDB/REDIS/MONGODB if use redis, only modify the host port,the type should be SSDB
 type = SSDB
 host = 127.0.0.1
-;port = 6379
-port = 8888
+port = 6379
+;port = 8888
 name = proxy
 
 [ProxyGetter]
@@ -13,15 +13,19 @@ freeProxyFirst  = 1
 freeProxySecond = 1
 ;freeProxyThird  = 1
 freeProxyFourth = 1
-;freeProxyFifth  = 1
+freeProxyFifth  = 1
 freeProxySixth = 1
 freeProxySeventh = 1
-
+freeProxyEight = 1
+freeProxyNinth = 1
+freeProxyTen = 1
+freeProxyEleven = 1
 ;foreign website, outside the wall
-;freeProxyWallFirst = 1
-;freeProxyWallSecond = 1
+freeProxyWallFirst = 1
+freeProxyWallSecond = 1
+freeProxyWallThird = 1
 
 [HOST]
-; API接口配置 http://127.0.0.1:5051
+; API接口配置 http://127.0.0.1:5010
 ip = 0.0.0.0
 port = 5010

+ 4 - 0
DB/SsdbClient.py

@@ -110,3 +110,7 @@ class SsdbClient(object):
 
     def changeTable(self, name):
         self.name = name
+
+if __name__ == '__main__':
+    c = SsdbClient('useful_proxy', '118.24.52.95', 8899)
+    print(c.getAll())

+ 188 - 104
ProxyGetter/getFreeProxy.py

@@ -21,7 +21,7 @@ except:
     reload(sys)
     sys.setdefaultencoding('utf-8')
 
-sys.path.append('../')
+sys.path.append('..')
 
 from Util.utilFunction import robustCrawl, getHtmlTree
 from Util.WebRequest import WebRequest
@@ -30,18 +30,15 @@ from Util.WebRequest import WebRequest
 requests.packages.urllib3.disable_warnings()
 
 """
-66ip.cn
-data5u.com
-ip181.com
-xicidaili.com
-goubanjia.com
-xdaili.cn
-kuaidaili.com
-cn-proxy.com
-www.mimiip.com
-proxy-list.org
-cz88.net
-ip181.com
+    66ip.cn
+    data5u.com
+    xicidaili.com
+    goubanjia.com
+    xdaili.cn
+    kuaidaili.com
+    cn-proxy.com
+    proxy-list.org
+    www.mimiip.com to do
 """
 
 
@@ -56,14 +53,16 @@ class GetFreeProxy(object):
     @staticmethod
     def freeProxyFirst(page=10):
         """
-        抓取无忧代理 http://www.data5u.com/
+        无忧代理 http://www.data5u.com/
+        几乎没有能用的
         :param page: 页数
         :return:
         """
-        url_list = ['http://www.data5u.com/',
-                    'http://www.data5u.com/free/',
-                    'http://www.data5u.com/free/gngn/index.shtml',
-                    'http://www.data5u.com/free/gnpt/index.shtml']
+        url_list = [
+            'http://www.data5u.com/',
+            'http://www.data5u.com/free/gngn/index.shtml',
+            'http://www.data5u.com/free/gnpt/index.shtml'
+        ]
         for url in url_list:
             html_tree = getHtmlTree(url)
             ul_list = html_tree.xpath('//ul[@class="l2"]')
@@ -71,26 +70,32 @@ class GetFreeProxy(object):
                 try:
                     yield ':'.join(ul.xpath('.//li/text()')[0:2])
                 except Exception as e:
-                    pass
+                    print(e)
 
     @staticmethod
-    def freeProxySecond(proxy_number=100):
+    def freeProxySecond(area=33, page=1):
         """
-        抓取代理66 http://www.66ip.cn/
-        :param proxy_number: 代理数量
+        代理66 http://www.66ip.cn/
+        :param area: 抓取代理页数,page=1北京代理页,page=2上海代理页......
+        :param page: 翻页
         :return:
         """
-        url = "http://www.66ip.cn/mo.php?sxb=&tqsl={}&port=&export=&ktip=&sxa=&submit=%CC%E1++%C8%A1&textarea=".format(
-            proxy_number)
-        request = WebRequest()
-        html = request.get(url).text
-        for proxy in re.findall(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,5}', html):
-            yield proxy
+        area = 33 if area > 33 else area
+        for area_index in range(1, area + 1):
+            for i in range(1, page + 1):
+                url = "http://www.66ip.cn/areaindex_{}/{}.html".format(area_index, i)
+                html_tree = getHtmlTree(url)
+                tr_list = html_tree.xpath("//*[@id='footer']/div/table/tr[position()>1]")
+                if len(tr_list) == 0:
+                    continue
+                for tr in tr_list:
+                    yield tr.xpath("./td[1]/text()")[0] + ":" + tr.xpath("./td[2]/text()")[0]
+                break
 
     @staticmethod
     def freeProxyThird(days=1):
         """
-        抓取ip181 http://www.ip181.com/
+        ip181 http://www.ip181.com/  不能用了
         :param days:
         :return:
         """
@@ -104,55 +109,55 @@ class GetFreeProxy(object):
             pass
 
     @staticmethod
-    def freeProxyFourth():
+    def freeProxyFourth(page_count=2):
         """
-        抓取西刺代理 http://api.xicidaili.com/free2016.txt
+        西刺代理 http://www.xicidaili.com
         :return:
         """
-        url_list = ['http://www.xicidaili.com/nn',  # 高匿
-                    'http://www.xicidaili.com/nt',  # 透明
-                    ]
+        url_list = [
+            'http://www.xicidaili.com/nn/',  # 高匿
+            'http://www.xicidaili.com/nt/',  # 透明
+        ]
         for each_url in url_list:
-            tree = getHtmlTree(each_url)
-            proxy_list = tree.xpath('.//table[@id="ip_list"]//tr')
-            for proxy in proxy_list:
-                try:
-                    yield ':'.join(proxy.xpath('./td/text()')[0:2])
-                except Exception as e:
-                    pass
+            for i in range(1, page_count + 1):
+                page_url = each_url + str(i)
+                tree = getHtmlTree(page_url)
+                proxy_list = tree.xpath('.//table[@id="ip_list"]//tr[position()>1]')
+                for proxy in proxy_list:
+                    try:
+                        yield ':'.join(proxy.xpath('./td/text()')[0:2])
+                    except Exception as e:
+                        pass
 
     @staticmethod
     def freeProxyFifth():
         """
-        抓取guobanjia http://www.goubanjia.com/free/gngn/index.shtml
+        guobanjia http://www.goubanjia.com/
         :return:
         """
-        url = "http://www.goubanjia.com/free/gngn/index{page}.shtml"
-        for page in range(1, 10):
-            page_url = url.format(page=page)
-            tree = getHtmlTree(page_url)
-            proxy_list = tree.xpath('//td[@class="ip"]')
-            # 此网站有隐藏的数字干扰,或抓取到多余的数字或.符号
-            # 需要过滤掉<p style="display:none;">的内容
-            xpath_str = """.//*[not(contains(@style, 'display: none'))
-                                and not(contains(@style, 'display:none'))
-                                and not(contains(@class, 'port'))
-                                ]/text()
-                        """
-            for each_proxy in proxy_list:
-                try:
-                    # :符号裸放在td下,其他放在div span p中,先分割找出ip,再找port
-                    ip_addr = ''.join(each_proxy.xpath(xpath_str))
-                    port = each_proxy.xpath(
-                        ".//span[contains(@class, 'port')]/text()")[0]
-                    yield '{}:{}'.format(ip_addr, port)
-                except Exception as e:
-                    pass
+        url = "http://www.goubanjia.com/"
+        tree = getHtmlTree(url)
+        proxy_list = tree.xpath('//td[@class="ip"]')
+        # 此网站有隐藏的数字干扰,或抓取到多余的数字或.符号
+        # 需要过滤掉<p style="display:none;">的内容
+        xpath_str = """.//*[not(contains(@style, 'display: none'))
+                                        and not(contains(@style, 'display:none'))
+                                        and not(contains(@class, 'port'))
+                                        ]/text()
+                                """
+        for each_proxy in proxy_list:
+            try:
+                # :符号裸放在td下,其他放在div span p中,先分割找出ip,再找port
+                ip_addr = ''.join(each_proxy.xpath(xpath_str))
+                port = each_proxy.xpath(".//span[contains(@class, 'port')]/text()")[0]
+                yield '{}:{}'.format(ip_addr, port)
+            except Exception as e:
+                pass
 
     @staticmethod
     def freeProxySixth():
         """
-        抓取讯代理免费proxy http://www.xdaili.cn/ipagent/freeip/getFreeIps?page=1&rows=10
+        讯代理 http://www.xdaili.cn/
         :return:
         """
         url = 'http://www.xdaili.cn/ipagent/freeip/getFreeIps?page=1&rows=10'
@@ -167,15 +172,84 @@ class GetFreeProxy(object):
     @staticmethod
     def freeProxySeventh():
         """
-        快代理免费https://www.kuaidaili.com/free/inha/1/
+        快代理 https://www.kuaidaili.com
         """
-        url = 'https://www.kuaidaili.com/free/inha/{page}/'
-        for page in range(1, 10):
-            page_url = url.format(page=page)
-            tree = getHtmlTree(page_url)
-            proxy_list = tree.xpath('.//table//tr')
-            for tr in proxy_list[1:]:
-                yield ':'.join(tr.xpath('./td/text()')[0:2])
+        url_list = [
+            'https://www.kuaidaili.com/free/inha/{page}/',
+            'https://www.kuaidaili.com/free/intr/{page}/'
+        ]
+        for url in url_list:
+            for page in range(1, 5):
+                page_url = url.format(page=page)
+                tree = getHtmlTree(page_url)
+                proxy_list = tree.xpath('.//table//tr')
+                for tr in proxy_list[1:]:
+                    yield ':'.join(tr.xpath('./td/text()')[0:2])
+
+    @staticmethod
+    def freeProxyEight():
+        """
+        秘密代理 http://www.mimiip.com
+        """
+        url_gngao = ['http://www.mimiip.com/gngao/%s' % n for n in range(1, 10)]  # 国内高匿
+        url_gnpu = ['http://www.mimiip.com/gnpu/%s' % n for n in range(1, 10)]  # 国内普匿
+        url_gntou = ['http://www.mimiip.com/gntou/%s' % n for n in range(1, 10)]  # 国内透明
+        url_list = url_gngao + url_gnpu + url_gntou
+
+        request = WebRequest()
+        for url in url_list:
+            r = request.get(url, use_proxy=True)
+            proxies = re.findall(r'<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>[\w\W].*<td>(\d+)</td>', r.text)
+            for proxy in proxies:
+                yield ':'.join(proxy)
+
+    @staticmethod
+    def freeProxyNinth():
+        """
+        码农代理 https://proxy.coderbusy.com/
+        :return:
+        """
+        urls = ['https://proxy.coderbusy.com/classical/country/cn.aspx?page=1']
+        request = WebRequest()
+        for url in urls:
+            r = request.get(url)
+            proxies = re.findall('data-ip="(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})".+?>(\d+)</td>', r.text)
+            for proxy in proxies:
+                yield ':'.join(proxy)
+
+    @staticmethod
+    def freeProxyTen():
+        """
+        云代理 http://www.ip3366.net/free/
+        :return:
+        """
+        urls = ['http://www.ip3366.net/free/']
+        request = WebRequest()
+        for url in urls:
+            r = request.get(url)
+            proxies = re.findall(r'<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>[\s\S]*?<td>(\d+)</td>', r.text)
+            for proxy in proxies:
+                yield ":".join(proxy)
+
+    @staticmethod
+    def freeProxyEleven():
+        """
+        IP海 http://www.iphai.com/free/ng
+        :return:
+        """
+        urls = [
+            'http://www.iphai.com/free/ng',
+            'http://www.iphai.com/free/np',
+            'http://www.iphai.com/free/wg',
+            'http://www.iphai.com/free/wp'
+        ]
+        request = WebRequest()
+        for url in urls:
+            r = request.get(url)
+            proxies = re.findall(r'<td>\s*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*?</td>[\s\S]*?<td>\s*?(\d+)\s*?</td>',
+                                 r.text)
+            for proxy in proxies:
+                yield ":".join(proxy)
 
     @staticmethod
     def freeProxyWallFirst():
@@ -187,15 +261,17 @@ class GetFreeProxy(object):
         request = WebRequest()
         for url in urls:
             r = request.get(url)
-            proxies = re.findall(
-                r'<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>[\w\W]<td>(\d+)</td>', r.text)
+            proxies = re.findall(r'<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>[\w\W]<td>(\d+)</td>', r.text)
             for proxy in proxies:
                 yield ':'.join(proxy)
 
     @staticmethod
     def freeProxyWallSecond():
-        urls = ['https://proxy-list.org/english/index.php?p=%s' %
-                n for n in range(1, 10)]
+        """
+        https://proxy-list.org/english/index.php
+        :return:
+        """
+        urls = ['https://proxy-list.org/english/index.php?p=%s' % n for n in range(1, 10)]
         request = WebRequest()
         import base64
         for url in urls:
@@ -204,34 +280,42 @@ class GetFreeProxy(object):
             for proxy in proxies:
                 yield base64.b64decode(proxy).decode()
 
+    @staticmethod
+    def freeProxyWallThird():
+        urls = ['https://list.proxylistplus.com/Fresh-HTTP-Proxy-List-1']
+        request = WebRequest()
+        for url in urls:
+            r = request.get(url)
+            proxies = re.findall(r'<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>[\s\S]*?<td>(\d+)</td>', r.text)
+            for proxy in proxies:
+                yield ':'.join(proxy)
+
 
 if __name__ == '__main__':
     gg = GetFreeProxy()
-    # for e in gg.freeProxyFirst():
-    #     print(e)
-    #
-    # for e in gg.freeProxySecond():
-    #     print(e)
-    #
-    # for e in gg.freeProxyThird():
-    #     print(e)
-    #
-    # for e in gg.freeProxyFourth():
-    #     print(e)
-    #
-    # for e in gg.freeProxyFifth():
-    #     print(e)
-    #
-    # for e in gg.freeProxySixth():
-    #     print(e)
-    #
-    # for e in gg.freeProxySeventh():
-    #     print(e)
-
-    #
-    #
-    # for e in gg.freeProxyWallFirst():
-    #     print(e)
-    #
-    for e in gg.freeProxyWallSecond():
-        print(e)
+
+    # test_batch(gg.freeProxyFirst())
+
+    # test_batch(gg.freeProxySecond())
+
+    # test_batch(gg.freeProxyFourth())
+
+    # test_batch(gg.freeProxyFifth())
+
+    # test_batch(gg.freeProxySixth())
+
+    # test_batch(gg.freeProxySeventh())
+
+    # test_batch(gg.freeProxyEight())
+
+    # test_batch(gg.freeProxyNinth())
+
+    # test_batch(gg.freeProxyTen())
+
+    # test_batch(gg.freeProxyEleven())
+
+    # test_batch(gg.freeProxyWallFirst())
+
+    # test_batch(gg.freeProxyWallSecond())
+
+    # test_batch(gg.freeProxyWallThird())

+ 2 - 2
README.md

@@ -178,10 +178,10 @@ freeProxyCustom  = 1  # 确保名字和你添加方法名字一致
 
   这里感谢以下contributor的无私奉献:
 
-  [@kangnwh](https://github.com/kangnwh)| [@bobobo80](https://github.com/bobobo80)| [@halleywj](https://github.com/halleywj)| [@newlyedward](https://github.com/newlyedward)| [@wang-ye](https://github.com/wang-ye)| [@gladmo](https://github.com/gladmo)| [@bernieyangmh](https://github.com/bernieyangmh)| [@PythonYXY](https://github.com/PythonYXY)| [@zuijiawoniu](https://github.com/zuijiawoniu)| [@netAir](https://github.com/netAir)| [@scil](https://github.com/scil)| [@tangrela](https://github.com/tangrela)
+  [@kangnwh](https://github.com/kangnwh)| [@bobobo80](https://github.com/bobobo80)| [@halleywj](https://github.com/halleywj)| [@newlyedward](https://github.com/newlyedward)| [@wang-ye](https://github.com/wang-ye)| [@gladmo](https://github.com/gladmo)| [@bernieyangmh](https://github.com/bernieyangmh)| [@PythonYXY](https://github.com/PythonYXY)| [@zuijiawoniu](https://github.com/zuijiawoniu)| [@netAir](https://github.com/netAir)| [@scil](https://github.com/scil)| [@tangrela](https://github.com/tangrela)| [@highroom](https://github.com/highroom)
 
 
 ### Release Notes
 
-   [release notes](https://github.com/jhao104/proxy_pool/blob/master/doc/release_notes.md)
+   [release notes](https://github.com/jhao104/proxy_pool/blob/master/doc/release_notes.md) [@luocaodan](https://github.com/luocaodan)
 

+ 25 - 22
Schedule/ProxyCheck.py

@@ -13,7 +13,6 @@
 __author__ = 'J_hao'
 
 import sys
-from time import sleep
 from threading import Thread
 
 sys.path.append('../')
@@ -22,36 +21,40 @@ from Util.utilFunction import validUsefulProxy
 from Manager.ProxyManager import ProxyManager
 from Util.LogHandler import LogHandler
 
-FAIL_COUNT = 2  # 校验失败次数, 超过次数删除代理
+FAIL_COUNT = 1  # 校验失败次数, 超过次数删除代理
 
 
 class ProxyCheck(ProxyManager, Thread):
-    def __init__(self):
+    def __init__(self, queue, item_dict):
         ProxyManager.__init__(self)
         Thread.__init__(self)
-        self.log = LogHandler('proxy_check')
+        self.log = LogHandler('proxy_check', file=False)  # 多线程同时写一个日志文件会有问题
+        self.queue = queue
+        self.item_dict = item_dict
 
     def run(self):
         self.db.changeTable(self.useful_proxy_queue)
-        while True:
-            for proxy, count in self.db.getAll().items():
-                if validUsefulProxy(proxy):
-                    # 验证通过计数器减1
-                    if count and int(count) > 0:
-                        self.db.put(proxy, num=int(count) - 1)
-                    else:
-                        pass
-                    self.log.info('ProxyCheck: {} validation pass'.format(proxy))
+        while self.queue.qsize():
+            proxy = self.queue.get()
+            count = self.item_dict[proxy]
+            if validUsefulProxy(proxy):
+                # 验证通过计数器减1
+                if count and int(count) > 0:
+                    self.db.put(proxy, num=int(count) - 1)
                 else:
-                    self.log.info('ProxyCheck: {} validation fail'.format(proxy))
-                    if count and int(count) > FAIL_COUNT:
-                        self.log.info('ProxyCheck: {} fail too many, delete!'.format(proxy))
-                        self.db.delete(proxy)
-                    else:
-                        self.db.put(proxy, num=int(count) + 1)
-            sleep(60 * 5)
+                    pass
+                self.log.info('ProxyCheck: {} validation pass'.format(proxy))
+            else:
+                self.log.info('ProxyCheck: {} validation fail'.format(proxy))
+                if count and int(count) + 1 >= FAIL_COUNT:
+                    self.log.info('ProxyCheck: {} fail too many, delete!'.format(proxy))
+                    self.db.delete(proxy)
+                else:
+                    self.db.put(proxy, num=int(count) + 1)
+            self.queue.task_done()
 
 
 if __name__ == '__main__':
-    p = ProxyCheck()
-    p.run()
+    # p = ProxyCheck()
+    # p.run()
+    pass

+ 28 - 5
Schedule/ProxyValidSchedule.py

@@ -13,17 +13,26 @@
 __author__ = 'JHao'
 
 import sys
+import time
+
+try:
+    from Queue import Queue  # py3
+except:
+    from queue import Queue  # py2
 
 sys.path.append('../')
 
 from Schedule.ProxyCheck import ProxyCheck
+from Manager.ProxyManager import ProxyManager
 
 
-class ProxyValidSchedule(object):
+class ProxyValidSchedule(ProxyManager, object):
     def __init__(self):
-        pass
+        ProxyManager.__init__(self)
+        self.queue = Queue()
+        self.proxy_item = dict()
 
-    def __validProxy(self, threads=5):
+    def __validProxy(self, threads=10):
         """
         验证useful_proxy代理
         :param threads: 线程数
@@ -31,7 +40,7 @@ class ProxyValidSchedule(object):
         """
         thread_list = list()
         for index in range(threads):
-            thread_list.append(ProxyCheck())
+            thread_list.append(ProxyCheck(self.queue, self.proxy_item))
 
         for thread in thread_list:
             thread.daemon = True
@@ -41,7 +50,21 @@ class ProxyValidSchedule(object):
             thread.join()
 
     def main(self):
-        self.__validProxy()
+        self.putQueue()
+        while True:
+            if not self.queue.empty():
+                self.log.info("Start valid useful proxy")
+                self.__validProxy()
+            else:
+                self.log.info('Valid Complete! sleep 5 minutes.')
+                time.sleep(60 * 5)
+                self.putQueue()
+
+    def putQueue(self):
+        self.db.changeTable(self.useful_proxy_queue)
+        self.proxy_item = self.db.getAll()
+        for item in self.proxy_item:
+            self.queue.put(item)
 
 
 def run():

+ 3 - 0
Test/.pytest_cache/v/cache/lastfailed

@@ -0,0 +1,3 @@
+{
+  "testGetFreeProxy.py::testGetFreeProxy": true
+}

+ 3 - 0
Test/.pytest_cache/v/cache/nodeids

@@ -0,0 +1,3 @@
+[
+  "testGetFreeProxy.py::testGetFreeProxy"
+]

+ 6 - 3
Util/WebRequest.py

@@ -12,6 +12,7 @@
 """
 __author__ = 'J_hao'
 
+from requests.models import Response
 import requests
 import random
 import time
@@ -36,7 +37,7 @@ class WebRequest(object):
             'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)',
             'Mozilla/5.0 (Windows NT 5.1; U; en; rv:1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 9.50',
             'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0',
-            ]
+        ]
         return random.choice(ua_list)
 
     @property
@@ -77,6 +78,8 @@ class WebRequest(object):
                 print(e)
                 retry_time -= 1
                 if retry_time <= 0:
-                    # 多次请求失败时,返回百度页面
-                    return requests.get("https://www.baidu.com/")
+                    # 多次请求失败
+                    resp = Response()
+                    resp.status_code = 200
+                    return resp
                 time.sleep(retry_interval)

+ 4 - 4
doc/release_notes.md

@@ -1,18 +1,18 @@
 ## Release Notes
 
-* dev
+* 1.12 (2018.4)
 
   1.优化代理格式检查;
 
   2.增加代理源;
 
-  3. fix bug [#122](https://github.com/jhao104/proxy_pool/issues/122)
+  3.fix bug [#122](https://github.com/jhao104/proxy_pool/issues/122) [#126](https://github.com/jhao104/proxy_pool/issues/126)
 
-* 1.11(2017.8)
+* 1.11 (2017.8)
 
   1.使用多线程验证useful_pool;
 
-* 1.10(2016.11)
+* 1.10 (2016.11)
 
   1. 第一版;
 

+ 6 - 5
requirements.txt

@@ -1,9 +1,10 @@
 APScheduler==3.2.0
-Flask==0.11.1
-requests==2.11.0
-lxml==3.7.1
+werkzeug==0.11.15
+Flask==0.12
+requests==2.12.4
+lxml==3.7.2
 
-pymongo==3.2.2
-redis==2.10.5
+pymongo
+redis