Exemplo n.º 1
0
def test():
    while qu_proxy_test.qsize():
        # noinspection PyBroadException
        try:
            proxy = qu_proxy_test.get(timeout=1)
        except Exception:
            break
        if proxy_test.test(proxy, timeout=3):
            print proxy
            qu_proxy_ok.put([proxy, time.strftime('%Y-%m-%d %X', time.localtime())])
Exemplo n.º 2
0
def _proxy_test():
    while qu_proxy_test.qsize():
        # noinspection PyBroadException
        try:
            proxy = qu_proxy_test.get(timeout=1)
        except Exception:
            break
        if proxy_test.test(proxy, timeout=2):
            qu_proxy_ok.put(proxy)
            logger.debug(msg=proxy + ' is okay')