Skip to main content
![Travis CI](https://api.travis-ci.org/vmassuchetto/beets-ydl.svg?branch=master)

# beets ydl

Download audio from youtube-dl sources and import into beets

$ beet ydl "https://www.youtube.com/watch?v=wW6ykueIhX8"

$ beet ls short music for short people

59 Times the Pain - Short Music for Short People - We Want the Kids
7 Seconds - Short Music for Short People - F.O.F.O.D.
88 Fingers Louie - Short Music for Short People - All My Friends Are in Popular Bands
Adrenalin O.D. - Short Music for Short People - Your Kung Fu Is Old... And Now You Must Die!
Aerobitch - Short Music for Short People - Steamroller Blues
[...]

## Installation

pip install beets-ydl

And enable `ydl` plugin on your `config.yaml` file.

## Configuration

Available options on `config.yaml`:

- `download`: will download files from sources after getting information,
defaults to `True`

- `split_files`: will try to split album files into separate tracks, defaults
to `True`

- `import`: will import files on youtube-dl after downloading and splitting,
defaults to `True`

- `urls`: a list of default urls to download when no arguments are provided, you
can provide a playlist to get checked every time

- `youtubedl_options` is a dictionary of
[a lot of youtube-dl options available](https://git.io/fN0c7)

Example:

```yaml
plugins: ydl

ydl:
split_files: true
urls:
- url1
- url2
- url3
youtubedl_options:
postprocessors:
key': 'SomeOtherExtractor',
preferredcodec: 'ogg'
```
## Tips

### Use a `.netrc` file

Security discussions apart, you can create a `~/.netrc` with credentials for
youtube-dl to read.

machine youtube login somelogin@gmail.com password somepassword

Check [this entry](https://git.io/fN2TD) on youtube-dl docs for more
information.

Like this, you can download private playlists or your subscriptions:

beet ydl "https://www.youtube.com/feed/subscriptions"

### Download and import later

To download and split files without importing into beets:

beet ydl "<source>" --keep-files --no-import

And later, to import:

beet ydl "<source>" --no-download --no-split-files

Like this, you can download a big playlist and then run the beets import
routine, which requires manual intervention.

### (possibly) enhance audio quality

beets-ydl uses a proposed [192kbps extractor 'bestaudio'](https://git.io/fN2mJ)
format because it is more likely that it will find separate audio files on
sources. Some high quality videos might have better audio quality embedded, so
it can also make sense to set a higher quality extractor:

```yaml
ydl:
youtubedl_options:
format: 'best',
postprocessors:
key: 'FFmpegExtractAudio'
preferredcodec: 'mp3'
preferredquality: '320'
nopostoverwrites: True
```

This can, however, end-up with unnecessarily big files that have 320kbps as a
merely nominal quality. See [this discussion](https://askubuntu.com/q/634584).

## Development

Execute the env script to get into a virtualenv.

. ./env.develop

Metadata

Release files for beets-ydl 0.0.4

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

Source distribution (sdist)

Source distribution for beets-ydl 0.0.4
File Size Uploaded
beets-ydl-0.0.4.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beets-ydl 0.0.4
File Interpreter ABI Platform
beets_ydl-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / beets-ydl-0.0.4.tar.gz

Download URL beets-ydl-0.0.4.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c9f12b201132bcb30c97f681c7c96c3a56a6d538532d5ed929c8a30b38d33fc2
BLAKE2b-256 checksum
How to use checksums
e7bdb91bf667ec908f8766a023ad5a026e64375b3e7b91b85dca94a6eb05f813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release files / beets_ydl-0.0.4-py3-none-any.whl

Download URL beets_ydl-0.0.4-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5831443b6fa7aa7c0ac0471e193e37b6072ede9e05733c556754cb7ddb147aa4
BLAKE2b-256 checksum
How to use checksums
67b309a0c20d1bd5286684867a0f9abf9e3a61c720f7259abe25aedab1f5893a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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