My Downloads folder had 1,400 files in it.

PDFs mixed with screenshots, ZIP files buried under random .tmp files, video clips I downloaded once and forgot about. Every time I needed something, it took me five minutes of scrolling to find it.

So I wrote a Python script to fix it. It took about 20 minutes to write, and now I run it whenever things get messy.

Here's exactly how it works — and the full code you can copy.

What the script does