diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2025-08-12 23:04:40 +0200 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-08-13 12:46:44 +0100 |
| commit | 7227c101b31a3f976e335c3ba85012773ee079e4 (patch) | |
| tree | 2e6cd980705f75c429f17016b742197e483aebba | |
| parent | 56275596836449805158bb9beabdf11997bf4b9b (diff) | |
gnu: Add python-yewtube.
* gnu/packages/video.scm (python-yewtube): New variable.
Change-Id: I4c3d7a40ae09db8649cfc009413731c039435c00
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
| -rw-r--r-- | gnu/packages/video.scm | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 22701aaa889..a16a1d193f0 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -6685,6 +6685,69 @@ and press \"Record\". Peek is optimized for generating animated GIFs, but you can also directly record to WebM or MP4 if you prefer.") (license license:gpl3+))) +(define-public python-yewtube + (package + (name "python-yewtube") + (version "2.12.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mps-youtube/yewtube") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1bvn1zcycsq2gnvs10hn82ic8zp9q4s9gmmi6flahg3wavpnspzr")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'relax-requirements + (lambda _ + (substitute* "mps_youtube/__init__.py" + (("from pip\\._vendor import pkg_resources.*") + "") + (("__version__ =.*") + (format #f "__version__ = ~s~%" + #$(package-version this-package)))) + (substitute* "requirements.txt" + (("httpx.*") + "httpx\n")))) + (add-before 'check 'configure-tests + (lambda _ + (setenv "HOME" (getcwd)))) + ;; XXX: This can happen when some side-effects happens at + ;; initialization. See https://codeberg.org/guix/guix/issues/1089 + (add-before 'sanity-check 'patch-script + (lambda _ + (substitute* (string-append #$output "/bin/.yt-real") + (("import mps_youtube as mod") + "from mps_youtube.main import main") + (("sys\\.exit \\(mod\\.main\\.main \\(\\)\\)") + "sys.exit(main())")))) + (replace 'sanity-check + (lambda _ + (invoke (string-append #$output "/bin/yt") "-h")))))) + (native-inputs + (list python-dbus + python-pygobject + python-pytest + python-setuptools-next + python-wheel)) + (propagated-inputs + (list python-pylast + python-pyperclip + python-requests + python-youtube-search + yt-dlp)) + (home-page "https://github.com/mps-youtube/yewtube") + (synopsis "Terminal based YouTube player and downloader") + (description + "This package provides a terminal based @code{YouTube} player and +downloader. It does not require a Youtube API key.") + (license license:gpl3+))) + (define-public python-youtube-search (package (name "python-youtube-search") |
