diff mbox series

[bug#63117] gnu: yt-dlp: Fix substitution for ffmpeg path.

Message ID 20230520134913.14357-1-dds@disroot.org
State New
Headers show
Series [bug#63117] gnu: yt-dlp: Fix substitution for ffmpeg path. | expand

Commit Message

Dominik Delgado Steuter May 20, 2023, 1:49 p.m. UTC
The old expression did not work; ffmpeg was not found
when using the --add-metadata flag.

* gnu/packages/video.scm (yt-dlp)
[arguments]: Adjust substitution in custom 'default-to-the-ffmpeg-input phase.
---
 gnu/packages/video.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


base-commit: 24b6f94cf9b4ab97ef2eb70d05b2104a06776e62

Comments

Ludovic Courtès May 25, 2023, 10:42 a.m. UTC | #1
Hi Dominik,

Dominik Delgado Steuter <dds@disroot.org> skribis:

> The old expression did not work; ffmpeg was not found
> when using the --add-metadata flag.
>
> * gnu/packages/video.scm (yt-dlp)
> [arguments]: Adjust substitution in custom 'default-to-the-ffmpeg-input phase.

Applied.  Thank you and thanks to Liliana for reviewing!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index e6c437f..6d2824f 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -64,6 +64,7 @@ 
 ;;; Copyright © 2022 Chadwain Holness <chadwainholness@gmail.com>
 ;;; Copyright © 2022 Andy Tai <atai@atai.org>
 ;;; Copyright © 2023 Ott Joon <oj@vern.cc>
+;;; Copyright © 2023 Dominik Delgado Steuter <dds@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2569,10 +2570,13 @@  (define-public yt-dlp
         #~(modify-phases #$phases
             ;; See the comment for the corresponding phase in youtube-dl.
             (replace 'default-to-the-ffmpeg-input
-              (lambda _
+              (lambda* (#:key inputs #:allow-other-keys)
                 (substitute* "yt_dlp/postprocessor/ffmpeg.py"
-                  (("\\.get_param\\('ffmpeg_location'\\)" match)
-                   (format #f "~a or '~a'" match (which "ffmpeg"))))))
+                  (("location = self.get_param(.*)$")
+                   (string-append
+                     "location = '"
+                     (dirname (search-input-file inputs "bin/ffmpeg"))
+                     "'\n")))))
             (replace 'build-generated-files
               (lambda* (#:key inputs #:allow-other-keys)
                 (if (assoc-ref inputs "pandoc")