From 7f8da6f95522c6b1d16d38465175af2b79034090 Mon Sep 17 00:00:00 2001 From: xueweihan <595666367@qq.com> Date: Wed, 12 Jun 2024 15:02:49 +0800 Subject: [PATCH] update script --- fetch_ips.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/fetch_ips.py b/fetch_ips.py index bd20a23d9..cc1eb5dd6 100644 --- a/fetch_ips.py +++ b/fetch_ips.py @@ -140,20 +140,20 @@ def main(verbose=False) -> None: print('Start script.') session = HTMLSession() content = "" - content_list = get_json(session) - for item in content_list: - content += item[0].ljust(30) + item[1] + "\n" - # content_list = [] - # for index, github_url in enumerate(GITHUB_URLS): - # try: - # ip = get_ip(session, github_url) - # - # content += ip.ljust(30) + github_url + "\n" - # content_list.append((ip, github_url,)) - # except Exception: - # continue - # if verbose: - # print(f'process url: {index + 1}/{len(GITHUB_URLS)}') + # content_list = get_json(session) + # for item in content_list: + # content += item[0].ljust(30) + item[1] + "\n" + content_list = [] + for index, github_url in enumerate(GITHUB_URLS): + try: + ip = get_ip(session, github_url) + + content += ip.ljust(30) + github_url + "\n" + content_list.append((ip, github_url,)) + except Exception: + continue + if verbose: + print(f'process url: {index + 1}/{len(GITHUB_URLS)}') if not content: return