all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: Robin Templeton <robin@terpri.org>, 51179@debbugs.gnu.org
Subject: [bug#51179] [PATCH] gnu: Add yt-dlp.
Date: Wed, 13 Oct 2021 12:15:39 +0200	[thread overview]
Message-ID: <aa296b61dbd63cd5a5b7132cfe641f45ff99dd8a.camel@gmail.com> (raw)
In-Reply-To: <87pms9mf7a.fsf@terpri.org>

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 <bdju@tilde.team>
> ---
>  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 <https://issues.guix.gnu.org/43418#5>;.
> +                      ;; 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





  reply	other threads:[~2021-10-13 10:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13  9:44 [bug#51179] [PATCH] gnu: Add yt-dlp Robin Templeton
2021-10-13 10:15 ` Liliana Marie Prikler [this message]
2021-10-13 12:46   ` [bug#51179] [PATCH v2] Re: bug#51179: " Robin Templeton
2021-10-13 14:53     ` Liliana Marie Prikler
2021-10-25  3:12       ` [bug#51179] " Robin Templeton
2021-10-25  3:36         ` Robin Templeton
2021-10-26 12:54           ` bug#51179: " Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa296b61dbd63cd5a5b7132cfe641f45ff99dd8a.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=51179@debbugs.gnu.org \
    --cc=robin@terpri.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.