Skip to main content

Command line tool to download music from YouTube and SoundCloud

Project description


![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.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

music_dl-0.2.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

music_dl-0.2.1-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file music_dl-0.2.1.tar.gz.

File metadata

  • Download URL: music_dl-0.2.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for music_dl-0.2.1.tar.gz
Algorithm Hash digest
SHA256 80189cd060a129b3e79ed487278bf8db5d6d7e3f22ecdb11b4df654f71681f75
MD5 b9cd8757ae0cbc586ef6d87f0a2a3ff0
BLAKE2b-256 fa530a1a31baaa53d518c6109d095dae2e34516fba5750c34c59cd33af01fd3c

See more details on using hashes here.

File details

Details for the file music_dl-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: music_dl-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for music_dl-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d801aaa9c74590165953847e88c136a99c30bbbb8efcd1fd2900c6b07e8d846d
MD5 d1b9f7420b4dd4ac71b10d987c018567
BLAKE2b-256 6c8f97059a05c777fe509ad5a7289cfd3941e352dc03feace67c2e0d38690906

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page