Skip to content

Instantly share code, notes, and snippets.

@jeremysherriff
Created June 6, 2019 01:31
Show Gist options
  • Save jeremysherriff/bc3102e593cd597033d7d9d71254b6e5 to your computer and use it in GitHub Desktop.
Save jeremysherriff/bc3102e593cd597033d7d9d71254b6e5 to your computer and use it in GitHub Desktop.
# References:
# https://support.plex.tv/articles/201638786-plex-media-server-url-commands/
# https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
# Sections
# 1 = Movies
# 2 = TV
# 4 = Home Movies
# Linux:
curl -k https://192.168.220.10:32400/library/sections/1/refresh?X-Plex-Token=xxxxxxxxxxxxxx
# Windows:
# If your plex system is running SSL, then ignore self-signed certs:
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
$result = invoke-webrequest -uri "https://192.168.220.10:32400/library/sections/1/refresh?X-Plex-Token=xxxxxxxxxxxxxx"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment