Skip to content

Fix termux - #2752

Open
TzurSoffer wants to merge 11 commits into
devfrom
Fix-Termux
Open

TzurSoffer wants to merge 11 commits into
devfrom
Fix-Termux

Conversation

@TzurSoffer

@TzurSoffer TzurSoffer commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes termux by using python 313 since 314 is not supported for curl cffi

The TUR python3.13 package may not provide a pip3.13 executable on a
clean install; bootstrapping pip via ensurepip makes the install step
reliable.
With an unquoted delimiter, $1, $SONGS, and $SPOTDL were expanded
(to empty strings) while generating the file, producing a script with
a bash syntax error. Quoting EOL writes them literally so they expand
when termux-url-opener actually runs.
rust and binutils were already installed before this change; the
comment implied they were newly added for building spotdl deps.
Real Termux devices auto-detect the API level via getprop, but in the
termux-docker image (used for testing under WSL) getprop is a broken
stub and pydantic-core's maturin build aborts without this variable.
Harmless on devices: it exports the same value getprop reports, with
24 (Termux's minimum supported API) as the fallback.
@Silverarmor

Copy link
Copy Markdown
Member

Thanks - committing a few changes, took me a while to set it up as a docker container on WSL/ubuntu for testing.
Note that x86_64 will fail since there are no wheels for it...

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the Termux installation script to avoid Python 3.14 incompatibilities by explicitly installing and using Python 3.13, improving reliability of spotdl installs on Termux.

Changes:

  • Adds tur-repo and installs python3.13, then uses python3.13 -m pip for installing spotdl.
  • Exports ANDROID_API_LEVEL to help native dependency builds in environments where auto-detection may not work.
  • Switches the termux-url-opener heredoc to a quoted delimiter to prevent unintended variable expansion at generation time.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/termux.sh Outdated
Comment on lines +23 to +27
@@ -18,7 +24,7 @@ if [ ! -f "$HOME/bin/termux-url-opener" ]; then
touch $HOME/bin/termux-url-opener
fi

cat > $HOME/bin/termux-url-opener <<EOL
cat > $HOME/bin/termux-url-opener <<'EOL'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok done

Quote path variables, replace the mkdir guard with mkdir -p, and exit
if cd fails so downloads can't silently land in $HOME. Also drop the
redundant touch block: the cat redirection creates the file.
@Silverarmor

Silverarmor commented Jul 22, 2026 •

Copy link
Copy Markdown
Member

Awaiting user to test on an android device - I am android-less but have tested in WSL ubuntu termux docker environment.

Ready to merge if user OK's/green lights

@TzurSoffer

Copy link
Copy Markdown
Contributor Author

pkg must be upgraded, or ffmpeg doesn't work (I'm pretty sure due to conflicts in tur-repo). Please check if this works for you @Silverarmor

@TzurSoffer

Copy link
Copy Markdown
Contributor Author

Note this doesn't have deno.

@Silverarmor

Copy link
Copy Markdown
Member

I no longer have an android device to test 👀

@TzurSoffer

Copy link
Copy Markdown
Contributor Author

Yes but I thought you had an emulator. I just made a small change and want to verify it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Couldn't get spotDL to work on Termux (OSError: dlopen failed: library "libpthread.so.0")

3 participants