Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- host_temp = "hosts"
- host_path = r"C:\Windows\System32\drivers\etc\hosts"
- redirect = "127.0.0.1"
- website_list =['www.facebook.com','facebook.com']
- while True:
- if dt(dt.now().year,dt.now().month,dt.now().day,8) < dt.now() < dt(dt.now().year,dt.now().month,dt.now().day,16):
- print("working")
- with open(host_temp,"r+") as file:
- content = file.read()
- for website in website_list:
- if website in content:
- pass
- else:
- file.write(redirect+" "+ website+"\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement