From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 13 06:15:56 2021 Received: (at 51179) by debbugs.gnu.org; 13 Oct 2021 10:15:56 +0000 Received: from localhost ([127.0.0.1]:58471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mabId-0008IU-7r for submit@debbugs.gnu.org; Wed, 13 Oct 2021 06:15:56 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mabIZ-0008IF-Cy for 51179@debbugs.gnu.org; Wed, 13 Oct 2021 06:15:49 -0400 Received: by mail-wr1-f65.google.com with SMTP id t2so6508352wrb.8 for <51179@debbugs.gnu.org>; Wed, 13 Oct 2021 03:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=LixeefSJ+rykGL10YWOYXdR2Du1lcdBZc4cYARW3pis=; b=kslA2lYIf9t2jXOS2yp3LXjj1PhWOs7SdBwwo1KVgfIui4RMocl7fjr44wX6Q1KW66 SvSeMVsLelF4J/YAgmh/TEiRzq+eC6qx4gkTWOK6e/+zwa2js9cz063cIOymwd8+AN7M +5EGeb9r94AkrPwyJxwoqZN+0sV1nibyeUtqE7B8TtoFZgfb1Bf7o8PRitaVTnLey+83 pT5X7XU39S6z77tKJwFKiaKQe6NZ+QB3yOQN05nKYk8ph1N/+OfssFrvBhvZXtW4Q78P wjBCh2CyOnYB9B3yriCmfj+SGU0n7AlkZno0AUVukIjuIVDeDCO11Tfs1jnmszgPcAal 9Rqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=LixeefSJ+rykGL10YWOYXdR2Du1lcdBZc4cYARW3pis=; b=OCInbHupE9Q5+sp345nD6b9zEQAkFlzGXB9qa0BvTGgJVXEB02ZOeGoDskIkJHYQ89 JMiYzmcx3z06HhdelHUuLaJ2pua6yb/v2L+S/n0ZU788I5lRxNzafiutX7Xw9zz1OA/A 9bVnEKps4hMHO4pimg210HlwHDoVjsrGNrHkiXx8ekW7PljKH4wnz4iGfZ1Qa5PENXK0 9R+VseYDLqGSn0bt7UI+9XmjRopcR0xpjrjHRBmJITfQLqdM3jkuljTX3vkuZPOwXCWb EIlM2ti2hKLxQwnoZH/nUl4z8eSBDNLQNmoqr8ty2d/m45NL7wL+MmDMzgeBvWM/jg9C UKqg== X-Gm-Message-State: AOAM530Y4FIuPAUJM3qMPwdmnkNPsO0PCPizUInpMI/G80sc8vHGeLRH /D7yFf2dNj8l1tsibUk+qLSydDveEx8= X-Google-Smtp-Source: ABdhPJzhjvBJmv0bXy7nHv8DCHRMzNvfA3s3LcSuxW/ERmX3BN6hlygZyCS3FflEO1hEmZivMjFEzg== X-Received: by 2002:a5d:6245:: with SMTP id m5mr38955003wrv.148.1634120141471; Wed, 13 Oct 2021 03:15:41 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id d2sm14052386wrc.32.2021.10.13.03.15.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 03:15:41 -0700 (PDT) Message-ID: Subject: Re: [PATCH] gnu: Add yt-dlp. From: Liliana Marie Prikler To: Robin Templeton , 51179@debbugs.gnu.org Date: Wed, 13 Oct 2021 12:15:39 +0200 In-Reply-To: <87pms9mf7a.fsf@terpri.org> References: <87pms9mf7a.fsf@terpri.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51179 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Robin, Am Mittwoch, den 13.10.2021, 05:44 -0400 schrieb Robin Templeton: > * gnu/packages/video.scm (yt-dlp): New variable. > > Suggested-by: bdju > --- > gnu/packages/video.scm | 71 > ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 71 insertions(+) > > diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm > index fcac369f60..1aceac25eb 100644 > --- a/gnu/packages/video.scm > +++ b/gnu/packages/video.scm > @@ -2360,6 +2360,77 @@ YouTube.com and many more sites.") > (home-page "https://yt-dl.org") > (license license:public-domain))) > > +(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. > + (source (origin > + (method url-fetch) > + (uri (string-append "https://github.com/yt-dlp/yt-dlp/ > " > + "releases/download/" > + version "/yt-dlp.tar.gz")) > + (sha256 > + (base32 > + "1ywld4qhvsik970gbac1h3kvxb74r7150m5axq9r5nffdw5sz3v > d")) > + (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)))) 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. > + (build-system python-build-system) > + (arguments > + ;; The problem here is that the directory for the man page and > completion > + ;; files is relative, and for some reason, setup.py uses the > + ;; auto-detected sys.prefix instead of the user-defined " > --prefix=FOO". > + ;; So, we need pass the prefix directly. > + `(#:tests? #f ; Many tests fail. The test suite can be run with > pytest. > + #:phases (modify-phases %standard-phases > + (add-after 'unpack 'default-to-the-ffmpeg-input > + (lambda _ > + ;; See ;. > + ;; ffmpeg is big but required to request free > formats > + ;; from, e.g., YouTube so pull it in > unconditionally. > + ;; Continue respecting the --ffmpeg-location > argument. > + (substitute* "yt_dlp/postprocessor/ffmpeg.py" > + (("\\.get\\('ffmpeg_location'\\)" match) > + (format #f "~a or '~a'" match (which > "ffmpeg")))) > + #t)) > + (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. > + (native-inputs > + `(("zip" ,zip))) > + (inputs > + `(("ffmpeg" ,ffmpeg))) > + (synopsis "Download videos from YouTube.com and other sites") > + (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") > + (license license:public-domain))) Otherwise LGTM, but haven't tested. Regards, Liliana