这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@AminurAlam
Copy link
Contributor

@AminurAlam AminurAlam commented Nov 12, 2025

ejs is a newly introduced dependency for yt-dlp
#26714

this currently skips 32bit systems because they dont have deno support but npm should also work fine for building ejs

@AminurAlam
Copy link
Contributor Author

AminurAlam commented Nov 12, 2025

checked the uploaded artifact and the files seem to be in the wrong place
/data/data/com.termux/files/usr/home/builder/.termux-build/python3.12-crossenv-prefix-bionic-aarch64/cross/lib/python3.12/...
instead of
/data/data/com.termux/files/usr/lib/python3.12/...

@robertkirkman
Copy link
Member

Oh, yeah sorry, I forgot about that, termux_step_make_install() should be like this, instead of how it currently is:

termux_step_make_install() {
	local _whl="yt_dlp_ejs-$TERMUX_PKG_VERSION-py3-none-any.whl"
	pip install --no-deps --prefix="$TERMUX_PREFIX" "$TERMUX_PKG_SRCDIR/dist/$_whl"
}

that will fix that.

@robertkirkman
Copy link
Member

I think, as well, that this package can be TERMUX_PKG_PLATFORM_INDEPENDENT=true. There is only pure python and javascript in it and, after the changes, it doesn't need to be excluded from any architectures.

@AminurAlam
Copy link
Contributor Author

the path looks correct now :)

@AminurAlam
Copy link
Contributor Author

squashed commits

Copy link
Member

@TomJo2000 TomJo2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be added as a TERMUX_PKG_DEPENDS (hard dependency)
or TERMUX_PKG_RECOMMENDS (soft dependency, installed with the package by default)
to python-yt-dlp.

If I understand this correctly only the yt-dlp-ejs part of yt-dlp depends on a JS runtime (e.g. deno | node | node-lts)?
If that is the case it should be sufficient to make this package depend on one of those.

@AminurAlam
Copy link
Contributor Author

AminurAlam commented Nov 12, 2025

This should probably be added as a TERMUX_PKG_DEPENDS (hard dependency)
or TERMUX_PKG_RECOMMENDS (soft dependency, installed with the package by default)
to python-yt-dlp

yt-dlp does work without ejs but the number of formats you can download is limited, and if you want to download non youtube videos ejs is not necessary
this pkg should be TERMUX_PKG_RECOMMENDS for yt-dlp

If I understand this correctly only the yt-dlp-ejs part of yt-dlp depends on a JS runtime (e.g. deno | node | node-lts)?

yes, archlinux also did it this way https://gitlab.archlinux.org/archlinux/packaging/packages/yt-dlp/-/commit/944dbe853ef51e04224a1b54c2ef9eb0cd015cf0

@TomJo2000
Copy link
Member

It's not much of a yt-dlp if YT downloads don't work now is it?

@AminurAlam
Copy link
Contributor Author

test-buildorder-random doesnt seem to fallback to nodejs, should we just use nodejs on every architecture?

@AminurAlam
Copy link
Contributor Author

It's not much of a yt-dlp if YT downloads don't work now is it?

ohers said it should be optional here but i'm happy to add it as hard dependency as i originally planned

@TomJo2000
Copy link
Member

TomJo2000 commented Nov 12, 2025

Well deno or node should be a depends for ejs.
But ejs should be a recommends for yt-dlp.

Does that make sense?

@AminurAlam
Copy link
Contributor Author

Well deno or node should be a depends for ejs. But ejs should be a recommends for yt-dlp.

Does that make sense?

yup 👍

@AminurAlam
Copy link
Contributor Author

Well deno or node should be a depends for ejs.
But ejs should be a recommends for yt-dlp.

now there are no dependencies for ejs

