Skip to content

Instantly share code, notes, and snippets.

@JonnyWong16
JonnyWong16 / mark_watched.py
Last active November 27, 2023 17:12
Automatically mark a video (movie, show, season, or episode) as played in Plex for a specific users.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Automatically mark a video (movie, show, season, or episode)
# as played in Plex for specific users.
# Author: /u/SwiftPanda16
# Requires: plexapi
#
# Tautulli script trigger:
# * Notify on watched
@JonnyWong16
JonnyWong16 / plexAPIPerformanceTest.py
Last active July 28, 2024 11:33
Test Plex API performance
from plexapi.server import PlexServer
import time
SERVER_URL = 'http://localhost:32400'
SERVER_TOKEN = 'xxxxxxxxxxxxxxxxxxxx'
LIBRARY_NAME = 'Movies'
plex = PlexServer(SERVER_URL, token=SERVER_TOKEN)
movies = plex.library.section(LIBRARY_NAME)
totalItems = movies.totalSize
@JonnyWong16
JonnyWong16 / mass_plex_accounts.py
Last active July 5, 2021 00:46
Generate Plex accounts
import random
import requests
import string
import sys
import time
import uuid
try:
NUMBER_OF_ACCOUNTS = int(sys.argv[1])
except (IndexError, ValueError):
@JonnyWong16
JonnyWong16 / rename_seasons_masterclass.py
Last active October 12, 2023 21:37
Rename Masterclass seasons in Plex with summary.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Rename season title for TV shows on Plex.
# Author: /u/SwiftPanda16
# Requires: plexapi
from plexapi.server import PlexServer
@JonnyWong16
JonnyWong16 / get_plex_token.py
Created June 17, 2021 16:51
Create a new Plex.tv token for your app.
import uuid
from plexapi.utils import getMyPlexAccount, createMyPlexDevice
account = getMyPlexAccount()
product = input("App name: ")
headers = {
'X-Plex-Platform': '',
'X-Plex-Platform-Version': '',
'X-Plex-Provides': '',
'X-Plex-Version': '',
@JonnyWong16
JonnyWong16 / openPlexMetadataXML.user.js
Last active January 31, 2024 19:33
Open the Plex metadata XML info for any media page with Ctrl+I
// ==UserScript==
// @name Open Plex Metadata XML
// @namespace https://app.plex.tv
// @version 1.3
// @description Open the Plex metadata XML info for any media page with Ctrl+I.
// @author JonnyWong16
// @homepage https://gist.github.com/JonnyWong16/ec660094e4cd7233f1dd96b4b4d62e21
// @downloadURL https://gist.github.com/JonnyWong16/ec660094e4cd7233f1dd96b4b4d62e21/raw/openPlexMetadataXML.user.js
// @updateURL https://gist.github.com/JonnyWong16/ec660094e4cd7233f1dd96b4b4d62e21/raw/openPlexMetadataXML.user.js
// @match https://app.plex.tv/*
@JonnyWong16
JonnyWong16 / README.md
Created July 12, 2020 15:33 — forked from MarMed/README.md
Routing plex traffic through an SSH tunnel

Routing plex traffic through an SSH tunnel

This guide creates a reverse SSH tunnel to route all Plex server traffic through it.

Step 2 is done on the tunnel, all other steps are done on the plex server.

1. Setup SSH keys (if you already have key based authenthication setup skip to step 2)

On plex server:

@JonnyWong16
JonnyWong16 / canyouseemeorg_check.py
Last active May 15, 2020 18:55
Check Plex remote access using CanYouSeeMe.org and send a notification
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Check Plex remote access using CanYouSeeMe.org and send a notification
# Author: /u/SwiftPanda16
# Tautulli script trigger:
# * Plex Remote Access Down
# Tautulli script conditions:
# * None
# Tautulli script arguments:
@JonnyWong16
JonnyWong16 / recently_added_collection.py
Last active December 4, 2024 23:49
Automatically add a movie to a collection based on release date.
Updated script link:
https://github.com/blacktwin/JBOPS/blob/master/utility/recently_added_collection.py
@JonnyWong16
JonnyWong16 / hide_episode_spoilers.py
Last active February 14, 2025 14:47
Automatically change episode artwork in Plex to hide spoilers.
Updated script link:
https://github.com/blacktwin/JBOPS/blob/master/utility/hide_episode_spoilers.py