Skip to content

Instantly share code, notes, and snippets.

@cjerrington
Created December 26, 2022 16:20
Show Gist options
  • Save cjerrington/b39a7ecfbeff8049eff08e1a0fdaf7be to your computer and use it in GitHub Desktop.
Save cjerrington/b39a7ecfbeff8049eff08e1a0fdaf7be to your computer and use it in GitHub Desktop.
Jellyfin update check
# Setup of variables:
# Update server and port to your local values
$server = "localhost"
$port = 8096
$myinstall = (Invoke-WebRequest -UseBasicParsing http://$($server):$port/System/Info/Public).Content | ConvertFrom-Json
$latest = (Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/jellyfin/jellyfin/releases/latest) | ConvertFrom-Json
if ( $myinstall.Version -eq $latest.name){
Write-Host "$($myinstall.Version) is the latest version."
}else{
Write-Host "You are running $myinstall and $($latest.name) is the latest."
Write-Host "You can download it from $($latest.html_url)"
Write-Host "$($latest.body)"
}
from urllib.request import urlopen
import json
# Setup of variables:
# Update server and port to your local values
server = "localhost"
port = 8096
githubAPI = "https://api.github.com/repos/jellyfin/jellyfin/releases/latest"
localresp = urlopen(f"http://{server}:{port}/System/Info/Public")
myVersion = json.loads(localresp.read())
remoteresp = urlopen("https://api.github.com/repos/jellyfin/jellyfin/releases/latest")
remoteversion = json.loads(remoteresp.read())
if myVersion['Version'] == remoteversion['name']:
print(f"{myVersion['Version']} is the latest version")
else:
print(f"You are running {myVersion['Version']} and {remoteversion['name']} is the latest.")
print(f"You can download it from {remoteversion['html_url']}")
print(f"{remoteversion['body']}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment