Skip to main content

DMP3

Download youtube video, playlist, channel. Convert to mp3, store into folder. Efficiently refresh mutiple storage folders.

Features:

  • Download all or subset of playlist

  • Download all or most recent n videos from channel

  • Download only additional items, once local storage folder is created

  • Refresh local storage folder with saved parameters

  • Refresh multiple local storage folders

  • Download as video or convert to mp3

Installation

  1. Install Python >= 3.13.

  2. Install package from pypi.

    pip install -U dmp3
  3. Install FFMPEG, it converts media formats.

    Linux

    sudo apt install ffmpeg

    Windows

    1. Install from ffmpeg download page, most likely use windows installer.

    2. Add the bin folder that contains ffmpeg.exe to system path, so that it is available on command line.

Simple Usage

Linux:

cd /home/user/Projects/utube_playlist_mp3_downloader/tests/mp3_dir
dmp3 starcraft_terran -w https://www.youtube.com/playlist?list=PLEtYTVnkBVuZWJ4Gsxtt80tWbiiyy1bcy

Windows:

dmp3 "D:\media\music\game_theme\starcraft_terran" -w https://www.youtube.com/playlist?list=PLEtYTVnkBVuZWJ4Gsxtt80tWbiiyy1bcy

Download as video instead of mp3:

dmp3 starcraft_terran -w https://www.youtube.com/playlist?list=PLEtYTVnkBVuZWJ4Gsxtt80tWbiiyy1bcy -v

Example results:

mp3_dir/
├── diablo1
│   ├── .dmp3
│   ├── Diablo 1 [OST] - 01 - Intro-Y7P7vrvEQYc.mp3
│   ├── Diablo 1 [OST] - 02 - Town-SEpydfXj87M.mp3
│   ├── Diablo 1 [OST] - 03 - Dungeon-yQCg-uHOrZk.mp3
│   ├── Diablo 1 [OST] - 04 - Catacombs-FPQPJwVX-60.mp3
│   ├── Diablo 1 [OST] - 05 - Caves-J9OIyH21ZKo.mp3
│   └── Diablo 1 [OST] - 06 - Hell-5PBG92gkL7I.mp3
└── starcraft_terran
    ├── .dmp3
    ├── StarCraft - Terran Theme 1-mD4GbGmvNRc.mp3
    ├── Starcraft 2 Soundtrack - Terran 01-zAS8KivZX5s.mp3
    ├── Starcraft 2 Soundtrack - Terran 02-sNbTg0Li36k.mp3
    ├── Starcraft 2 Soundtrack - Terran 03-dssNa11htIM.mp3
    ├── Starcraft 2 Soundtrack - Terran 04-4YfQjho2IOk.mp3
    ├── Starcraft 2 Soundtrack - Terran 05-fQluJBSXM5I.mp3
    ├── Terran Theme 2 - Starcraft Soundtrack-_R1QLIo16DY.mp3
    ├── Terran Theme 3 - Starcraft Soundtrack-xcEHDqji74A.mp3
    └── Terran Theme 4 (Brood War) - Starcraft Soundtrack-l9XSZw67QpY.mp3

Refresh multiple local storage folders, each tracking a playlist or a channel:

cd /home/user/Projects/utube_playlist_mp3_downloader/tests/mp3_dir
dmp3 . -r

Usage in python script:

from dmp3 import dmp3
from pathlib import Path

folder = Path("/home/user/Projects/utube_playlist_mp3_downloader/tests/mp3_dir/starcraft_terran")
webpath = "https://www.youtube.com/playlist?list=PLEtYTVnkBVuZWJ4Gsxtt80tWbiiyy1bcy"

dmp3(folder=folder)
dmp3(folder=folder, webpath=webpath, start=1, end=3, refresh_folder_mode=False, mp3=True)
dmp3(folder=folder, webpath=webpath, mp3=False)  # Download as video

API

usage: dmp3 [-h] [-w WEBPATH] [-s START] [-e END] [-r] [-v] folder

Download youtube video, playlist, channel. Convert to mp3, store into folder. Efficiently refresh mutiple storage folders.

Creates folder if not exists.
Otherwise only download additional mp3 into the folder.

If webpath is provided, creates a .dmp3 file in the folder to store parameters.
If not provided, uses saved parameter.

If start and/or end are provided, download only the subset in addition to already downloaded.
If not provided, uses saved parameters if any.

positional arguments:
folder                Folder to store mp3 files

options:
-h, --help            show this help message and exit
-w WEBPATH, --webpath WEBPATH
                        Webpath to download from, creates a .dmp3 file insdie folder to store parameters
-s START, --start START
                        Start index of the playlist
-e END, --end END     End index of the playlist
-r, --refresh_folder_mode
                        Refresh all mp3 folders in the folder, default is False
-v, --video           Download video without converting to mp3 (by default converts to mp3)

Examples:

A video as mp3:
dmp3 . -w "https://www.youtube.com/watch?v=mD4GbGmvNRc"

A video:
dmp3 . -v -w "https://www.youtube.com/watch?v=mD4GbGmvNRc"

Entire playlist:
cd /home/user/Projects/utube_playlist_mp3_downloader/tests/mp3_dir
dmp3 starcraft_terran -w https://www.youtube.com/playlist?list=PLEtYTVnkBVuZWJ4Gsxtt80tWbiiyy1bcy

Part of playlist:
dmp3 starcraft_terran -w https://www.youtube.com/playlist?list=PLEtYTVnkBVuZWJ4Gsxtt80tWbiiyy1bcy -s 1 -e 2

Most recent 5 videos from channel:
dmp3 diablo -w https://www.youtube.com/@Diablo/videos -e 5

Refresh entire or part of playlist:
dmp3 starcraft_terran
dmp3 starcraft_terran -s 5

Refresh channel using saved parameters:
dmp3 diablo

Refresh all storage folders, each with saved parameters:
cd /home/user/Projects/utube_playlist_mp3_downloader/tests/mp3_dir
dmp3 . -r

Metadata

Release files for dmp3 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dmp3 0.0.8
File Size Uploaded Provenance Actions
dmp3-0.0.8.tar.gz 9.6 kB Without provenance Details for dmp3-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dmp3 0.0.8
File Interpreter ABI Platform Actions
dmp3-0.0.8-py3-none-any.whl Python 3 none any Details for dmp3-0.0.8-py3-none-any.whl

Total release size: 17.6 kB

Release files / dmp3-0.0.8.tar.gz

Download URL dmp3-0.0.8.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1f8382816d1db362efeda1a38924df1134181a347dfdbfe59539a3c440894466
BLAKE2b-256 checksum
How to use checksums
4361589e43b59e09a97713f5eff711bc9b6c85f11b1a62f328919c64c2bc0701
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / dmp3-0.0.8-py3-none-any.whl

Download URL dmp3-0.0.8-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43ec3665926a3d3a185763dc25ef91d377d54fd3b1085b7dfad5253375df5121
BLAKE2b-256 checksum
How to use checksums
a1f54cfd05cd2206ee3bd4ebddfd371c2e9d18c88cb7729796f2aa0fe763dd54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Security for dmp3 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page