
Boost your productivity with the Website Blocker!
This simple Python tool helps you block distracting websites like Facebook, Instagram etc., during your focus hours. Whether you're studying, working, or just trying to stay off from social media, this tool ensures you stay on track.
Make the most of your time. Stay productive with Website Blocker.
Block distractions and Unlock focus.
Website Blocker is a Python script that helps users to avoid distractions by blocking specific websites (e.g., Facebook, Instagram) during a selected time (e.g., 7 AM to 10 AM).
It works by modifying the system’s hosts
file to redirect those websites to 127.0.0.1
, making them inaccessible during that period.
- Requires admin/root privileges to edit system files.
- Only works on local machines.
- Time range is fixed in code (can be modified manually).
- Add GUI for selecting websites and blocking hours.
- Notification before blocking/unblocking.
- Option to log blocked attempts.
- Set specific hours to block websites.
- Improves focus and productivity.
- Customizable website list and time range.
- Automatically unblocks sites after the set time.
- Python 3.7 or higher version
- Clone the Repository
git clone https://github.com/deepikagandla7456/Website-Blocker.git cd Website-Blocker
- Run the Script
Make sure to run it as Administrator on Windows or use
python app.py
sudo
on Mac/Linux.
-
This script continuously checks the system time.
-
If current time is in between 7 AM and 10 AM, it blocks the sites listed in
website_list
-
Outside that time range, it unblocks those websites.
-
You can change time and sites by editing the values in
app.py
Websites like Facebook, Instagram etc., open normally before the script starts running.
When the script runs between 7 AM and 10 AM, the listed websites are blocked and show an error message when accessed.
Once the blocking time ends, the websites are unblocked and accessible again as usual.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.