youtube-dl

Table of Contents

youtube-dl is a tool to downlaod video/audio from html links like “https://www.youtube.com/watch?v=RwhFZHihRAE”. edit(Tue Feb 27 20:29:10 2024): Using yt-dlp from apt (with Ubuntu 23.04), works well.

1. Valid one

The official repo at https://github.com/ytdl-org/youtube-dl is inactive and the build stopped at 2021.

The last build still have various problems, and is significantly slower than the current build(from repo), so Instead of the 2021 build, download from https://github.com/ytdl-org/ytdl-nightly, which is the newst build.

There’s also active forks like https://github.com/yt-dlp/yt-dlp

1.1. correction Wed Oct 11 17:23:33 2023 - use yt-dlp from github

youtube-dl-nightly is not working anymore. precisely, this release download a youtube video at 60kb/s, showing might be throttled warning, while yt-dlp download at 12mb/s.

However, the apt yt-dlp package cannot download the same video at all, showing [download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (2/10)...

Go for https://github.com/yt-dlp/yt-dlp and download the excutable there. (https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp)

2. How to use

typically, youtube-dl url / yt-dlp would suffice

2.1. zsh

make sure to qoute your url - otherwise if your url contains ?, you’ll see zsh: no matches found: [your url], as ? have meaning in zsh.

2.2. certificate

youtube-dl url may encounter

ERROR: Unable to download API page: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1124)> (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1124)')))

probelm.

from dirkf, github: Work-around: --no-check-certificate (but then, obvs, the certificate is not being checked).

Solution: update the certificates used by your Python installation. Review #31189, also pytube/pytube#241 (comment).

Backlinks

tools

Tools I use on daily basis:

Tools I use on per-task basis:

Author: Linfeng He

Created: 2024-04-03 Wed 20:17