From f71472fccc6fa894ec1be945614d6baf4f40d56c Mon Sep 17 00:00:00 2001 From: tdro Date: Tue, 2 Nov 2021 00:48:07 -0400 Subject: .config/nixpkgs/packages/youtube-dl: Swap to yt-dlp --- .config/nixpkgs/packages/youtube-dl/default.nix | 66 +++++++++---------------- 1 file changed, 23 insertions(+), 43 deletions(-) (limited to '.config/nixpkgs/packages') diff --git a/.config/nixpkgs/packages/youtube-dl/default.nix b/.config/nixpkgs/packages/youtube-dl/default.nix index 7887edb..5a0ab1d 100644 --- a/.config/nixpkgs/packages/youtube-dl/default.nix +++ b/.config/nixpkgs/packages/youtube-dl/default.nix @@ -1,56 +1,36 @@ -{ python38Packages, lib, fetchurl, zip, ffmpeg, rtmpdump, phantomjs2 -, atomicparsley, pandoc, generateManPage ? true, ffmpegSupport ? true -, rtmpSupport ? true, phantomjsSupport ? false, hlsEncryptedSupport ? true -, installShellFiles, makeWrapper }: +{ lib, python39, ffmpeg, rtmpdump, phantomjs2, atomicparsley +, ffmpegSupport ? true, rtmpSupport ? true, phantomjsSupport ? false +, hlsEncryptedSupport ? true, withAlias ? true }: -python38Packages.buildPythonPackage rec { +with python39.pkgs; - pname = "youtube-dl"; - version = "2021.05.16"; +buildPythonPackage rec { + pname = "yt-dlp"; + version = "2021.10.22"; - src = fetchurl { - url = "https://yt-dl.org/downloads/${version}/${pname}-${version}.tar.gz"; - sha256 = "1z8sdzvkxhscnzy7cnjag308glif0k8jylr11biqwzypm1f2l0fl"; + src = fetchPypi { + inherit pname; + version = builtins.replaceStrings [ ".0" ] [ "." ] version; + sha256 = "sha256-okuWZr0iNBSeTajE8Wu45fdGwpQo0S7gT8HBG1JHowc="; }; - nativeBuildInputs = [ installShellFiles makeWrapper ]; - buildInputs = [ zip ] ++ lib.optional generateManPage pandoc; - propagatedBuildInputs = - lib.optional hlsEncryptedSupport python38Packages.pycryptodome; + propagatedBuildInputs = [ websockets mutagen ] ++ lib.optional hlsEncryptedSupport pycryptodomex; - makeWrapperArgs = let - packagesToBinPath = [ atomicparsley ] ++ lib.optional ffmpegSupport ffmpeg - ++ lib.optional rtmpSupport rtmpdump - ++ lib.optional phantomjsSupport phantomjs2; + makeWrapperArgs = let packagesToBinPath = [ atomicparsley ] + ++ lib.optional ffmpegSupport ffmpeg + ++ lib.optional rtmpSupport rtmpdump + ++ lib.optional phantomjsSupport phantomjs2; in [ ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"'' ]; - setupPyBuildFlags = [ "build_lazy_extractors" ]; - - postInstall = '' - installShellCompletion youtube-dl.zsh - ''; - doCheck = false; + setupPyBuildFlags = [ "build_lazy_extractors" ]; + postInstall = lib.optionalString withAlias ''ln -s "$out/bin/yt-dlp" "$out/bin/youtube-dl"''; meta = with lib; { - homepage = "https://ytdl-org.github.io/youtube-dl/"; - description = - "Command-line tool to download videos from YouTube.com and other sites"; - longDescription = '' - youtube-dl is a small, Python-based command-line program - to download videos from YouTube.com and a few more sites. - youtube-dl is released to the public domain, which means - you can modify it, redistribute it or use it however you like. - ''; - license = licenses.publicDomain; - platforms = with platforms; linux ++ darwin; - maintainers = with maintainers; [ - bluescreen303 - phreedom - AndersonTorres - fpletz - enzime - ma27 - ]; + license = licenses.unlicense; + maintainers = with maintainers; [ mkg20001 ]; + homepage = "https://github.com/yt-dlp/yt-dlp/"; + changelog = "https://github.com/yt-dlp/yt-dlp/raw/${version}/Changelog.md"; + description = "Command-line tool to download videos from YouTube.com and other sites (youtube-dl fork)"; }; } -- cgit v1.2.3