Collection of scripts for automating tasks.
- Python 3.10+
- pip packages:
pip install yt-dlp pymupdf playwright Pillow - System dependencies:
ffmpeg(required for YouTube Downloader segment extraction) - Playwright browser:
playwright install chromium(required forhtml2img.pyandconvert_html_to_pdf.py)
| Script | Description |
|---|---|
| html2img.py | Convert HTML file or URL to image (PNG, JPG, WEBP, BMP, TIFF) |
| convert_html_to_pdf.py | Convert HTML file(s) to PDF |
| merge_pdf.py | Merge multiple PDFs into one |
| split_pdf.py | Split PDF into parts or extract page ranges |
| img2pdf.py | Convert image(s) to PDF |
| pdf2img.py | Convert PDF to image(s) |
| rename_file.py | Rename multiple files with pattern matching |
| translate_pdf.py | Translate PDF content (WIP) |
| Script | Description |
|---|---|
| compress_img.py | Batch compress, resize, and convert images |
| dedup_files.py | Find and remove duplicate files by content hash |
python html2img.py page.html output.png
python html2img.py page.html output.png --no-background # transparent
python html2img.py https://example.com screenshot.png # URL support
python html2img.py page.html output.png --full-page --scale 2.0python merge_pdf.py a.pdf b.pdf c.pdf output.pdf
python merge_pdf.py ./docs/ output.pdf --sort date
python split_pdf.py split input.pdf ./parts/
python split_pdf.py extract input.pdf pages_1_to_5.pdf 1 5python compress_img.py photo.jpg output.jpg --quality 75
python compress_img.py ./photos/ ./compressed/ --max-width 1920 --strip-exif
python compress_img.py ./photos/ ./out/ --format webp --recursivepython dedup_files.py ./downloads/ # report only
python dedup_files.py ./photos/ --recursive --ext .jpg,.png
python dedup_files.py ./downloads/ --action move --move-to ./dupes/
python dedup_files.py ./downloads/ --action delete --dry-runSee python/README.md for the full option reference for each script.
| Script | Description |
|---|---|
| yt_downloader.py | Download YouTube videos, audio, or segments by timestamp |
Download full videos/audio or extract specific segments using timestamps.
Full download:
# Video (MP4)
python yt_downloader.py download "URL" -o ./output
# Audio only (MP3)
python yt_downloader.py download "URL" -o ./output --audio-onlySingle segment:
python yt_downloader.py segment "URL" --start 9:48 --end 46:55 -o ./output
python yt_downloader.py segment "URL" --start 9:48 --end 46:55 --label "My Clip" -o ./output --audio-onlyBatch segments from timestamp file:
python yt_downloader.py batch "URL" --timestamps timestamps.txt -o ./output --audio-onlyTimestamp file format — each line is Label START – END:
Juz 16 — Usth Ulfiya 9:48 – 46:55
Juz 17 — Usth Anisah 46:58 – 1:30:36
Juz 18 — Usth Wafa' 1:30:40 – 2:15:10
Supported timestamp formats: M:SS, MM:SS, H:MM:SS. Separators: -, –, —.
Each segment is saved as a separate file named after the label (e.g., Juz 16 — Usth Ulfiya.mp3).