and for yt-dlp (#26714) we can:

  1. add deno/node as recommended (since conditionally adding reccomended doesnt seem to work addpkg(main/yt-dlp-ejs): 0.3.1 #27211 (comment))
  2. or, add node as a dependency

@TomJo2000
Copy link
Member

I still think the dependency chain should be:
yt-dlp ~> yt-dlp-ejs -> deno | nodejs | nodejs-lts
~> for soft dependency, -> for hard dependency

@robertkirkman
Copy link
Member

I still think the dependency chain should be: yt-dlp ~> yt-dlp-ejs -> deno | nodejs | nodejs-lts ~> for soft dependency, -> for hard dependency

Either way can probably work, but there is some conflicting information and confusion about this between AUR <-> Arch Linux <-> upstream yt-dlp documentation, so I suggest waiting a while to see what happens in Arch Linux and other distros and inspecting the situation then to compare multiple distros with each other.

@TomJo2000
Copy link
Member

Can I get like 6-10 hours of sleep before we do anything on this PR?
I don't think this needs to be solved in a sleep deprived state.

@Vinfall

This comment was marked as resolved.

@robertkirkman
Copy link
Member

robertkirkman commented Nov 13, 2025

This is a kind reminder that yt-dlp-ejs only enables deno support by default, see yt-dlp/yt-dlp#15012 (comment), which means:

* If you choose `nodejs`/`nodejs-lts` as a dep, then users have to add `--js-runtimes node` to download from YouTube. I'd suggest you ship a default config to enable node support (or show a message somehow to remind this change, something like `apt-listchanges`, I don't know if this is possible on Termux though)

* If you choose `deno` as a dep, then 64bit users don't need to add extra arguments (32bit users have to use nodejs anyway...)

We currently think that this block TERMUX_PKG_RECOMMENDS="deno | nodejs | nodejs-lts" on either python-yt-dlp or yt-dlp-ejs (currently visible in the PR for python-yt-dlp) will automatically handle that by automatically installing deno when pkg install python-yt-dlp is used on a 64-bit device and instead nodejs when pkg install python-yt-dlp is used on a 32-bit device. --js-runtimes node is also visible there.

image

Does that look right to you? Other than that, yt-dlp-ejs has not yet been added as a dependency to the PR for python-yt-dlp.

@Vinfall
Copy link

Vinfall commented Nov 13, 2025

I see. I checked the wrong PR🤦‍♂️ and your linked changes look good. Sorry for the mistake.

@robertkirkman
Copy link
Member

robertkirkman commented Nov 13, 2025

It is, when I take a look, likely that we will need to patch this absolute path inside yt-dlp to change /etc to our /data/data/com.termux/files/usr/etc (which we write as @TERMUX_PREFIX@/etc and $TERMUX_PREFIX/etc depending on the context), otherwise yt-dlp might not be able to find the configuration file in the location we would put it in, but that's ok we are very used to doing that in all other software.

https://github.com/yt-dlp/yt-dlp/blob/5977782142ca7e41240f07202cc9b8dcc087b401/yt_dlp/utils/_utils.py#L4730

@TomJo2000
Copy link
Member

Okay... I now have the mental bandwidth for looking at this.

To recap:

  • We're adding yt-dlp-ejs
    • Which is an optional dependency of python-yt-dlp
  • yt-dlp-ejs depends on either: deno, nodejs or nodejs-lts.
  • The buildorder check throws a fit if it sees deno in the 32 bit arches since Deno doesn't have 32 bit builds.

I've just reconfirmed the dependency chain in Arch.
And it is:
yt-dlp ~> yt-dlp-ejs -> deno

@robertkirkman
Copy link
Member

The buildorder check throws a fit if it sees deno in the 32 bit arches since Deno doesn't have 32 bit builds.

We tested using this way of depending in python-yt-dlp and it seemed to work ok, this can be transferred to this package yt-dlp-ejs instead if you prefer it here.

TERMUX_PKG_RECOMMENDS="deno | nodejs | nodejs-lts"

@TomJo2000
Copy link
Member

TomJo2000 commented Nov 13, 2025

Excerpt from pacman -Qii yt-dlp yt-dlp-ejs on my PC.

# yt-dlp
Depends On      : python  python-certifi  python-requests  python-urllib3
Optional Deps   : ffmpeg: for video post-processing [installed]
                  rtmpdump: for rtmp streams support
                  atomicparsley: for embedding thumbnails into m4a files
                  aria2: for using aria2 as external downloader
                  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 [installed]
                  yt-dlp-ejs: non-deprecated YouTube support [installed]
# [...]
# yt-dlp-ejs
Depends On      : deno  python
Optional Deps   : None
Required By     : None
Optional For    : yt-dlp

@robertkirkman
Copy link
Member

Yes, Arch Linux is a 64-bit-only operating system.

@TomJo2000
Copy link
Member

TomJo2000 commented Nov 13, 2025

If we translate that to Termux that should be possible to express as:

# yt-dlp build script
TERMUX_PKG_RECOMMENDS='ffmpeg, yt-dlp-ejs'
# yt-dlp-ejs build script
TERMUX_PKG_DEPENDS='nodejs | nodejs-lts, python'
if (( TERMUX_ARCH_BITS == 64 )); then
	TERMUX_PKG_DEPENDS='deno | nodejs | nodejs-lts, python'
fi

# Install config file
if [[ "$TERMUX_ARCH_BITS" == "32" ]]; then
	mkdir -p "$TERMUX_PREFIX/etc/yt-dlp"
	cat <<- EOF > "$TERMUX_PREFIX/etc/yt-dlp/yt-dlp.conf"
	--js-runtimes node
	EOF
fi

Copy link
Member

@TomJo2000 TomJo2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to satisfy the buildorder check, so this should be good for merge after squashing.

Co-authored-by: Robert Kirkman <rkirkman@termux.dev>
@TomJo2000 TomJo2000 merged commit 8875df8 into termux:master Nov 16, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants