GitHub - odrevet/yt-dlp-kivy: User interface and port to several OS (including android) of yt-dlp using the kivy framework

GitHub

2 min read Original article ↗

User interface for yt-dlp using the Kivy framework

Usage

  • Paste or enter video URL to download in the text field
  • Click on the 'Download' button

Prerequisites

  • Kivy (run)
  • Buildozer (build for android)
pip install -r requirements.txt

Download from YouTube

The 'ignore errors' option should be on.

Build using official buildozer Dockerfile

Build the image

git clone https://github.com/kivy/buildozer.git
cd buildozer
docker build --tag=kivy/buildozer .

Run

docker run \
  --volume "$HOME/.buildozer":/home/user/.buildozer \
  --volume "$PWD":/home/user/hostcwd \
  --volume "$HOME/.gradle":/home/user/.gradle \
  --entrypoint /bin/bash \
  kivy/buildozer \
  -c "bash utils.sh --build"

Utils

Must be run using bash

In case of errors, exported shell variables at the beginning of the script may be adjusted.

  • To build the apk: --build. Android SDK will be downloaded at first run.
  • To sign the apk: --sign. Keystore (--key or -k) and pass (--pass or -p) may be passed after this argument, defaults to included test keystore and pass
bash utils.sh --sign --key mykeystore.keystore --pass 123456
  • To install the apk: --install

Example:

bash utils.sh --build --sign --install

Troubleshooting

  • When building, if requested API cannot be found then the buildozer directory must be cleared
  • logcat
adb logcat --pid=$(adb shell pidof fr.odrevet.youtube_dl_kivy) | grep -E "(ERROR|python|File|line)"
  • Access filesystem
buildozer android debug
adb install bin/youtube_dl_kivy-0.5.0-arm64-v8a-debug.apk
adb shell
run-as fr.odrevet.youtube_dl_kivy
cd /data/data/fr.odrevet.youtube_dl_kivy/files/app

CI testing with act

Create env file with dummy keystore

cat > .env.act << EOF
GITHUB_TOKEN=dummy_token_for_testing
KEYSTORE_BASE64=$(base64 -w 0 mykeystore.keystore)
KEYSTORE_PASSPHRASE=123456
EOF

Run

  • Check syntax
act workflow_dispatch --dry-run
  • With verbose output
act workflow_dispatch --env-file .env.act --verbose

Sources