mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-20 13:23:21 -07:00
Switch to new API endpoint for public downloads. Fixes #254
This commit is contained in:
parent
7723dfc97b
commit
54da6bca99
2 changed files with 4 additions and 21 deletions
|
@ -11,7 +11,7 @@
|
|||
# Current pages we need - Do not change unless Plex.tv changes again
|
||||
URL_LOGIN='https://plex.tv/users/sign_in.json'
|
||||
URL_DOWNLOAD='https://plex.tv/api/downloads/5.json?channel=plexpass'
|
||||
URL_DOWNLOAD_PUBLIC='https://plex.tv/api/downloads/1.json'
|
||||
URL_DOWNLOAD_PUBLIC='https://plex.tv/api/downloads/5.json'
|
||||
|
||||
# Default options for package managers, override if needed
|
||||
REDHAT_INSTALL="dnf -y install"
|
||||
|
|
|
@ -53,6 +53,7 @@ AUTODELETE=no
|
|||
AUTOUPDATE=no
|
||||
AUTOSTART=no
|
||||
ARCH=$(uname -m)
|
||||
BUILD="linux-$ARCH"
|
||||
SHOWPROGRESS=no
|
||||
WGETOPTIONS="" # extra options for wget. Used for progress bar.
|
||||
CHECKUPDATE=yes
|
||||
|
@ -296,15 +297,10 @@ if [ ! -d "${DOWNLOADDIR}" ]; then
|
|||
fi
|
||||
|
||||
if [ -z "${DISTRO_INSTALL}" ]; then
|
||||
if [ -z "${DISTRO}" -a -z "${BUILD}" ]; then
|
||||
if [ -z "${DISTRO}" ]; then
|
||||
# Detect if we're running on redhat instead of ubuntu
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
REDHAT=yes
|
||||
if [ "${PUBLIC}" = "yes" ]; then
|
||||
BUILD="linux-ubuntu-${ARCH}"
|
||||
else
|
||||
BUILD="linux-${ARCH}"
|
||||
fi
|
||||
DISTRO="redhat"
|
||||
if ! hash dnf 2>/dev/null; then
|
||||
DISTRO_INSTALL="${REDHAT_INSTALL/dnf/yum}"
|
||||
|
@ -313,18 +309,9 @@ if [ -z "${DISTRO_INSTALL}" ]; then
|
|||
fi
|
||||
else
|
||||
REDHAT=no
|
||||
if [ "${PUBLIC}" = yes ]; then
|
||||
BUILD="linux-ubuntu-${ARCH}"
|
||||
DISTRO="ubuntu"
|
||||
else
|
||||
BUILD="linux-${ARCH}"
|
||||
DISTRO="debian"
|
||||
fi
|
||||
DISTRO="debian"
|
||||
DISTRO_INSTALL="${DEBIAN_INSTALL}"
|
||||
fi
|
||||
elif [ -z "${DISTRO}" -o -z "${BUILD}" ]; then
|
||||
error "You must define both DISTRO and BUILD"
|
||||
exit 255
|
||||
fi
|
||||
else
|
||||
if [ -z "${DISTRO}" -o -z "${BUILD}" ]; then
|
||||
|
@ -351,10 +338,6 @@ fi
|
|||
if [ "${PUBLIC}" = "no" ] && ! getPlexToken; then
|
||||
error "Unable to get Plex token, falling back to public release"
|
||||
PUBLIC="yes"
|
||||
BUILD="linux-ubuntu-${ARCH}"
|
||||
if [ "${REDHAT}" = "yes" ]; then
|
||||
DISTRO="ubuntu"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$PUBLIC" != "no" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue