Skip to main content

vidl

vidl is a script designed to easily download video/audio from anywere, using yt-dlp. It automatically embeds thumbnails to mp3/mp4/m4a files.

vidl will add metadata to mp3 files if it's found. The --no-md option turns this off. title, artist and year metadata is added, but if the URL is a playlist, it also adds album, album artist, track number, track count. If the title contains " - ", vidl often uses what comes before and after it as artist and title respectively. The --dont-extract-md option turns off this behaviour.

Installation

  1. Install Python (3.7+ is recommended)
  2. Install ffmpeg and ffprobe
  3. Run pip3 install vidl.
  4. If you're not on macOS or Windows, you need to specify where vidl will download files to in your vidl config file. Run vidl --config-path to see where the config file is. If you're on macOS, I recommend setting up shortcuts for vidl

Updating

vidl is updated by running pip3 install vidl --upgrade --upgrade-strategy eager. If vidl is unable to download a URL, it might be because yt-dlp is outdated. The --upgrade-strategy eager part updates yt-dlp.

Uninstall

Run pip3 uninstall vidl.

To fully uninstall vidl, go to vidl's config file (Run vidl --config-path to see where it is) and delete the folder it's in.

Usage

Examples: vidl https://www.youtube.com/watch?v=ta_ZVS7HkwI

  • Downloads the video as mp3, and adds metadata it detects.

vidl mp3 https://www.youtube.com/watch?v=ta_ZVS7HkwI --no-md

  • Downloads the video as mp3, without adding metadata.

vidl

  • Prints vidl's help menu, which looks like this:
     Download Usage:
     	vidl [format] [options] <URL>
    
     Download Options:
     	format             bestvideo, bestaudio (default), mp3, mp4, wav, m4a, or opus
     	--no-md            Don't add metadata to downloaded files
     	--no-smart-md      Don't extract artist and song name from title
     	--no-embed         Don't embed thumbnail
     	--no-dl            Don't download anything. Usually used with -v
     	-v, --verbose      Display all logs
    
     General Options:
     	--version          Show version. vidl -v and vidl version works too
     	-h, --help         Show this help message. vidl help works too
     	--config-path      Show the location of the configuration file
    
     Update:
     	pip3 install vidl --upgrade --upgrade-strategy eager
    

Configuration

vidl has a configuration file, which you can find the location of by running vidl --config-path. In it, you can set the download folder and filename template.

If you screw something up, you can delete the file, and the default will be recreated the next time you run vidl.

Custom metadata parsing

vidl has a user_md_parser.py file. By default, it does nothing, but you can configure it to manipulate metadata of songs you download however you like. For example you could remove "[NCS Release]" from the title.

Documentation for this can be found in the file itself. The file is in the same folder as vidl's config file, which you can find by by running vidl --config-path. If you screw something up, you can delete the file, and the default will be recreated the next time you run vidl.

Set up shortcuts for vidl (macOS)

Download the vidl.shortcut file or try this link. You'll be able to select any piece of text, press your chosen shortcut and the link(s) in your selected text will be downloaded!

You can set your preferred keyboard shortcut here:

API Usage

You can use Python to download a URL. Example:

from vidl import config, dl

def main():
	config.verify_config()
	dl.download({
		# all options are required
		'url': 'https://www.youtube.com/watch?v=82IZ63TU8Fs'
		'file_format': 'mp3',
		'audio_only': True,
		'no_md': False,
		'no_thumbnail_embed': False,
		'no_smart_md': False,
		'no_dl': False,
		'verbose': False,
		'download_folder': config.get_config('download_folder'),
		'output_template': config.get_config('output_template'),
	})
main()

Dev Instructions

Dev Installation

  1. Install Python. You may want to install it using pyenv in order to manage Python versions (If Poetry doesn't detect the right version, you can fix it with pyenv).
  2. Install ffmpeg and ffprobe
  3. Install Poetry
  4. Run poetry install to install Python package dependencies.
  5. If you're not on macOS or Windows, you need to specify where vidl will download files to in your vidl config file. Run vidl --config-path to see where the config file is.

I recommend running poetry config virtualenvs.in-project true, which makes Poetry store your Python virtual environment inside the project folder. Additionally, it lets VSCode's Python extension detect the virtual environment if you set the python.pythonPath setting to ${workspaceFolder}/.venv/bin/python in your settings.

Running

poetry run vidl

An alternative to poetry run <command> is to run poetry shell to enter the virtual environment's Bash CLI, and then run the command on it's own (e.g vidl).

Releasing a new version

First of all, consider updating the lockfile dependencies by running poetry update, then check if things still work.

  1. Bump the version number. <version> can be patch, minor, major or a version number:
    poetry version <version>
    
  2. Update CHANGELOG.md
  3. Build:
    poetry build
    
  4. Commit and create a git tag
  5. Create GitHub release with release notes and attach the build files
  6. Publish to PyPI:
    poetry publish
    

Release files for vidl 5.0.0

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

Source distribution (sdist)

Source distribution for vidl 5.0.0
File Size Uploaded
vidl-5.0.0.tar.gz 8.2 kB Details

Built distribution (wheel)

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

Total release size: 18.5 kB

Release files / vidl-5.0.0.tar.gz

Download URL vidl-5.0.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ef22e2f246faf325930a307000e6f607edd3a40fd3cde3aa7a06e2fb20608d0e
BLAKE2b-256 checksum
How to use checksums
2a00f7db1f20042b7ff342987e7143a3c9bd5c2d372a5d2c5f1b909e883f32fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.1 Darwin/22.6.0

Release files / vidl-5.0.0-py3-none-any.whl

Download URL vidl-5.0.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
144ead55ad31ba61c53bca0b84a683f0eb4a0316d817d66184c381e8f9737d2c
BLAKE2b-256 checksum
How to use checksums
88378244b1eb2b92e7eed2b5cc582e0596fab857dfeeb240aa0cf17ec39af9e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.1 Darwin/22.6.0

Release history Release notifications | RSS feed

This release

5.0.0 This release

2 release files

4.4.0

2 release files

4.3.2

2 release files

4.3.1

2 release files

4.3.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.6.5

2 release files

3.6.4

2 release files

3.6.3

2 release files

3.6.2

2 release files

3.6.1

2 release files

3.6.0

2 release files

3.5.1

2 release files

3.5.0

2 release files

3.4.10

2 release files

3.4.9

2 release files

3.4.8

2 release files

3.4.7

2 release files

3.4.6

2 release files

3.4.5

2 release files

3.4.4

2 release files

3.4.3

2 release files

3.4.2

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.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