Package Details: yt-dlp-git 2024.03.10.r9.g86d2f4d-1

Git Clone URL: https://aur.archlinux.org/yt-dlp-git.git (read-only, click to copy)
Package Base: yt-dlp-git
Description: A youtube-dl fork with additional features and fixes (git)
Upstream URL: https://github.com/yt-dlp/yt-dlp
Licenses: Unlicense
Conflicts: yt-dlp
Provides: yt-dlp
Submitter: katt
Maintainer: katt
Last Packager: katt
Votes: 43
Popularity: 1.47
First Submitted: 2021-08-08 15:20 (UTC)
Last Updated: 2024-03-17 17:40 (UTC)

Dependencies (24)

Required by (114)

Sources (1)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 Next › Last »

katt commented on 2023-07-30 07:16 (UTC)

@ruro python-mutagen and python-pycryptodomex is already in optdepends.

ruro commented on 2023-07-29 22:47 (UTC)

This package should probably declare python-brotli, python-mutagen and python-pycryptodomex as dependencies, since the upstream package depends on them.

drws commented on 2023-05-17 03:24 (UTC)

Probably 'phantomjs' should be listed as an optional dependency.

katt commented on 2023-05-09 14:10 (UTC) (edited on 2023-05-09 14:11 (UTC) by katt)

I'm not really a fan of the messy solution rekman came up with, unsafe ls or the solution gesh posted, the latter since it just seems to pick the first item in dist, which seems the opposite of what we want.

Either way while writing this I went and looked on the wiki page and found there are new guidelines for python VCS packages, and I will implement them shortly.

https://wiki.archlinux.org/title/Python_package_guidelines#Standards_based_(PEP_517)

rekman commented on 2023-05-09 13:58 (UTC)

I'm still not 100% sold because we shouldn't really trust times. The system clock could change for any number of reasons, daylight savings, the time zone could change. Corner cases? Yes, but these are some of the worst to debug.

gesh commented on 2023-05-09 13:42 (UTC) (edited on 2023-05-09 13:42 (UTC) by gesh)

OK, then adapt the advice in FAQ099 wheels=(dist/*.whl); python -m installer … "${wheels[0]}"

rekman commented on 2023-05-09 13:35 (UTC) (edited on 2023-05-09 13:35 (UTC) by rekman)

Parsing ls is considered harmful. But I agree my solution is kind of ugly.

gesh commented on 2023-05-09 13:24 (UTC)

Instead, couldn't we filter the glob, eg --destdir="$(ls "$pkgdir"/dist/*.whl | sort -n | head -n1)" (Am afk, might've made a typo here)

rekman commented on 2023-05-09 13:11 (UTC) (edited on 2023-05-09 13:12 (UTC) by rekman)

The package fails to build if there is already a wheel in src/yt-dlp/dist/, i.e., a previous version was built in the same directory.

This is because the main packaging command uses a glob: python -m installer --destdir="$pkgdir" dist/*.whl but the installer command excepts a single .whl filename. Thus you can reproduce with touch dist/test.whl.

Annoyingly it doesn't seem like there is way to ask the python build system what the name of the built wheel is. Well, it tells you something like

Successfully built yt_dlp-2023.3.4-py2.py3-none-any.whl

but this occurs in build() and if we read output there we'd have to put it in global scope which is unvirtuous.

For now a workaround is

diff --git a/PKGBUILD b/PKGBUILD
@@ -39,5 +39,6 @@ check() {

 package() {
     cd "${pkgname%-git}"
-    python -m installer --destdir="$pkgdir" dist/*.whl
+    local tag=$(git describe --tags | cut -d- -f1 | sed -E 's/(^|\.)0*([1-9]+)/\1\2/g')
+    python -m installer --destdir="$pkgdir" dist/yt_dlp-$tag-py2.py3-none-any.whl
 }

The sed step is necessary because the git tag of the latest release is 2023.03.04 but as you can see the wheel filename strips leading zeros. This is not particularly future-proof because we have hardcoded the wheel tags py2.py3-none-any but as far as I can tell wheel tags are WRITE ONLY. Python packaging makes me want to be dead.