As of sometime recently, the API is returning an older release on the “plexpass” channel than on the regular public channel.
Checking https://plex.tv/api/downloads/1.json?channel=plexpass with a valid X-Plex-Token header set returns version “1.11.3.4803-c40bba82e”, while either providing an invalid token or just going to https://plex.tv/api/downloads/1.json provides “1.12.0.4829-6de959918”.
And a constant source of frustration because if you pass an invalid X-Plex-Token it just silently falls back to public releases with no indication that the token was invalid.
I would like to see this resolved as it creates a problem for folks on the Linux-side of the house… We can’t get official updates through the media server itself. Therefore, we rely on great software like https://github.com/mrworf/plexupdate to provide an alternative route to ensure things get updated regularly. The the bug/issue described herein, software like plexupdate and other scripts out there are broken. And, your loyal paying Plexpass subscribers on Linux are left in the lurch.
I personally pull from the website directly without the api. circumvents this issue entirely. (This is for Ubuntu)
#!/bin/bash
# Check if ran by root
if [[ $UID -ne 0 ]]; then
echo 'Script must be run as root'
exit
fi
# Pull in variables with sensitive information
source variables.conf
# Variables
mylink='https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token='"$plextoken" upgradelink=$(curl -s "$mylink" | cut -d\" -f2)
curver=$(dpkg -l plexmediaserver | awk 'NR==6{print $3}' | cut -d- -f1)
curverdel=$(echo "$curver" | tr -d .)
newver=$(curl -s "$mylink" | cut -d- -f3 | cut -d/ -f2)
newverdel=$(echo "$newver" | tr -d .)
sessions=$(curl -s 'http://127.0.0.1:32400/status/sessions?X-Plex-Token='"$plextoken" | grep "MediaContainer size" | awk -F'[\"]' '{print $2}')
# Check for new version
if [ "$curverdel" -lt "$newverdel" ]; then
echo "PlexMediaServer is out of date."
echo "Current Version: $curver"
echo "New Version: $newver"
elif [ "$curverdel" -eq "$newverdel" ]; then
echo "Plex Media Server is Current."
echo "Current Version: $curver"
echo "Exiting script"
exit
fi
# Install if nothing running
if (( sessions < 1 )) || [[ $1 = '--force' ]]; then
if [[ $1 = '--force' ]]; then
echo "There are currently $sessions active sessions"
echo "forcing installation anyway"
fi
echo "Downloading New Version..."
wget -nv -P /plexupdates/ "$upgradelink" && echo "Download completed successfully"
echo "Installing New Version"
dpkg -i /plexupdates/*"$newver"*
else
echo "There are currently $sessions active sessions"
echo "Will not stop viewers"
echo "Exiting script"
exit
fi
@dirtycajunrice First, great username i must say. Second, would you be so kind as to help an ignorant fool like myself by pasting your variables.conf minus the sensitive data so i can give yours a whirl? I’d like to give this a go for sure.
@derekcentrico hey sorry (so used to writing scripts i just assume it can be assertained from the script) i have many variables for many scripts in that file but all you need for this one to work is:
Curious, are you experiencing errors with your script nowadays?
I get the following returns when it runs:
updater.sh: line 20: [: server: integer expression expected
updater.sh: line 24: [: server: integer expression expected
Additionally, it is odd how it runs dpkg. It seems like it is running the same version on top of itself.
updater.sh: line 20: [: server: integer expression expected
updater.sh: line 24: [: server: integer expression expected
Downloading New Version…
2019-02-10 08:31:58 URL:https://downloads.plex.tv/plex-media-server-new/1.15.0.659-9311f93fd/debian/plexmediaserver_1.15.0.659-9311f93fd_amd64.deb [81547030/81547030] → “/plexupdates/plexmediaserver_1.15.0.659-9311f93fd_amd64.deb” [1]
Download completed successfully
Installing New Version
(Reading database … 219656 files and directories currently installed.)
Preparing to unpack …/plexmediaserver_1.15.0.647-67e950f12_amd64.deb …
Removed /etc/systemd/system/multi-user.target.wants/plexmediaserver.service.
Unpacking plexmediaserver (1.15.0.647-67e950f12) over (1.15.0.647-67e950f12) …
Preparing to unpack …/plexmediaserver_1.15.0.659-9311f93fd_amd64.deb …
Unpacking plexmediaserver (1.15.0.659-9311f93fd) over (1.15.0.647-67e950f12) …
More than one copy of package plexmediaserver has been unpacked
in this run ! Only configuring it once.
Setting up plexmediaserver (1.15.0.659-9311f93fd) …
Created symlink /etc/systemd/system/multi-user.target.wants/plexmediaserver.service → /lib/systemd/system/plexmediaserver.service.
Processing triggers for libc-bin (2.27-3ubuntu1) …
Processing triggers for ureadahead (0.100.0-20) …
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) …
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) …
Processing triggers for mime-support (3.60ubuntu1) …
it looks like in the last release they changed the format of their download url in the last couple weeks. For example, to download the current 64bit plexpass the url is “https://downloads.plex.tv/plex-media-server/1.14.1.5488-cc260c476/plexmediaserver_1.14.1.5488-cc260c476_amd64.deb”
This could be the reason. Ive long since moved to docker for seamless upgrades, but if you have troubles modifying it feel free to message me. (Im also easier to get ahold of on Discord. DirtyCajunRice#0001)