Add option to update yt-dlp on restart (#992)

* Add option to update yt-dlp on restart

* Address pr feedback
This commit is contained in:
Craig Alexander 2025-06-30 23:09:18 -04:00 committed by GitHub
parent ab3b83ed3f
commit 08681f0e33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -71,6 +71,7 @@ All environment variables are explained in detail in the docs [here](https://doc
| ELASTIC_USER | Change the default ElasticSearch user | Optional |
| TA_LDAP | Configure TA to use LDAP Authentication | [Read more](https://docs.tubearchivist.com/configuration/ldap/) |
| DISABLE_STATIC_AUTH | Remove authentication from media files, (Google Cast...) | [Read more](https://docs.tubearchivist.com/installation/env-vars/#disable_static_auth) |
| TA_AUTO_UPDATE_YTDLP | Configure TA to automatically install the latest yt-dlp on container start | Optional |
| DJANGO_DEBUG | Return additional error messages, for debug only | Optional |
| TA_LOGIN_AUTH_MODE | Configure the order of login authentication backends (Default: single) | Optional |

View File

@ -9,6 +9,15 @@ else
LOGLEVEL="INFO"
fi
# update yt-dlp if needed
if [[ "${TA_AUTO_UPDATE_YTDLP,,}" =~ ^(release|nightly)$ ]]; then
echo "Updating yt-dlp..."
preflag=$([[ "${TA_AUTO_UPDATE_YTDLP,,}" == "nightly" ]] && echo "--pre" || echo "")
python -m pip install --target=/root/.local/bin --upgrade $preflag "yt-dlp[default]" || {
echo "yt-dlp update failed"
}
fi
# stop on pending manual migration
python manage.py ta_stop_on_error