# Youtube-dl

youtube-dl is a free and open source software tool for downloading video and audio from YouTube and over 1,000 other video hosting websites. It is released under the Unlicense software license.
As of September 2021, youtube-dl is one of the most starred projects on GitHub, with over 100,000 stars. According to libraries.io, 308 other packages and 1.43k repositories depend on it. Numerous forks exist of the project.

## History

youtube-dl was created in 2006 by Ricardo Garcia. Initially, only YouTube was supported, but as the project grew, it began supporting other video sharing websites.
Ricardo Garcia stepped down as maintainer in 2011 and was replaced by Philipp Hagemeister, who later stepped down and was replaced by dstftw. In 2021, dstftw stepped down and was replaced by dirkf.
In 2021, some community members released a fork of youtube-dl, named youtube-dlc (for "community"). By January 2021, the effort was continuing as yt-dlp. yt-dlp was included in Ubuntu as of the 22.04 release. youtube-dl was removed from Debian 12.0 and Ubuntu 23.10 due to stagnant development and replaced with an empty package depending on yt-dlp.
In August 2023, German company Uberspace took down a web domain which they hosted at their premises for the original youtube-dl project, citing a regional German court order issued from Landgericht Hamburg which appeared to ban the mere hosting of information and GitHub developer links related to the cracking of (non-cryptographic) "rolling ciphers." The GitHub subdomain webpage remains in place.

### RIAA takedown request

On October 23, 2020, the Recording Industry Association of America (RIAA) issued a takedown notice to GitHub under the Digital Millennium Copyright Act (DMCA), requesting the removal of youtube-dl and 17 public forks of the project. The RIAA request argued that youtube-dl violates the Section 1201 anti-circumvention provisions of the DMCA, and provisions of German copyright law, since it circumvents a "rolling cipher" used by YouTube to generate the URL for the video file itself (which the RIAA has considered to be an effective technical protection measure, since it is "intended to inhibit direct access to the underlying YouTube video files, thereby preventing or inhibiting the downloading, copying, or distribution of the video files"), and that its documentation expressly encouraged its use with copyrighted media by listing music videos by RIAA-represented artists as examples. GitHub initially complied with the request.
Users criticized the takedown, noting the legitimate uses for the application, including downloading video content released under open licensing schemes or to create derivative works falling under fair use, or other uses such as journalism, archival and law enforcement. Public attention to the takedown resulted in a Streisand effect reminiscent to that of the DeCSS takedown. Users reposted the software's source code across the internet in multiple formats. For example, users posted images on Twitter containing the whole youtube-dl source code encoded in different colors on each pixel. GitHub users also filed pull requests to GitHub's own repository of DMCA takedown notices that included youtube-dl source code.
On November 16, 2020, the repository was reinstated, after the Electronic Frontier Foundation sent GitHub a letter cautioning that its removal might set a precedent for other copyright holders to misuse the notice-and-takedown process to remove software tools from the Internet based only on the argument that those tools could be used for copyright infringement. Furthermore, the EFF letter asserted that the software was not operating as a "circumvention device", breaching DRM on the video stream, as the stream itself was not encrypted. GitHub also announced that future takedown claims under Section 1201 would be manually scrutinized on a case-by-case basis by legal and technical experts. In response to the saga, the platform launched a fund for providing expert support in writing counter-notifications when contested software was removed, in the hope that this would support fairer outcomes without adding too much friction to the platform's content moderation processes.

### Related takedowns

On September 22, 2020, parallel to the RIAA takedown request, the German webhoster Uberspace was warned by Sony Entertainment, Warner Music Group and Universal Music, for hosting the service on their website. When it failed to respond, the Hamburg Regional Court ruled out that the access to the website will be blocked.

## Example code

For downloading the video or playlist:
The path of the output can be specified as: (file name to be included in the path)
To see the list of all of the available file formats and sizes:
The video can be downloaded by selecting the format code from the list or typing the format manually:
The best quality video can be downloaded with the -f best option. Also, the quality of the audio and video streams can be specified separately and merged with the + operator.
A portion of the video can be downloaded with the help of ffmpeg.