| 11 | |
| 12 | class Quake: |
| 13 | def __init__(self): |
| 14 | self.headers = { |
| 15 | "User-Agent": random.choice(user_agents), |
| 16 | "X-QuakeToken": QuakeKey |
| 17 | } |
| 18 | if QuakeKey == "": |
| 19 | logging.warning("请先在config/config.py文件中配置quake的api") |
| 20 | exit(0) |
| 21 | |
| 22 | try: |
| 23 | logging.info("[QUAKE Example]domain:example.com\n") |
| 24 | while 1: |
| 25 | self.keywords = input("请输入查询关键词:").strip() |
| 26 | self.size = input("请输入查询数量:").strip() |
| 27 | if self.keywords == "" or self.size == "": |
| 28 | logging.error("\n关键字或查询数量不能为空!") |
| 29 | elif self.size.isdigit() != True: |
| 30 | logging.error("\n查询数量非整数!") |
| 31 | else: |
| 32 | break |
| 33 | self.run() |
| 34 | except KeyboardInterrupt: |
| 35 | logging.error("\n用户取消输入!直接退出。") |
| 36 | exit(0) |
| 37 | |
| 38 | |
| 39 | def run(self): |