URL Redirect Checker is a web-based tool that allows users to upload a text file containing URLs and receive an Excel file with the redirect status and the redirected URLs.
- Upload a text file with URLs.
- Check each URL for redirection.
- Generate an Excel file with the results.
- User-friendly web interface.
- Python
- Flask
- Requests
- Pandas
- TQDM
- HTML/CSS
- Python 3.x
- Pip (Python package installer)
-
Clone the repository:
git clone https://github.com/srma4tech/redirect-checker.git cd redirect-checker -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Run the Flask application:
python app.py
-
Open your web browser and navigate to:
http://127.0.0.1:5000/ -
Upload a text file with URLs:
- Click on the "Browse" button to select your text file containing URLs.
- Click "Upload" to process the file.
-
Download the resulting Excel file:
- Once the processing is complete, the Excel file will be available for download.
This is the main Flask application file. It contains the following key components:
- Imports: Necessary libraries for handling HTTP requests, data processing, and file handling.
- check_redirect(url): Function to check if a URL redirects and returns the status and redirected URL.
- process_urls(urls): Function to process a list of URLs, check for redirection, and generate an Excel file in memory.
- Flask Routes:
/: Renders the main HTML page./upload: Handles file uploads, processes the URLs, and returns the Excel file for download.
This is the HTML template for the main page. It includes a form for file upload and links to the CSS file for styling.
This CSS file provides styles for the HTML template, making the UI more visually appealing.
This file lists all the Python packages required to run the application.
-
Create a text file named
urls.txtwith the following content:http://example.com http://google.com http://nonexistent.url -
Run the Flask application:
python app.py
-
Open your web browser and navigate to:
http://127.0.0.1:5000/ -
Upload the
urls.txtfile:- Click on the "Browse" button to select
urls.txt. - Click "Upload" to process the file.
- Click on the "Browse" button to select
-
Download the resulting Excel file:
- Once the processing is complete, the Excel file will be available for download.
- Concurrency: Implement threading or asynchronous requests to speed up URL checking.
- Error Handling: Improve error handling to manage different types of HTTP errors more gracefully.
- User Interface: Enhance the UI with more features, such as progress bars, status messages, and better error reporting.
- Logging: Add logging to capture detailed information about the processing for debugging purposes.
- Deployment: Consider deploying the application using a web server like Gunicorn or Nginx for production use.
This project is licensed under the MIT License. See the LICENSE file for details.
- Flask: Flask Documentation
- Requests: Requests Documentation
- Pandas: Pandas Documentation
- TQDM: TQDM Documentation
- OpenPyXL: OpenPyXL Documentation
Feel free to contribute to this project by submitting issues or pull requests. Your feedback and contributions are welcome!