[python]自动镜像网站
import os
import time
def mirror_homepage(url):
command = f"wget --convert-links --adjust-extension --page-requisites --no-parent -P . {url}"
os.system(command)
print(f"成功镜像首页: {url}")
def main():
url = 'http://xxx' # 替换为要镜像的网站URL
while True:
mirror_homepage(url)
time.sleep(3600) # 每隔一个小时
if __name__ == "__main__":
main()