Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion file-tools/file-organizer/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
File Organizer - A tool to clean up your messy folders
File Organizer - A tool to clean up your messy folders

## 📁 New Categories Added

### 🎵 Music
| Extension | Format |
|-----------|--------|
| `.mp3` | MPEG Audio |
| `.wav` | Waveform Audio |
| `.aac` | Advanced Audio Codec |
| `.flac` | Free Lossless Audio Codec |
| `.ogg` | Ogg Vorbis |

### 🎨 Design
| Extension | Format |
|-----------|--------|
| `.psd` | Adobe Photoshop |
| `.ai` | Adobe Illustrator |
| `.eps` | Encapsulated PostScript |
| `.sketch` | Sketch App |
| `.fig` | Figma |
48 changes: 48 additions & 0 deletions social-media/youtube-downloader/downloader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import yt_dlp

"""
Python Automation Hub - YouTube Downloader
A tool to download single videos and playlists with real-time progress.
"""

def progress_hook(d):
if d['status'] == 'downloading':
percent = d.get('_percent_str', 'N/A')
speed = d.get('_speed_str', 'N/A')
eta = d.get('_eta_str', 'N/A')
print(f"\r⬇ Downloading: {percent} | Speed: {speed} | ETA: {eta}", end="", flush=True)
elif d['status'] == 'finished':
print(f"\n✅ Done: {d['filename']}")

ydl_opts = {
'noplaylist': False,
'progress_hooks': [progress_hook],
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
'outtmpl': '%(title)s.%(ext)s',
}

def download(urls):
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
for url in urls:
print(f"\n🎵 Starting: {url}")
try:
ydl.download([url])
except Exception as e:
print(f"❌ Failed: {url} — {e}")

if __name__ == "__main__":
print("🎶 YouTube Downloader — Enter URLs (one per line). Empty line to start:")
urls = []
while True:
url = input("> ").strip()
if not url:
break
urls.append(url)
if urls:
download(urls)
else:
print("No URLs provided.")