git.iko.soy/typeable/nixpkgs
on master help sign in
yt-dlp: init at 2021.07.21
commite40ceba3fc172b6610eb0da96384636e08a510e2 authorMaciej Krüger <mkg20001@gmail.com> dateTue 10 Aug 2021, 06:49 (5 years ago) parent53bd443
3 files changed+73
pkgs/tools/misc/yt-dlp/default.nix+62 pkgs/top-level/all-packages.nix+4 pkgs/top-level/python-packages.nix+7
pkgs/tools/misc/yt-dlp/default.nixnew file+62
@@ -0,0 +1,62 @@
1+{ lib, fetchurl, buildPythonPackage
2+, zip, ffmpeg, rtmpdump, phantomjs2, atomicparsley, pycryptodome, pandoc
3+, fetchFromGitHub
4+, websockets, mutagen
5+, ffmpegSupport ? true
6+, rtmpSupport ? true
7+, phantomjsSupport ? false
8+, hlsEncryptedSupport ? true
9+, installShellFiles, makeWrapper }:
10+
11+buildPythonPackage rec {
12+ pname = "yt-dlp";
13+ # The websites yt-dlp deals with are a very moving target. That means that
14+ # downloads break constantly. Because of that, updates should always be backported
15+ # to the latest stable release.
16+ version = "2021.07.21";
17+
18+ src = fetchFromGitHub {
19+ owner = "yt-dlp";
20+ repo = "yt-dlp";
21+ rev = version;
22+ sha256 = "ziOW52LJUBe0j7ru8GYgiUCE6YJeBTTjm+H6W8EZjuY=";
23+ };
24+
25+ nativeBuildInputs = [ installShellFiles makeWrapper ];
26+ buildInputs = [ zip pandoc ];
27+ propagatedBuildInputs = [ websockets mutagen ]
28+ ++ lib.optional hlsEncryptedSupport pycryptodome;
29+
30+ # Ensure these utilities are available in $PATH:
31+ # - ffmpeg: post-processing & transcoding support
32+ # - rtmpdump: download files over RTMP
33+ # - atomicparsley: embedding thumbnails
34+ makeWrapperArgs = let
35+ packagesToBinPath = [ atomicparsley ]
36+ ++ lib.optional ffmpegSupport ffmpeg
37+ ++ lib.optional rtmpSupport rtmpdump
38+ ++ lib.optional phantomjsSupport phantomjs2;
39+ in [ ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"'' ];
40+
41+ setupPyBuildFlags = [
42+ "build_lazy_extractors"
43+ ];
44+
45+ # Requires network
46+ doCheck = false;
47+
48+ meta = with lib; {
49+ homepage = "https://github.com/yt-dlp/yt-dlp/";
50+ description = "Command-line tool to download videos from YouTube.com and other sites (youtube-dl fork)";
51+ longDescription = ''
52+ yt-dlp is a youtube-dl fork based on the now inactive youtube-dlc.
53+
54+ youtube-dl is a small, Python-based command-line program
55+ to download videos from YouTube.com and a few more sites.
56+ youtube-dl is released to the public domain, which means
57+ you can modify it, redistribute it or use it however you like.
58+ '';
59+ license = licenses.publicDomain;
60+ maintainers = with maintainers; [ mkg20001 ];
61+ };
62+}
pkgs/top-level/all-packages.nix+4
@@ -28660,6 +28660,10 @@ with pkgs;
2866028660
2866128661 youtube-dl-light = with python3Packages; toPythonApplication youtube-dl-light;
2866228662
28663+ yt-dlp = with python3Packages; toPythonApplication yt-dlp;
28664+
28665+ yt-dlp-light = with python3Packages; toPythonApplication yt-dlp-light;
28666+
2866328667 youtube-viewer = perlPackages.WWWYoutubeViewer;
2866428668
2866528669 ytalk = callPackage ../applications/networking/instant-messengers/ytalk { };
pkgs/top-level/python-packages.nix+7
@@ -9529,6 +9529,13 @@ in {
95299529 phantomjsSupport = false;
95309530 };
95319531
9532+ yt-dlp = callPackage ../tools/misc/yt-dlp { };
9533+
9534+ yt-dlp-light = callPackage ../tools/misc/yt-dlp {
9535+ ffmpegSupport = false;
9536+ phantomjsSupport = false;
9537+ };
9538+
95329539 youtube-search = callPackage ../development/python-modules/youtube-search { };
95339540
95349541 youtube-transcript-api = callPackage ../development/python-modules/youtube-transcript-api { };