diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a9169054..c699681e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 更新日志 +- v1.2.12(2023-04-22) + - 优化:修改域名信息和证书信息更新缓存机制,避免频繁更新导致请求失败 + - 修复:没有设置邮件导致webhook失效的问题 + - v1.2.11(2023-04-20) - 更新whois-servers.txt,感谢[@poctopus](https://github.com/poctopus)贡献代码 diff --git a/README.md b/README.md index d69fe9c3ff..523232cb66 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,21 @@ 支持平台:macOS、Linux、Windows +- 项目地址:https://github.com/mouday/domain-admin +- 国内镜像:https://gitee.com/mouday/domain-admin +- pypi:https://pypi.org/project/domain-admin +- docker:https://hub.docker.com/r/mouday/domain-admin + +## 项目截图 + +网页版: + +![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/screencapture.png) + +桌面端: + +![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/screencapture-desktop.png) + ## 安装 ### 方式一:pip安装 @@ -88,22 +103,6 @@ make dev ## 项目简介 -- 项目地址:https://github.com/mouday/domain-admin -- 国内镜像:https://gitee.com/mouday/domain-admin -- pypi:https://pypi.org/project/domain-admin -- docker:https://hub.docker.com/r/mouday/domain-admin - -项目截图 - - -网页版: - -![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/screencapture.png) - -桌面端: - -![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/screencapture-desktop.png) - 功能: - 权限 @@ -198,13 +197,13 @@ git push -u gitee master 后端选型 - Python3.7.0 -- Flask https://flask.palletsprojects.com/en/2.2.x/ -- jinja2 https://jinja.palletsprojects.com/en/3.1.x/ -- peewee(sqlite) http://docs.peewee-orm.com/en/latest/index.html# -- apscheduler https://apscheduler.readthedocs.io/en/3.x/ -- supervisord http://supervisord.org/index.html -- gunicorn https://docs.gunicorn.org/ - +- [Flask](https://flask.palletsprojects.com/en/2.2.x/) +- [jinja2](https://jinja.palletsprojects.com/en/3.1.x/) +- [peewee(sqlite)](http://docs.peewee-orm.com/en/latest/index.html#) +- [apscheduler](https://apscheduler.readthedocs.io/en/3.x/) +- [supervisord](http://supervisord.org/index.html) 部署推荐 +- [gunicorn](https://docs.gunicorn.org/) mac/linux 推荐 +- [waitress](https://github.com/Pylons/waitress) windows 推荐 ## 问题 @@ -282,6 +281,22 @@ sqlite> .quit 可尝试更换端口25或465 +### 6、webhook模板 + +可以参考接口文档:[更新用户通知配置](docs/notify/updateNotifyOfUser.md) + +### 7、监控域名非443的端口 + +域名格式 + +``` +域名:端口 + +eg: + +www.baidu.com:8080 +``` + ## 问题反馈交流 群号:731742868 @@ -299,8 +314,9 @@ sqlite> .quit - `已完成` 支持域名备注 - `已完成` 支持域名到期数据 - `已完成` webhook支持变量 -- `已完成` 异步操作的前端状态显示 +- `已完成` 异步操作的前端状态显示 - 暗黑模式 +- 支持内网用户自己设置过期时间 证书测试:[https://badssl.com/](https://badssl.com/) diff --git a/docs/notify/updateNotifyOfUser.md b/docs/notify/updateNotifyOfUser.md index f39684d60e..a6e02e6e30 100644 --- a/docs/notify/updateNotifyOfUser.md +++ b/docs/notify/updateNotifyOfUser.md @@ -62,6 +62,8 @@ webhook方式提交的body参数支持[jinja2模板语法](http://doc.yonyouclou } ``` +模板变量同 [获取域名列表](/domain/getDomainList.md) + 6、返回示例 ```json diff --git a/domain_admin/enums/version_enum.py b/domain_admin/enums/version_enum.py index 8ef5c28a1a..3c6a6a7189 100644 --- a/domain_admin/enums/version_enum.py +++ b/domain_admin/enums/version_enum.py @@ -24,3 +24,31 @@ class VersionEnum(object): Version_106 = '1.0.6' Version_110 = '1.1.0' + + Version_111 = '1.1.1' + + Version_112 = '1.1.2' + + Version_113 = '1.1.3' + + Version_114 = '1.1.4' + + Version_115 = '1.1.5' + Version_116 = '1.1.6' + Version_117 = '1.1.7' + Version_118 = '1.1.8' + Version_119 = '1.1.9' + Version_1110 = '1.1.10' + + Version_120 = '1.2.0' + Version_121 = '1.2.1' + Version_122 = '1.2.2' + Version_123 = '1.2.3' + Version_124 = '1.2.4' + + Version_128 = '1.2.8' + Version_129 = '1.2.9' + Version_1210 = '1.2.10' + Version_1211 = '1.2.11' + + Version_1212 = '1.2.12' diff --git a/domain_admin/migrate.py b/domain_admin/migrate.py deleted file mode 100644 index 57927562bd..0000000000 --- a/domain_admin/migrate.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from playhouse.migrate import SqliteMigrator, migrate - -from domain_admin.model.base_model import db -from domain_admin.model.domain_model import DomainModel -from domain_admin.model.group_model import GroupModel - -if __name__ == '__main__': - migrator = SqliteMigrator(db) - - migrate( - # 2022-09-28 - # migrator.add_column(DomainModel._meta.table_name, DomainModel.user_id.name, DomainModel.user_id), - # migrator.add_column(GroupModel._meta.table_name, GroupModel.user_id.name, GroupModel.user_id), - - # 2022-09-27 - # migrator.add_column(DomainModel._meta.table_name, DomainModel.notify_status.name, DomainModel.notify_status), - # migrator.add_column(DomainModel._meta.table_name, DomainModel.ip.name, DomainModel.ip), - ) diff --git a/domain_admin/migrate/migrate_110_to_1212.py b/domain_admin/migrate/migrate_110_to_1212.py new file mode 100644 index 0000000000..201d40d2b7 --- /dev/null +++ b/domain_admin/migrate/migrate_110_to_1212.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +""" +@File : migrate_110_to_1212.py +@Date : 2023-02-06 + +cmd: +$ python domain_admin/migrate/migrate_110_to_1212.py +""" + +from playhouse.migrate import SqliteMigrator, migrate + +from domain_admin.model.base_model import db +from domain_admin.model.domain_model import DomainModel + + +def execute_migrate(): + """ + 版本升级 1.1.0 => 1.2.12 + :return: + """ + migrator = SqliteMigrator(db) + + migrate( + migrator.add_column(DomainModel._meta.table_name, DomainModel.domain_check_time.name, DomainModel.domain_check_time), + migrator.add_column(DomainModel._meta.table_name, DomainModel.ip_check_time.name, DomainModel.ip_check_time), + ) diff --git a/domain_admin/model/cache_domain_info_model.py b/domain_admin/model/cache_domain_info_model.py new file mode 100644 index 0000000000..9cdd7560c0 --- /dev/null +++ b/domain_admin/model/cache_domain_info_model.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +from datetime import datetime + +from peewee import CharField, IntegerField, DateTimeField + +from domain_admin.model.base_model import BaseModel + + +class CacheDomainInfoModel(BaseModel): + """ + 域名信息缓存表 + @since 1.2.12 + """ + id = IntegerField(primary_key=True) + + # 域名 + domain = CharField(unique=True) + + # 域名注册时间 + domain_start_time = DateTimeField(default=None, null=True) + + # 域名过期时间 + domain_expire_time = DateTimeField(default=None, null=True) + + # 缓存过期时间 + expire_time = DateTimeField(default=None, null=True) + + # 创建时间 + create_time = DateTimeField(default=datetime.now) + + # 更新时间 + update_time = DateTimeField(default=datetime.now) + + class Meta: + table_name = 'cache_domain_info' + + @property + def is_expired(self) -> [bool, None]: + """ + 过期时间 + :return: + """ + if self.expire_time: + return (self.expire_time - datetime.now()).seconds <= 0 + else: + return None + + @property + def domain_expire_days(self) -> [int, None]: + """域名过期天数""" + if self.domain_expire_time: + return (self.domain_expire_time - datetime.now()).days + else: + return None diff --git a/domain_admin/model/database.py b/domain_admin/model/database.py index 58c3abce89..63ef5c3569 100644 --- a/domain_admin/model/database.py +++ b/domain_admin/model/database.py @@ -10,6 +10,8 @@ from domain_admin.model import log_scheduler_model from domain_admin.model import notify_model from domain_admin.model import version_model +from domain_admin.model import cache_domain_info_model + # 需要查询初始数据操作的表放前面 tables = [ @@ -20,6 +22,7 @@ (group_model.GroupModel, None), (domain_model.DomainModel, None), (notify_model.NotifyModel, None), + (cache_domain_info_model.CacheDomainInfoModel, None), ] diff --git a/domain_admin/model/domain_model.py b/domain_admin/model/domain_model.py index 6b79d8103f..13b49e3617 100644 --- a/domain_admin/model/domain_model.py +++ b/domain_admin/model/domain_model.py @@ -13,18 +13,21 @@ class DomainModel(BaseModel): """域名""" id = IntegerField(primary_key=True) - # 域名 - domain = CharField() - # 用户id user_id = IntegerField(default=0) + # 域名 + domain = CharField() + # 别名/备注 alias = CharField(default="") # ip ip = CharField(default="") + # ip信息检查时间 @since 1.2.12 + ip_check_time = DateTimeField(default=None, null=True) + # 分组 group_id = IntegerField(default=0, null=False) @@ -37,28 +40,36 @@ class DomainModel(BaseModel): # 域名过期剩余天数,仅用于排序 @since 1.1.0 domain_expire_days = IntegerField(default=0, null=False) + # 域名信息检查时间 @since 1.2.12 + domain_check_time = DateTimeField(default=None, null=True) + # SSL签发时间 start_time = DateTimeField(default=None, null=True) # SSL过期时间 expire_time = DateTimeField(default=None, null=True) - # 连接状态 - connect_status = BooleanField(default=None, null=True) - # SSL过期剩余天数,仅用于排序 expire_days = IntegerField(default=0, null=False) + # 最后检查时间 + check_time = DateTimeField(default=None, null=True) + + # 连接状态 + connect_status = BooleanField(default=None, null=True) + # 有效期总天数 total_days = IntegerField(default=0, null=False) # 通知状态 notify_status = BooleanField(default=True) - # 最后检查时间 - check_time = DateTimeField(default=None, null=True) + # 是否监测 @since 1.0.3 + is_monitor = BooleanField(default=True) + # 详细信息 + # @Deprecated detail_raw = TextField(default=None, null=True) # 创建时间 @@ -67,9 +78,6 @@ class DomainModel(BaseModel): # 更新时间 update_time = DateTimeField(default=datetime.now) - # 是否监测 @since 1.0.3 - is_monitor = BooleanField(default=True) - class Meta: table_name = 'tb_domain' diff --git a/domain_admin/service/cache_domain_info_service.py b/domain_admin/service/cache_domain_info_service.py new file mode 100644 index 0000000000..2396ee592d --- /dev/null +++ b/domain_admin/service/cache_domain_info_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +""" +@File : cache_domain_info_service.py +@Date : 2023-04-22 +""" +from datetime import datetime, timedelta + +from domain_admin.model.cache_domain_info_model import CacheDomainInfoModel +from domain_admin.utils import domain_util +from domain_admin.utils import domain_util +from domain_admin.utils.whois_util import whois_util + + +def get_domain_info(domain: str) -> CacheDomainInfoModel: + """ + 加一个缓存获取域名信息 + :param domain: + :return: + """ + root_domain = domain_util.get_root_domain(domain) + + row = CacheDomainInfoModel.select().where( + CacheDomainInfoModel.domain == root_domain + ).get_or_none() + + # 不存在或者已过期,重新获取 + if not row or row.is_expired is True: + domain_whois = whois_util.get_domain_whois(root_domain) + + if domain_whois is None: + raise Exception("域名信息获取失败") + + row = CacheDomainInfoModel.create( + domain=root_domain, + domain_start_time=domain_whois['start_time'], + domain_expire_time=domain_whois['expire_time'], + expire_time=datetime.now() + timedelta(hours=1) + ) + + return row diff --git a/domain_admin/service/domain_service.py b/domain_admin/service/domain_service.py index 38281d6dcb..67afcb2042 100644 --- a/domain_admin/service/domain_service.py +++ b/domain_admin/service/domain_service.py @@ -3,6 +3,7 @@ import os import time import traceback +import warnings from datetime import datetime from playhouse.shortcuts import model_to_dict @@ -13,12 +14,13 @@ from domain_admin.model.group_model import GroupModel from domain_admin.model.log_scheduler_model import LogSchedulerModel from domain_admin.model.user_model import UserModel -from domain_admin.service import email_service, render_service, global_data_service +from domain_admin.service import email_service, render_service, global_data_service, cache_domain_info_service from domain_admin.service import file_service from domain_admin.service import notify_service from domain_admin.service import system_service from domain_admin.utils import datetime_util, cert_util, whois_util, file_util from domain_admin.utils import domain_util +from domain_admin.utils.cert_util import cert_common from domain_admin.utils.flask_ext.app_exception import AppException, ForbiddenAppException from concurrent.futures import ThreadPoolExecutor @@ -49,18 +51,48 @@ def add_domain(data): return row -def update_domain_cert_info(row): +def update_domain_info(row: DomainModel): """ - 更新域名和证书信息 - :param cache: + 更新域名信息 :param row: :return: """ - logger.info('update_domain_cert_info: %s', row.domain) - # 获取域名信息 - domain_info = get_domain_info(row.domain) + domain_info = cache_domain_info_service.get_domain_info(row.domain) + + DomainModel.update( + domain_start_time=domain_info.domain_start_time, + domain_expire_time=domain_info.domain_expire_time, + domain_expire_days=domain_info.domain_expire_days, + domain_check_time=datetime_util.get_datetime(), + ).where( + DomainModel.id == row.id + ).execute() + + +def update_ip_info(row: DomainModel): + """ + 更新ip信息 + :param row: + :return: + """ + # 获取ip地址 + domain_ip = cert_common.get_domain_ip(row.domain) + + DomainModel.update( + ip=domain_ip, + ip_check_time=datetime_util.get_datetime(), + ).where( + DomainModel.id == row.id + ).execute() + +def update_cert_info(row: DomainModel): + """ + 更新证书信息 + :param row: + :return: + """ # 获取证书信息 cert_info = get_cert_info(row.domain) @@ -68,19 +100,35 @@ def update_domain_cert_info(row): start_time=cert_info.get('start_date'), expire_time=cert_info.get('expire_date'), expire_days=cert_info.get('expire_days'), - domain_start_time=domain_info['start_time'], - domain_expire_time=domain_info['expire_time'], - domain_expire_days=domain_info['expire_days'], total_days=cert_info.get('total_days'), - ip=cert_info.get('ip', ''), + # ip=cert_info.get('ip', ''), connect_status=cert_info.get('connect_status'), - detail_raw=json.dumps(cert_info.get('info'), ensure_ascii=False), + detail_raw="", check_time=datetime_util.get_datetime(), ).where( DomainModel.id == row.id ).execute() +def update_domain_cert_info(row: DomainModel): + """ + 更新域名和证书信息 + :param cache: + :param row: + :return: + """ + logger.info('update_domain_cert_info: %s', row.domain) + + # 域名信息 如果还没有过期,可以不更新 + update_domain_info(row) + + # ip信息 + update_ip_info(row) + + # 证书信息 + update_cert_info(row) + + def get_cert_info(domain: str): now = datetime.now() info = {} @@ -111,7 +159,7 @@ def get_cert_info(domain: str): 'expire_days': expire_days, 'total_days': total_days, 'connect_status': connect_status, - 'ip': info.get('ip', ''), + # 'ip': info.get('ip', ''), 'info': info, } @@ -123,8 +171,9 @@ def get_domain_info(domain: str): :param cache: 查询缓存字典 :return: """ + warnings.warn("use cache_domain_info_service.get_domain_info", DeprecationWarning) - cache = global_data_service.get_value('update_domain_list_info_cache') + # cache = global_data_service.get_value('update_domain_list_info_cache') now = datetime.now() @@ -136,14 +185,14 @@ def get_domain_info(domain: str): extract_result = domain_util.extract_domain(domain) domain_and_suffix = '.'.join([extract_result.domain, extract_result.suffix]) - if cache: - domain_info = cache.get(domain_and_suffix) + # if cache: + # domain_info = cache.get(domain_and_suffix) if not domain_info: try: domain_info = whois_util.get_domain_info(domain_and_suffix) - if cache: - cache[domain_and_suffix] = domain_info + # if cache: + # cache[domain_and_suffix] = domain_info except Exception: logger.error(traceback.format_exc()) @@ -177,8 +226,8 @@ def update_domain_list_info(rows): :return: """ # 增加缓存,提升查询效率 - cache = {} - global_data_service.set_value('update_domain_list_info_cache', cache) + # cache = {} + # global_data_service.set_value('update_domain_list_info_cache', cache) for row in rows: update_domain_cert_info(row) @@ -186,7 +235,7 @@ def update_domain_list_info(rows): # 请求过于频繁 time.sleep(0.5) - global_data_service.remove_value('update_domain_list_info_cache') + # global_data_service.remove_value('update_domain_list_info_cache') def update_all_domain_cert_info_of_user(user_id): @@ -272,6 +321,7 @@ def check_domain_cert(user_id): def update_and_check_all_domain_cert(): + # 开始执行 log_row = LogSchedulerModel.create() error_message = '' @@ -281,40 +331,41 @@ def update_and_check_all_domain_cert(): # 更新全部域名证书信息 update_all_domain_cert_info() - # 配置检查 - config = system_service.get_system_config() - try: - system_service.check_email_config(config) - except Exception as e: - logger.error(traceback.format_exc()) - - status = False - - if isinstance(e, AppException): - error_message = e.message - else: - error_message = str(e) - - # 全员发送 - if status: - rows = UserModel.select() + # 配置检查 跳过邮件检查 可能已经配置了webhook + # config = system_service.get_system_config() + # try: + # system_service.check_email_config(config) + # except Exception as e: + # logger.error(traceback.format_exc()) + # + # status = False + # + # if isinstance(e, AppException): + # error_message = e.message + # else: + # error_message = str(e) - for row in rows: + # 全员检查并发送用户通知 + # if status: + rows = UserModel.select() - # 内层捕获单个用户发送错误 - try: - check_domain_cert(row.id) - except Exception as e: - # traceback.print_exc() - logger.error(traceback.format_exc()) + for row in rows: - status = False + # 内层捕获单个用户发送错误 + try: + check_domain_cert(row.id) + except Exception as e: + # traceback.print_exc() + logger.error(traceback.format_exc()) - if isinstance(e, AppException): - error_message = e.message - else: - error_message = str(e) + # status = False + # + # if isinstance(e, AppException): + # error_message = e.message + # else: + # error_message = str(e) + # 执行完毕 LogSchedulerModel.update({ 'status': status, 'error_message': error_message, @@ -331,6 +382,11 @@ def send_domain_list_email(user_id): :return: """ + # 配置检查 + config = system_service.get_system_config() + + system_service.check_email_config(config) + email_list = notify_service.get_notify_email_list_of_user(user_id) if not email_list: diff --git a/domain_admin/service/version_service.py b/domain_admin/service/version_service.py index e90ac8ee7c..9142c3eddd 100644 --- a/domain_admin/service/version_service.py +++ b/domain_admin/service/version_service.py @@ -8,6 +8,7 @@ from domain_admin.log import logger from domain_admin.migrate import migrate_102_to_103 from domain_admin.migrate import migrate_106_to_110 +from domain_admin.migrate import migrate_110_to_1212 from domain_admin.model.version_model import VersionModel from domain_admin.version import VERSION @@ -67,11 +68,36 @@ def update_version(): # 1.0.3 1.0.4 1.0.5 1.0.6 => 1.1.0 logger.info('update version: %s => %s', local_version, VersionEnum.Version_110) migrate_106_to_110.execute_migrate() - local_version = VersionEnum.Version_110 - # else: - # raise Exception('version update not support: {} => {}'.format(local_version, current_version)) + local_version = VersionEnum.Version_110 + # 2023-04-22 + if local_version in [ + VersionEnum.Version_110, + VersionEnum.Version_111, + VersionEnum.Version_112, + VersionEnum.Version_113, + VersionEnum.Version_114, + VersionEnum.Version_115, + VersionEnum.Version_116, + VersionEnum.Version_117, + VersionEnum.Version_118, + VersionEnum.Version_119, + VersionEnum.Version_1110, + VersionEnum.Version_120, + VersionEnum.Version_121, + VersionEnum.Version_122, + VersionEnum.Version_123, + VersionEnum.Version_124, + VersionEnum.Version_128, + VersionEnum.Version_129, + VersionEnum.Version_1210, + VersionEnum.Version_1211, + ]: + # some => 1.2.12 + logger.info('update version: %s => %s', local_version, VersionEnum.Version_1212) + migrate_110_to_1212.execute_migrate() + local_version = VersionEnum.Version_1212 # 更新版本号 VersionModel.create( diff --git a/domain_admin/utils/cert_util/cert_openssl.py b/domain_admin/utils/cert_util/cert_openssl.py index 5504a99769..c0dbd0fa73 100644 --- a/domain_admin/utils/cert_util/cert_openssl.py +++ b/domain_admin/utils/cert_util/cert_openssl.py @@ -31,7 +31,7 @@ def get_cert_info(domain_with_port): return { 'domain': domain_with_port, - 'ip': cert_common.get_domain_ip(domain), + # 'ip': cert_common.get_domain_ip(domain), 'subject': cert_common.short_name_convert({ 'countryName': subject.countryName, 'commonName': subject.commonName, diff --git a/domain_admin/utils/cert_util/cert_socket.py b/domain_admin/utils/cert_util/cert_socket.py index 21624762b2..36cb2dc1e5 100644 --- a/domain_admin/utils/cert_util/cert_socket.py +++ b/domain_admin/utils/cert_util/cert_socket.py @@ -62,7 +62,7 @@ def get_cert_info(domain_with_port): return { 'domain': domain_with_port, - 'ip': cert_common.get_domain_ip(domain), + # 'ip': cert_common.get_domain_ip(domain), 'subject': cert_common.short_name_convert(subject), 'issuer': cert_common.short_name_convert(issuer), # 'version': cert['version'], diff --git a/domain_admin/utils/domain_util.py b/domain_admin/utils/domain_util.py index ad8ea684cd..aa1a40a42b 100644 --- a/domain_admin/utils/domain_util.py +++ b/domain_admin/utils/domain_util.py @@ -89,3 +89,13 @@ def extract_domain(domain: str) -> ExtractResult: :return: """ return tldextract.extract(domain) + + +def get_root_domain(domain: str) -> str: + """ + 解析出域名和顶级后缀 + :param domain: + :return: + """ + extract_result = extract_domain(domain) + return '.'.join([extract_result.domain, extract_result.suffix]) diff --git a/domain_admin/utils/whois_util/whois-servers.txt b/domain_admin/utils/whois_util/whois-servers.txt index 0405d28787..84f9c83f15 100644 --- a/domain_admin/utils/whois_util/whois-servers.txt +++ b/domain_admin/utils/whois_util/whois-servers.txt @@ -262,7 +262,7 @@ tr whois.nic.tr trade whois.nic.trade travel whois.nic.travel tube whois.nic.tube -tv tvwhois.verisign-grs.com +tv whois.nic.tv tw whois.twnic.net ua whois.net.ua ug whois.co.ug diff --git a/domain_admin/version.py b/domain_admin/version.py index 51608497f8..b43f1334cb 100755 --- a/domain_admin/version.py +++ b/domain_admin/version.py @@ -2,4 +2,4 @@ """ 版本号 """ -VERSION = '1.2.11' +VERSION = '1.2.12' diff --git a/tests/utils/test_whois_util.py b/tests/utils/test_whois_util.py index 3b7a9ad0e2..2679607b4f 100644 --- a/tests/utils/test_whois_util.py +++ b/tests/utils/test_whois_util.py @@ -27,10 +27,10 @@ def test_get_domain_info(): # biz # 'all.biz' - 'dot.tk' + # 'dot.tk' + 'bilibili.tv' ] - for domain in domain_list: - # print(parse_whois_raw(get_whois_raw(domain, ROOT_SERVER))) + print(parse_whois_raw(get_whois_raw(domain, ROOT_SERVER))) print(whois_util.get_domain_info(domain))