From d0c1e82cfd57efaf4fc7c83a70c98838aae03921 Mon Sep 17 00:00:00 2001 From: Johnshall Date: Mon, 23 May 2022 17:48:52 +0800 Subject: [PATCH] =?UTF-8?q?=E2=8C=9B=EF=B8=8F=20Add=20time=20and=20change?= =?UTF-8?q?=20file=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- factory/top500_manual.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/factory/top500_manual.py b/factory/top500_manual.py index 7410042..a5f0c5f 100644 --- a/factory/top500_manual.py +++ b/factory/top500_manual.py @@ -10,19 +10,22 @@ import time import threading import csv +now_time = time.strftime("%Y-%m-%d %H:%M:%S") url = 'https://moz.com/top-500/download/?table=top500Domains' r = requests.get(url) -with open("top500Domains.csv", "wb") as code: - code.write(r.content) +with open("resultant/top500Domains.csv", "wb") as raw: + raw.write(r.content) -with open('top500Domains.csv','r') as csvfile: +with open('resultant/top500Domains.csv','r') as csvfile: reader = csv.reader(csvfile) with open("resultant/top500_manual.list", "w") as file_domain_in: + file_domain_in.write('# top500 proxy list update time: ' + now_time + '\n') for domain_i,rows in enumerate(reader): if domain_i != 1: for domain_n in reader: file_domain_in.write(domain_n[1] + '\n') - + +print('Get top500 list successfully...\n\n') # Read top500 domains = [] @@ -75,7 +78,7 @@ print('top500 Script Starting...\n\n') # Start Thread scaner_thread_num = 0 -for i in range(5): +for i in range(10): DomainScaner().start() scaner_thread_num += 1 @@ -88,7 +91,6 @@ while scaner_thread_num: file_proxy = open('resultant/top500_proxy.list', 'w', encoding='utf-8') file_direct = open('resultant/top500_direct.list', 'w', encoding='utf-8') -now_time = time.strftime("%Y-%m-%d %H:%M:%S") file_proxy.write('# top500 proxy list update time: ' + now_time + '\n') file_direct.write('# top500 direct list update time: ' + now_time + '\n')