Esempio n. 1
0
def delIp(ip):
    if (ip and len(ip) > 0):
        value = ip.get("http")
        value = value.replace("http://", "")
        nPos = value.index(":")
        if (nPos > 0):
            ip = value[0:nPos]
            ipstate = int(getIpstate()) + 1
            RedisUtils.remove("ip%s-%s" % (ipstate, ip))
            logger.info("删除代理ip %s-%s" % (ipstate, ip))
Esempio n. 2
0
def removeIp(ip):
    if (ip and len(ip) > 0):
        value = ip.get("http")
        value = value.replace("http://", "")
        nPos = value.index(":")
        if (nPos > 0):
            ip = value[0:nPos]
            RedisUtils.remove("ip%s-%s" % (getIpstate(), ip))
            ipstate = int(getIpstate()) + 1
            RedisUtils.set("ip%s-%s" % (ipstate, ip), value)