Skip to content

SumanCH8514/Python-Scripts

Repository files navigation

Python Scripts Collection

This repo is a toolbox of personal Python utilities for media management and downloading. It is not a single package; each script is meant to be run directly and does one focused job. The workspace contains top-level music utilities plus two subprojects for video watermarking and YouTube downloads.

Folder Layout

  1. ai_music_organizer.py
  2. music_Organizer.py
  3. music_organizer_old.py
  4. rename_songs.py
  5. duplicate_file_deleter.py
  6. Video-watermark/
  7. Youtube-dl-py/

What Each Script Does Top-level scripts:

  1. ai_music_organizer.py
    Organizes .mp3 and .m4a files in a target folder into language or style categories using Gemini AI when available, with a fallback keyword matcher. It only scans the top level (no recursive search), previews the planned moves in batches, and asks for confirmation before moving files. Categories: English, Hindi, Arabic, Bengali, Remix, Unplugged, Jhankar, Unknown.
  2. music_Organizer.py
    A similar AI organizer with smaller batches and .mp3-only scanning. It uses Gemini for classification when configured, otherwise falls back to keyword matching.
  3. music_organizer_old.py
    Older AI organizer variant with larger batches and a stricter rate-limit pause strategy.
  4. rename_songs.py
    Renames .mp3 and .m4a files from metadata tags using TinyTag, strips promo junk from tags, keeps only the first artist if multiple are listed, and appends a postfix like - songs.SumanOnline.Com. It avoids overwriting by adding (1), (2), etc.
  5. duplicate_file_deleter.py
    Deletes duplicate files that follow the name (1).ext pattern after a confirmation prompt.

Video-watermark project:

  1. Video-watermark/watermark.py
    Advanced watermarking tool that can apply text, logo, or both. It processes each frame using OpenCV, uses FFmpeg to preserve audio, and writes output to Video-watermark/watermarked_videos/.
  2. Video-watermark/watermark.png
    Sample logo file used by the watermark script.

YouTube-dl-py project:

  1. Youtube-dl-py/yt-dlp.py
    Full-featured downloader using yt-dlp with audio/video modes, thumbnail download, FFmpeg conversion, and MP3 metadata embedding via mutagen.
  2. Youtube-dl-py/yt_downloader.py
    Simpler audio or video downloader with a quality selection menu.
  3. Youtube-dl-py/yt-video-dl.py
    Video-only downloader with quality selection.
  4. Youtube-dl-py/video_based.py
    Downloads media and adds a watermark to videos using FFmpeg drawtext. Also embeds metadata for audio.
  5. Youtube-dl-py/with_photo.py
    Downloader that embeds thumbnails into MP3 files using mutagen.
  6. Youtube-dl-py/add-watermark-videos.py
    Batch watermarking for local videos with audio preserved via moviepy. Outputs to Youtube-dl-py/watermarked_videos/.
  7. Youtube-dl-py/add-watermark-videos-no-audio.py
    Watermarking without audio preservation, implemented purely with OpenCV.
  8. Youtube-dl-py/watermark.py
    Interactive watermark tool similar to the one in Video-watermark/, using OpenCV and FFmpeg.
  9. Youtube-dl-py/test.py
    Test downloader script for videos.
  10. Youtube-dl-py/watermark.png and Youtube-dl-py/arial.ttf
    Assets used by watermarking and text rendering tools.

Requirements Python 3.9+ is recommended. Install only what you need for the scripts you run.

AI music organizers:

python -m pip install google-genai

Music renamer:

python -m pip install tinytag tqdm

Video watermarking:

python -m pip install opencv-python numpy tqdm moviepy

YouTube downloaders:

python -m pip install yt-dlp mutagen requests

System tools:

  1. FFmpeg must be installed and available on your PATH for scripts that convert media or preserve audio.

How To Run AI music organizer:

python ai_music_organizer.py "D:\Music\ToSort"

Fallback organizer:

python music_Organizer.py "D:\Music\ToSort"

Rename files by tags:

python rename_songs.py

Delete duplicates:

python duplicate_file_deleter.py

Video watermarking:

cd Video-watermark
python watermark.py

YouTube downloads:

cd Youtube-dl-py
python yt-dlp.py

Outputs

  1. Video-watermark/watermarked_videos/ stores processed videos.
  2. Youtube-dl-py/downloads/ stores downloaded audio and video files.
  3. Youtube-dl-py/watermarked_videos/ stores watermarked outputs for local batch processing.
  4. Temporary folders like temp_watermark/ are created during processing and cleaned up automatically.

Safety Notes

  1. duplicate_file_deleter.py deletes files permanently after confirmation. Use it on a backup or verify the target folder first.
  2. The organizer scripts move files to category folders. They preview each batch and require confirmation before moving.

Security Notes Some organizer scripts currently hardcode a Gemini API key. It is safer to move that key to an environment variable or config file and remove it from the script before sharing or committing.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages