8 atomicparsleySupport ? true,
11 withAlias ? false, # Provides bin/youtube-dl for backcompat
12 update-python-libraries,
15 python3Packages.buildPythonApplication rec {
17 # The websites yt-dlp deals with are a very moving target. That means that
18 # downloads break constantly. Because of that, updates should always be backported
19 # to the latest stable release.
20 version = "2024.11.4";
26 hash = "sha256-7SBMG2G8Vj4TREd2bRqzQxc1QHmeE+u5U+iHzn3PaGU=";
29 build-system = with python3Packages; [
33 # expose optional-dependencies, but provide all features
34 dependencies = lib.flatten (lib.attrValues optional-dependencies);
36 optional-dependencies = {
37 default = with python3Packages; [
46 curl-cffi = [ python3Packages.curl-cffi ];
47 secretstorage = with python3Packages; [
53 pythonRelaxDeps = [ "websockets" ];
55 # Ensure these utilities are available in $PATH:
56 # - ffmpeg: post-processing & transcoding support
57 # - rtmpdump: download files over RTMP
58 # - atomicparsley: embedding thumbnails
63 ++ lib.optional atomicparsleySupport atomicparsley
64 ++ lib.optional ffmpegSupport ffmpeg-headless
65 ++ lib.optional rtmpSupport rtmpdump;
67 lib.optionals (packagesToBinPath != [ ]) [
68 ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"''
72 "build_lazy_extractors"
78 postInstall = lib.optionalString withAlias ''
79 ln -s "$out/bin/yt-dlp" "$out/bin/youtube-dl"
82 passthru.updateScript = [
83 update-python-libraries
88 homepage = "https://github.com/yt-dlp/yt-dlp/";
89 description = "Command-line tool to download videos from YouTube.com and other sites (youtube-dl fork)";
91 yt-dlp is a youtube-dl fork based on the now inactive youtube-dlc.
93 youtube-dl is a small, Python-based command-line program
94 to download videos from YouTube.com and a few more sites.
95 youtube-dl is released to the public domain, which means
96 you can modify it, redistribute it or use it however you like.
98 changelog = "https://github.com/yt-dlp/yt-dlp/blob/HEAD/Changelog.md";
99 license = licenses.unlicense;
100 maintainers = with maintainers; [
104 mainProgram = "yt-dlp";