Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 7e35c15

Browse files
committed
fixed
1) Removed the indent error 2) Made linux compatible
1 parent 5f41e29 commit 7e35c15

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed
Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
pathToHosts=r"C:\Windows\System32\drivers\etc\hosts"
1+
import platform
2+
3+
if platform.system() == "Windows":
4+
pathToHosts=r"C:\Windows\System32\drivers\etc\hosts"
5+
elif platform.system() == "Linux":
6+
pathToHosts=r"~\etc\hosts"
7+
28
redirect="127.0.0.1"
39
websites=["https://www.sislovesme.com/","https://motherless.com/","https://xhamster.com/","https://www.xnxx.com/","https://www.xvideos.com/","https://www.pornhub.com/"]
410

511
with open(pathToHosts,'r+') as file:
6-
content=file.read()
7-
for site in websites:
8-
if site in content:
9-
pass
10-
else:
11-
file.write(redirect+" "+site+"\n")
12+
content=file.read()
13+
for site in websites:
14+
if site in content:
15+
pass
16+
else:
17+
file.write(redirect+" "+site+"\n")
1218

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import platform
2+
3+
if platform.system() == "Windows":
4+
pathToHosts=r"C:\Windows\System32\drivers\etc\hosts"
5+
elif platform.system() == "Linux":
6+
pathToHosts=r"~\etc\hosts"
7+
18
pathToHosts=r"C:\Windows\System32\drivers\etc\hosts"
29
websites=["https://www.sislovesme.com/","https://motherless.com/","https://xhamster.com/","https://www.xnxx.com/","https://www.xvideos.com/","https://www.pornhub.com/"]
310

411
with open(pathToHosts,'r+') as file:
5-
content=file.readlines()
6-
file.seek(0)
7-
for line in content:
8-
if not any(site in line for site in websites):
9-
file.write(line)
10-
file.truncate()
12+
content=file.readlines()
13+
file.seek(0)
14+
for line in content:
15+
if not any(site in line for site in websites):
16+
file.write(line)
17+
file.truncate()
1118

0 commit comments

Comments
 (0)