From patchwork Mon Oct 25 03:36:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robin Templeton X-Patchwork-Id: 34033 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7EF9A27BBE3; Mon, 25 Oct 2021 04:37:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0394027BBE1 for ; Mon, 25 Oct 2021 04:37:28 +0100 (BST) Received: from localhost ([::1]:40430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meqne-0002ZA-Uw for patchwork@mira.cbaines.net; Sun, 24 Oct 2021 23:37:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meqnG-0002Yl-CC for guix-patches@gnu.org; Sun, 24 Oct 2021 23:37:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meqnG-0003oK-33 for guix-patches@gnu.org; Sun, 24 Oct 2021 23:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1meqnF-0006QU-Tq for guix-patches@gnu.org; Sun, 24 Oct 2021 23:37:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51179] [PATCH] gnu: Add yt-dlp. Resent-From: Robin Templeton Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Oct 2021 03:37: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.163513300124669 (code B ref 51179); Mon, 25 Oct 2021 03:37:01 +0000 Received: (at 51179) by debbugs.gnu.org; 25 Oct 2021 03:36:41 +0000 Received: from localhost ([127.0.0.1]:41373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meqmn-0006PY-7G for submit@debbugs.gnu.org; Sun, 24 Oct 2021 23:36:41 -0400 Received: from minsky.hcoop.net ([104.248.1.95]:49444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meqml-0006PK-8Z for 51179@debbugs.gnu.org; Sun, 24 Oct 2021 23:36:31 -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 1meqmf-0007bI-KN; Sun, 24 Oct 2021 23:36:25 -0400 From: Robin Templeton References: <87pms9mf7a.fsf@terpri.org> <87ee8pm6sn.fsf_-_@terpri.org> <99268fb747b2278cc0e279c5efc83f5bbbfaccf1.camel@gmail.com> <8735opvlvd.fsf@terpri.org> Date: Sun, 24 Oct 2021 23:36:24 -0400 In-Reply-To: <8735opvlvd.fsf@terpri.org> (Robin Templeton's message of "Sun, 24 Oct 2021 23:12:06 -0400") Message-ID: <87wnm1u66f.fsf_-_@terpri.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/video.scm (yt-dlp): New variable. Co-authored-by: Morgan Smith Suggested-by: bdju --- Add check phase from Morgan's package and use latest yt-dlp release gnu/packages/video.scm | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index d2a2a08ee3..a2ae26987a 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -53,6 +53,7 @@ ;;; Copyright © 2020 Hartmut Goebel ;;; Copyright © 2021 Raghav Gururajan ;;; Copyright © 2021 Petr Hodina +;;; Copyright © 2021 Robin Templeton ;;; ;;; This file is part of GNU Guix. ;;; @@ -142,6 +143,7 @@ (define-module (gnu packages video) #: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 +2362,74 @@ (define-public youtube-dl (home-page "https://yt-dl.org") (license license:public-domain))) +(define-public yt-dlp + (package/inherit youtube-dl + (name "yt-dlp") + (version "2021.10.22") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/yt-dlp/yt-dlp/" + "releases/download/" + version "/yt-dlp.tar.gz")) + (sha256 + (base32 + "0xh4cwmvx49pxn8x07wj2dy8ynj6xg8977l5493vv0l8zc27wp87")) + (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) + ((#:tests? _) #t) + ((#: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) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-k" "not download")))))))) + (inputs + `(("python-mutagen" ,python-mutagen) + ("python-pycryptodomex" ,python-pycryptodomex) + ("python-websockets" ,python-websockets) + ,@(package-propagated-inputs youtube-dl))) + (native-inputs + `(("python-pytest" ,python-pytest) + ,@(package-native-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")