mrworf / plexupdate

Plex Update script to simplify the life of Linux Plex Media Server users.
GNU General Public License v2.0
1.77k stars 146 forks source link

Your OS reports the latest version of Plex (Plex Pass) #264

Closed Kazz3r24 closed 5 years ago

Kazz3r24 commented 5 years ago

I read the previous posts about this, the most recent (Feb 12) states to create a new issue if it's persisting. I am attempting to run the script using the Plex Pass option. Below is the output, I'm currently on the previous beta release after installing it manually. I did check - Version 1.16.5.1488 is currently available.

After taking a quick look at the download URL, it looks it should be https://www.plex.tv/media-server-downloads/ rather than https://downloads.plex.tv/plex-media-server-new

I could be wrong.

./plexupdate.sh -v Fetching token from Plex server Retrieving list of available distributions RELEASE="label":"Ubuntu (16.04+) / Debian (8+) - Intel/AMD 64-bit","build":"linux-x86_64","distro":"debian","url":"https://downloads.plex.tv/plex-media-server-new/1.16.4.1469-6d5612c2f/debian/plexmediaserver_1.16.4.1469-6d5612c2f_amd64.deb","checksum":"0fa37565e74560debeaad2659a8c308e8825abe2" DOWNLOAD=https://downloads.plex.tv/plex-media-server-new/1.16.4.1469-6d5612c2f/debian/plexmediaserver_1.16.4.1469-6d5612c2f_amd64.deb CHECKSUM=0fa37565e74560debeaad2659a8c308e8825abe2 INSTALLED_VERSION=1.16.4.1469-6d5612c2f FILE_VERSION=1.16.4.1469-6d5612c2f Your OS reports the latest version of Plex (1.16.4.1469-6d5612c2f) is already installed. Use -f to force download.

Kazz3r24 commented 5 years ago

I'm seeing now in plexupdate-core that I'm likely wrong about the URL.

demonbane commented 5 years ago

I just tested this locally, and the response you're getting is for the public release, even though plexupdate is pulling your token from your local Plex server. When I check it, I do get 1.16.5 as the most recent version.

The first step would just be to make sure that Plex would actually allow you to download this release. Try going to the Plex Media Server download page and making sure that you're able to see and successfully download the PlexPass release from there in your browser.

If that works, then it's probably an issue with the token on your server (since that's the credential that plexupdate is using to check for and download updates). First, double-check your account by going to your "Account" page on your local server. Make sure that your server thinks that you have an active PlexPass subscription.

If that looks good, then you can try to invalidate your server token and get a new one.

If you'd like to test exactly what data plexupdate is getting back and you have jq installed (apt install jq on Ubuntu), you can run this one-liner from inside your plexupdate directory to see exactly what plexupdate sees in terms of return data:

curl -sH "X-Plex-Token: $(bash -c 'source plexupdate-core' get-plex-token | cut -f3 -d' ')" 'https://plex.tv/api/downloads/5.json?channel=plexpass' | jq '.computer.Linux.releases[] | select (.distro == "debian" and .build == "linux-x86_64")'

With PlexPass, this is the result I get:

{
  "label": "Ubuntu (16.04+) / Debian (8+) - Intel/AMD 64-bit",
  "build": "linux-x86_64",
  "distro": "debian",
  "url": "https://downloads.plex.tv/plex-media-server-new/1.16.5.1488-deeb86e7f/debian/plexmediaserver_1.16.5.1488-deeb86e7f_amd64.deb",
  "checksum": "e46c4db05ef9402447246e92e3f5ed808eb11389"
}

while without PlexPass I get the same result you seem to be getting:

{
  "label": "Ubuntu (16.04+) / Debian (8+) - Intel/AMD 64-bit",
  "build": "linux-x86_64",
  "distro": "debian",
  "url": "https://downloads.plex.tv/plex-media-server-new/1.16.4.1469-6d5612c2f/debian/plexmediaserver_1.16.4.1469-6d5612c2f_amd64.deb",
  "checksum": "0fa37565e74560debeaad2659a8c308e8825abe2"
}
Kazz3r24 commented 5 years ago

Thank you for responding in such detail.

This is what I get for output:

{ "label": "Ubuntu (16.04+) / Debian (8+) - Intel/AMD 64-bit", "build": "linux-x86_64", "distro": "debian", "url": "https://downloads.plex.tv/plex-media-server-new/1.16.4.1469-6d5612c2f/debian/plexmediaserver_1.16.4.1469-6d5612c2f_amd64.deb", "checksum": "0fa37565e74560debeaad2659a8c308e8825abe2" }

My PlexPass is active and version 1488 is available for download through the website, Tautulli notified me that it was available - only reason I checked. I think the issue is with the token as you mentioned. I changed my password for my Plex account recently and I've been looking for a way to re-authenticate with the script, but even after uninstalling and reinstalling everything for plexupdate, it won't ask me for my PlexPass information. Is there a way to force the script to request my credentials?

demonbane commented 5 years ago

Plexupdate gets your token directly from the local Plex server. If your Plex server is able to talk to Plex, then plexupdate can as well. If you look in that one-liner I posted earlier, there's a section in there that pulls your token directly from your server. If you want to make sure that that part is working on its own, you can just run the following from inside your plexupdate directory.

bash -c 'source plexupdate-core' get-plex-token | cut -f3 -d' '

The output should be a 20-character string made up of letters and numbers, which is the actual token your Plex server is using to communicate. If you change your password and try it again, you should get a different one the next time meaning that your Plex server is correctly getting new tokens when necessary.

Kazz3r24 commented 5 years ago

Hi again, thank you for all of the valuable information. I reset my Plex password again and re-authenticated everywhere. I seem be getting the correct version now when I run plexupdate.

Thank you again for the suggestion.