The Download Sorter is a Python script designed to automatically organize files in your downloads directory based on their types. It identifies files by their extensions and moves them to specific subdirectories for better organization.
- Automatically sorts files by type into dedicated folders.
- Handles common file types like images, documents, audio, video, and more.
- Avoids overwriting existing files with a unique filename generation.
- Customizable for additional file types and destinations.
- Linux
- Windows
- Python 3.x installed on your system.
- Clone this repository to your local machine.
git clone https://github.com/s3h4n/DL-Sorter.git- Run the script by executing
python dl_sorter.py. - The script will automatically organize your files into designated folders in your Downloads directory based on their types.
You can customize the script by adding or modifying file types and their corresponding paths. Edit structure.json file
to include your preferred file types and destinations.
{
"Category": {
"type": [
".ext1",
".ext2"
],
"path": "Directory/Sub-Directory"
},
"Add more custom file types and paths here...": ""
}- Open the Task Scheduler. You can search for it in the Start Menu.
- Click on
Create Basic Task…. - Name the task and add a description.
- Choose the
DailyorWeeklyorMonthlyoption depending on your preference. - Set the start time and date for the task.
- In the
Actionstep, chooseStart a program. - Browse and select your Python executable file (python.exe, which is usually located in the Python directory).
- In the
Add argumentsfield, type the path of thedl_sorter.py. - Click
Finish.
- Open Terminal.
- Type
crontab -eto edit the cron table. - Add a new line in the following format to run this script:
* * * * * /usr/bin/python3 /path/to/your/dl_sorter.py- The five asterisks can be replaced with:
-
Minute (0 - 59)
-
Hour (0 - 23)
-
Day of month (1 - 31)
-
Month (1 - 12)
-
Day of week (0 - 7) (Sunday = 0 or 7)
-
For example, if you want to run your script every hour, you would write:
0 * * * * cd /path/to/cloned-repo/ && python dl_sorter.py- Save and exit.
The script generates a log file named dl_sorter.log to track its activity and errors. You can find this log file in
the same directory as the script.
This script is open for contributions. If you have any improvements or bug fixes, feel free to submit a pull request.
This project is licensed under the Apache v2 License. See the LICENSE file for details.
Inspired by the need for better organization in our Downloads folder.