1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00

Merge pull request #3862 from deldesir/deldesir-patch-5

Check if older version of 'library' (xklb) is installed
This commit is contained in:
A Holt 2024-12-16 21:40:34 -05:00 committed by GitHub
commit 9db5dbe3a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 10 deletions

View file

@ -99,17 +99,22 @@
if [ -f {{ calibreweb_venv_path }}/scripts/lb-wrapper ]; then
apt install ffmpeg pipx -y
if lb --version; then
pipx reinstall library
if pipx list | grep -q 'xklb'; then
pipx uninstall xklb
pipx install library
else
pipx reinstall library
fi
else
pipx install library
ln -sf /root/.local/bin/lb /usr/local/bin/lb
if [ -f /root/.local/share/pipx/venvs/library/bin/yt-dlp ]; then
ln -sf /root/.local/share/pipx/venvs/library/bin/yt-dlp /usr/local/bin/yt-dlp
elif [ -f /root/.local/pipx/venvs/library/bin/yt-dlp ]; then
ln -sf /root/.local/pipx/venvs/library/bin/yt-dlp /usr/local/bin/yt-dlp
else
echo "ERROR: yt-dlp NOT FOUND"
fi
fi
ln -sf /root/.local/bin/lb /usr/local/bin/lb
if [ -f /root/.local/share/pipx/venvs/library/bin/yt-dlp ]; then
ln -sf /root/.local/share/pipx/venvs/library/bin/yt-dlp /usr/local/bin/yt-dlp
elif [ -f /root/.local/pipx/venvs/library/bin/yt-dlp ]; then
ln -sf /root/.local/pipx/venvs/library/bin/yt-dlp /usr/local/bin/yt-dlp
else
echo "ERROR: yt-dlp NOT FOUND"
fi
# NEED BETTER/EXPERIMENTAL YouTube SCRAPING? UNCOMMENT THE NEXT LINE -- for the latest yt-dlp "nightly" release:
# pipx inject --pip-args="--upgrade --pre" -f library yt-dlp[default]

View file

@ -58,8 +58,13 @@
if grep -q 'calibreweb_installed: True' /etc/iiab/iiab_state.yml; then
if [[ $1 == "-f" || $1 == "--fast" ]]; then
echo -e "\e[4mChecking if an older version of 'library' (formerly 'xklb') exists...\e[0m"
if pipx list | grep -q 'xklb'; then
echo -e "\e[4mOlder version 'xklb' detected. Now running: pipx uninstall xklb\e[0m"
pipx uninstall xklb
fi
echo -e "\e[4mNow running: pipx uninstall library # THIS ALSO UNINSTALLS yt-dlp\e[0m\n"
pipx uninstall library
pipx uninstall library || true
echo -e "\n\e[4mNow running: pipx install library # THIS ALSO INSTALLS yt-dlp\e[0m\n"
pipx install library
echo -e "\n\e[4mNow running: yt-dlp --version\e[0m\n"