Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit cbfb43e

Browse files
Merge pull request #160 from Phillibob55/master
Website blocker and unblocker
2 parents f58ac9c + 0fd3e65 commit cbfb43e

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
To block a website, put it inside the website list in both files.
2+
Run these scripts as administrator
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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+
8+
redirect="127.0.0.1"
9+
websites=["https://www.sislovesme.com/","https://motherless.com/","https://xhamster.com/","https://www.xnxx.com/","https://www.xvideos.com/","https://www.pornhub.com/"]
10+
11+
with open(pathToHosts,'r+') as file:
12+
content=file.read()
13+
for site in websites:
14+
if site in content:
15+
pass
16+
else:
17+
file.write(redirect+" "+site+"\n")
18+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
8+
websites=["https://www.sislovesme.com/","https://motherless.com/","https://xhamster.com/","https://www.xnxx.com/","https://www.xvideos.com/","https://www.pornhub.com/"]
9+
10+
with open(pathToHosts,'r+') as file:
11+
content=file.readlines()
12+
file.seek(0)
13+
for line in content:
14+
if not any(site in line for site in websites):
15+
file.write(line)
16+
file.truncate()
17+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /