使用Python进行多线程检查.moe三位剩余有效域名

翻看博客看到一段不错的代码
虽然近期没有购买域名的需求
不过日后有购买域名的需求的话
稍作修改直接使用还是很方便的

import threading
import requests
import json

exitFlag = 0
domain_suffix = ".moe"

class newTh(threading.Thread):
    def __init__(self, threadID, name, letter):
        threading.Thread.__init__(self)
        self.threadID = threadID
        self.name = name
        self.letter = letter
    def run(self):
        print("Starting " + self.name)
        check_moe_domain(self.name, self.letter)
        print("Exiting " + self.name)
def check_moe_domain(threadName, letter):
    for i2 in range(1,27):
        for i3 in range(1,27):
            domain = letter + chr(i2 + 64) + chr(i3 + 64)
            #print("Checking domain",domain + domain_suffix + " if is registered...")
            r = requests.get("https://domaincheck.il24.net/dm_check_domain.cgi?callback=&domain=" + domain + domain_suffix)
            print("Thread",threadName,"report:",domain + domain_suffix+r.text[2:14])

for i1 in range(1,27):
    threads = {}
    threads[i1] = newTh(i1, "Thread-"+chr(i1+64),chr(i1+64))
    threads[i1].start()

print("Exiting Main Thread")

声明:本文为转载文章,为防止丢失所以做此备份。
原文地址:https://i.urox.cn/2019-01-04-59.html

猜你喜欢

转载自blog.csdn.net/xianhenyuan/article/details/92167451
今日推荐