Skip to main content

![Python](https://img.shields.io/badge/Python-3.4%20%7C%203.5%20%7C%203.6-blue.svg)
![System](https://img.shields.io/badge/System-Mac%20OS%20X-brightgreen.svg)
![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)

# Overview

**Music Downloader** is the command line tool to download music from YouTube and SoundCloud.<br/>
This package requires the Python interpreter 3.4+ and tested only on Mac OS X Mojave.<br/>
It is released to the public domain, which means you can modify it, redistribute it or use it however you like.



# Installation

You need to install following dependencies before using Music Downloader.

```
$ brew install ffmpeg atomicparsley libmagic
```

Music Downloader can be installed using pip.

```
$ pip install --upgrade music-dl
```




# Usage

## Options

Music Downloader offers following options.

```
$ music-dl --help

Music Downloader 0.2.1

Usage: music-dl --url http://youtube.com/watch?v=<video_id>&list=<playlist_id>
--dir ~/Music/Download
--codec m4a
--bitrate 128
--no-track-number
--no-compilation

Optional Arguments:
-u, --url <str> URL to download. [Default: Clipboard Value]
-d, --dir <str> Path to working directory. [Default: /Users/kojirof/Music/Downloads]
-c, --codec <str> [m4a,mp3,flac] Preferred audio codec. [Default: m4a]
-b, --bitrate <int> Preferred audio bitrate. [Default: 198]
-s, --start <int> Index specifying playlist item to start at.
Default value is index of first song on playlist. [Default: 1]
-e, --end <int> Index specifying playlist item to end at.
Default value is index of last song on playlist. [Default: 0]
--no-artwork Forbid adding artwork to audio metadata.
--no-track-number Forbid adding track number to audio metadata.
--no-album-title Forbid adding album title to audio metadata.
--no-album-artist Forbid adding album artist to audio metadata.
--no-composer Forbid adding composer to audio metadata.
--no-compilation Forbid adding part of compilation flag to audio metadata.
--open-dir Open download directory after all songs are downloaded.
--verbose Print verbose message.
--help Show this help message and exit.

```


## Example

Music Downloader can download music by combining various options. Here are some examples.

### Download music of the URL copied to the clipboard. (No option requried)

```
$ music-dl
```

### Download single song

```
$ music-dl --url https://www.youtube.com/watch?v=video_id

$ music-dl --url https://soundcloud.com/artist_id/song_id
```

### Set audio quality and download all songs from playlist to specific directory

```
$ music-dl --url https://www.youtube.com/watch?v=video_id&list=playlist_id \
--dir ~/Downloads/Music \
--codec m4a \
--bitrate 128

$ music-dl --url https://soundcloud.com/artist_id/sets/playlist_id \
--dir ~/Downloads/Music \
--codec mp3 \
--bitrate 320
```

### Download songs from the 7th to 10th of playlist

```
$ music-dl --url https://www.youtube.com/watch?v=video_id&list=playlist_id \
--playlist-start 7 \
--playlist-end 10

$ music-dl --url https://soundcloud.com/artist_id/sets/playlist_id \
--playlist-start 7 \
--playlist-end 10
```

### Download songs from the 7th to the end of playlist

```
$ music-dl --url https://www.youtube.com/watch?v=video_id&list=playlist_id \
--playlist-start 7

$ music-dl --url https://soundcloud.com/artist_id/sets/playlist_id \
--playlist-start 7
```

### Download songs without adding track number to metadata

```
$ music-dl --url https://www.youtube.com/watch?v=video_id&list=playlist_id \
--no-track-number

$ music-dl --url https://soundcloud.com/artist_id/sets/playlist_id \
--no-track-number
```





# Known Issues

- If you requested an official YouTube playlist (aka YouTube Mix), downloaded songs are different from the playlist displayed on your browser, except for the first song. This is caused that YouTube generates a random playlist for each request.<br>
If you request to resume downloading the same playlist, the consistency of track numbers registered in the metadata will be lost.



# Copyright

Music Downloader is released into the public domain by the copyright holders.<br/>
This README file was written by [Gumob](https://github.com/gumob) and is likewise released into the public domain.


Metadata

Release files for music-dl 0.2.1

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

Source distribution (sdist)

Source distribution for music-dl 0.2.1
File Size Uploaded
music_dl-0.2.1.tar.gz 20.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for music-dl 0.2.1
File Interpreter ABI Platform
music_dl-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 43.1 kB

Release files / music_dl-0.2.1.tar.gz

Download URL music_dl-0.2.1.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
80189cd060a129b3e79ed487278bf8db5d6d7e3f22ecdb11b4df654f71681f75
BLAKE2b-256 checksum
How to use checksums
fa530a1a31baaa53d518c6109d095dae2e34516fba5750c34c59cd33af01fd3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release files / music_dl-0.2.1-py3-none-any.whl

Download URL music_dl-0.2.1-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d801aaa9c74590165953847e88c136a99c30bbbb8efcd1fd2900c6b07e8d846d
BLAKE2b-256 checksum
How to use checksums
6c8f97059a05c777fe509ad5a7289cfd3941e352dc03feace67c2e0d38690906
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

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