From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AAPcOZXVZmHpIAEAgWs5BA (envelope-from ) for ; Wed, 13 Oct 2021 14:48:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OPOFNZXVZmFlYgAAB5/wlQ (envelope-from ) for ; Wed, 13 Oct 2021 12:48:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0D8C1B958 for ; Wed, 13 Oct 2021 14:48:21 +0200 (CEST) Received: from localhost ([::1]:38962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1madgC-0000Bo-3F for larch@yhetil.org; Wed, 13 Oct 2021 08:48:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1madew-0006G1-7F for guix-patches@gnu.org; Wed, 13 Oct 2021 08:47:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1madev-0000VV-Ul for guix-patches@gnu.org; Wed, 13 Oct 2021 08:47:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1madev-0008Mn-TP for guix-patches@gnu.org; Wed, 13 Oct 2021 08:47:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51179] [PATCH v2] Re: bug#51179: [PATCH] gnu: Add yt-dlp. Resent-From: Robin Templeton Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 13 Oct 2021 12:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51179 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: 51179@debbugs.gnu.org Received: via spool by 51179-submit@debbugs.gnu.org id=B51179.163412919932126 (code B ref 51179); Wed, 13 Oct 2021 12:47:01 +0000 Received: (at 51179) by debbugs.gnu.org; 13 Oct 2021 12:46:39 +0000 Received: from localhost ([127.0.0.1]:58937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1madeT-0008M1-Ne for submit@debbugs.gnu.org; Wed, 13 Oct 2021 08:46:39 -0400 Received: from minsky.hcoop.net ([104.248.1.95]:42712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1madeR-0008Lj-VW for 51179@debbugs.gnu.org; Wed, 13 Oct 2021 08:46:32 -0400 Received: from [2603:6081:2241:752:71c3:6c06:a290:62ae] (helo=cervus) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1madeM-0006HG-Ih; Wed, 13 Oct 2021 08:46:26 -0400 From: Robin Templeton References: <87pms9mf7a.fsf@terpri.org> Date: Wed, 13 Oct 2021 08:46:16 -0400 In-Reply-To: (Liliana Marie Prikler's message of "Wed, 13 Oct 2021 12:15:39 +0200") Message-ID: <87ee8pm6sn.fsf_-_@terpri.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634129301; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=pUE3D5oLRZqilUM+HyLCRG4WDIVsGPZd1/CiXBSL87Y=; b=U/1nmMnS20dxdxdEc7Tgr73TSwS89lN0SAQX3/i5qNx7C4coPHKOwdTJCjKbfVyMJu7T8y v8wsihA/xgVOKA1wdgxnmDbZp6ZGCEOQdigTDh8mW9YTIcr7wF3E5AI6VHIeVP/x9bM1hD owdyekH+3W7EtED+Jy7G/IWlpds0YNLgOgBqOVl+VOv7NRwSTUlAL3EY1R2fwdrEslA04Z ouUqUl4AU64iazthNLo6NmmluWcVTwIPpM++vGsqF9A1YtK3hRnStyFFB7PwXh72vVjmbv oZ2neQzqYO5Z2ccosbaHSdQ13dgpPpiLlWSLOYAjVO+7teJvYdQaXlu/sclX7Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634129301; a=rsa-sha256; cv=none; b=oejwaayfoZmNWzegDaf0lvJ8010N4QmVaZo7L6lvPCF9pHolr5RGdHu3C7Mughym9R762R 8LbMY6/jjfSWfe1zNiB2f+k9o55gwDi/OsisE4kLzbeetWJKSauyzmNkv5+qvt1/u668q+ dw0sPKsYj6YuZFkRLs9XSN2TMuzqWMT4OvXZFeG9Ffa+HWcniFlhLRovgBDNy5y08o3d91 TbcFe939Uilbop7GMvkLSn29pira1cadZuTDadC0s80dxjsBQe3Ld7B482xRFg7GEUCk7f NyxjmMXn8fOnW+ZUOqfxvASnLx7MHfgKXnEs8NPTUQdsnDqZg5H8VP7ZL7SNew== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.81 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 0D8C1B958 X-Spam-Score: -2.81 X-Migadu-Scanner: scn1.migadu.com X-TUID: nCLc6iYynVoV Liliana Marie Prikler writes: > Am Mittwoch, den 13.10.2021, 05:44 -0400 schrieb Robin Templeton: >> * gnu/packages/video.scm (yt-dlp): New variable. [...] >> +(define-public yt-dlp >> + (package >> + (name "yt-dlp") >> + (version "2021.10.10") > I think yt-dlp can (and ought to) inherit from youtube-dl, which might > simplify some of the below. Agreed, changed in the revised patch below (yt-dlp can't, e.g., directly use youtube-dl's extra phases at the moment, but it should be more maintainable in the future). [...] >> + (snippet >> + '(begin >> + ;; Delete the pre-generated files, except for the >> man page >> + ;; which requires 'pandoc' to build. [...] > Is this the same as for youtube-dl? If not, we might want to give > pandoc as native-input. That will increase build times, but it ought > not to increase closure size. This is analogous to youtube-dl's pandoc avoidance; IMHO youtube-dl ought to use pandoc as a native input, but I wanted to keep the packaging as close to youtube-dl's as possible. [...] >> + (add-before 'build 'build-generated-files >> + (lambda _ >> + ;; Avoid the make targets that require pandoc. >> + (invoke "make" >> + "PYTHON=python" >> + "yt-dlp" >> + ;;"youtube-dl.1" ; needs pandoc >> + "completions"))) >> + (add-before 'install 'fix-the-data-directories >> + (lambda* (#:key outputs #:allow-other-keys) >> + (let ((prefix (assoc-ref outputs "out"))) >> + (substitute* "setup.py" >> + (("'etc/") >> + (string-append "'" prefix "/etc/")) >> + (("'share/") >> + (string-append "'" prefix "/share/"))) >> + #t)))))) > Horizontal space is at a premium and you can save some. I'm not sure where exactly this should use fewer columns, but I squeezed the make invocation onto a single line. v2 also adds three inputs needed for the program to run correctly (updated based on efraim's yt-dlp package, ; in that package, the extra libraries are propagated inputs, but adding them as regular inputs appears to be sufficient). [...] > Otherwise LGTM, but haven't tested. Thanks for the quick review! Patch v2 below. (I tested it on a few YouTube videos and it worked as expected, at least for simple "yt-dlp $URL"-type usage.) --8<---------------cut here---------------start------------->8--- * gnu/packages/video.scm (yt-dlp): New variable. Suggested-by: bdju --- gnu/packages/video.scm | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index fcac369f60..94f5e85e77 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -142,6 +142,7 @@ #:use-module (gnu packages man) #:use-module (gnu packages markup) #:use-module (gnu packages maths) + #:use-module (gnu packages music) #:use-module (gnu packages mp3) #:use-module (gnu packages ncurses) #:use-module (gnu packages networking) @@ -2360,6 +2361,66 @@ YouTube.com and many more sites.") (home-page "https://yt-dl.org") (license license:public-domain))) +(define-public yt-dlp + (package/inherit youtube-dl + (name "yt-dlp") + (version "2021.10.10") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/yt-dlp/yt-dlp/" + "releases/download/" + version "/yt-dlp.tar.gz")) + (sha256 + (base32 + "1ywld4qhvsik970gbac1h3kvxb74r7150m5axq9r5nffdw5sz3vd")) + (snippet + '(begin + ;; Delete the pre-generated files, except for the man page + ;; which requires 'pandoc' to build. + (for-each delete-file '("yt-dlp" + ;;pandoc is needed to generate + ;;"yt-dlp.1" + "completions/bash/yt-dlp" + "completions/fish/yt-dlp.fish" + "completions/zsh/_yt-dlp")) + #t)))) + (arguments + (substitute-keyword-arguments (package-arguments youtube-dl) + ((#:phases phases) + `(modify-phases ,phases + ;; See the comment for the corresponding phase in youtube-dl. + (replace 'default-to-the-ffmpeg-input + (lambda _ + (substitute* "yt_dlp/postprocessor/ffmpeg.py" + (("\\.get\\('ffmpeg_location'\\)" match) + (format #f "~a or '~a'" match (which "ffmpeg")))) + #t)) + (replace 'build-generated-files + (lambda _ + ;; Avoid the yt-dlp.1 target, which requires pandoc. + (invoke "make" "PYTHON=python" "yt-dlp" "completions"))) + (replace 'fix-the-data-directories + (lambda* (#:key outputs #:allow-other-keys) + (let ((prefix (assoc-ref outputs "out"))) + (substitute* "setup.py" + (("'etc/") + (string-append "'" prefix "/etc/")) + (("'share/") + (string-append "'" prefix "/share/")))) + #t)) + (delete 'install-completion))))) + (inputs + `(("python-mutagen" ,python-mutagen) + ("python-pycryptodomex" ,python-pycryptodomex) + ("python-websockets" ,python-websockets) + ,@(package-inputs youtube-dl))) + (description + "yt-dlp is a small command-line program to download videos from +YouTube.com and many more sites. It is a fork of youtube-dl with a +focus on adding new features while keeping up-to-date with the +original project.") + (home-page "https://github.com/yt-dlp/yt-dlp"))) + (define-public youtube-dl-gui (package (name "youtube-dl-gui") -- 2.33.0