Skip to content

Commit 74d3f4c

Browse files
authored
Update trackerslist.py
1 parent ff5cfab commit 74d3f4c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

trackerslist.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import requests
2+
from datetime import datetime
23

34
# 要下载的文件链接列表
45
urls = [
@@ -31,9 +32,13 @@ def merge_files(contents):
3132
# 合并文件并去除空行
3233
merged_content = merge_files(file_contents)
3334

35+
# 添加当前时间到合并结果的第一行
36+
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
37+
merged_content_with_time = f"当前合并完成的时间: {current_time}\n{merged_content}"
38+
3439
# 保存合并结果到文件
3540
output_file = "trackerslist.txt"
3641
with open(output_file, "w") as file:
37-
file.write(merged_content)
42+
file.write(merged_content_with_time)
3843

3944
print(f"文件已合并为 {output_file}")

0 commit comments

Comments
 (0)