CCCPaste

yt-dlp-git

# Maintainer: Antonio Rojas 
# Contributor: Stefan Tatschner 
# Contributor: katt 

pkgname=yt-dlp-git
pkgver=2025.10.22.r14.g79f9232
pkgrel=1
pkgdesc='A feature-rich command-line audio/video downloader (Development version)'
arch=('any')
url="https://github.com/yt-dlp/yt-dlp"
license=('Unlicense')
depends=('python' 'python-certifi' 'python-requests' 'python-urllib3')
makedepends=('git' 'python-build' 'python-hatch-vcs' 'python-hatchling' 'python-installer')
optdepends=('aria2: for using aria2 as external downloader'
            'deno: for solving JavaScript challenges using an external runtime (recommended)'
            'ffmpeg: for video post-processing'
            'rtmpdump: for rtmp streams support'
            'atomicparsley: for embedding thumbnails into m4a files'
            'bun: for solving JavaScript challenges using an external runtime'
            'nodejs: for solving JavaScript challenges using an external runtime'
            'python-mutagen: for embedding thumbnail in certain formats'
            'python-pycryptodome: for decrypting AES-128 HLS streams and various other data'
            'python-pycryptodomex: for decrypting AES-128 HLS streams and various other data'
            'python-websockets: for downloading over websocket'
            'python-brotli: brotli content encoding support'
            'python-brotlicffi: brotli content encoding support'
            'python-xattr: for writing xattr metadata'
            'python-pyxattr: for writing xattr metadata (alternative option)'
            'phantomjs: for extractors with javascript code'
            'python-secretstorage: For -cookies-from-browser to access the GNOME keyring while decrypting cookies of Chromium-based browsers'
            'python-curl-cffi: for impersonating browsers'
            'quickjs-ng: for solving JavaScript challenges using an external runtime')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+https://github.com/yt-dlp/yt-dlp.git"
        "git+https://github.com/yt-dlp/ejs.git")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
    git -C "${pkgname%-git}" describe --long --tags --abbrev=7 --exclude=nightly | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    # Clean out old wheels etc.
    git -C "${srcdir}/${pkgname%-git}" clean -dfx
    git -C "${srcdir}/ejs" clean -dfx
}

build() {
    cd "${srcdir}/${pkgname%-git}"
    python -m build --wheel --no-isolation
    cd "${srcdir}/ejs"
    python -m build --wheel --no-isolation
}

package() {
    cd "${srcdir}/${pkgname%-git}"
    python -m installer --destdir="$pkgdir" dist/*.whl
    cd "${srcdir}/ejs"
    python -m installer --destdir="$pkgdir" dist/*.whl
}