Skip to content

Instantly share code, notes, and snippets.

@JonnyWong16
JonnyWong16 / openPlexSearch.user.js
Last active Jul 16, 2022
Open the Plex search page when pressing enter in the search box.
View openPlexSearch.user.js
// ==UserScript==
// @name Open Plex Serach Page on Enter
// @namespace https://app.plex.tv
// @version 1.1
// @description Open the Plex search page when pressing enter in the search box.
// @author JonnyWong16
// @homepage https://gist.github.com/JonnyWong16/1ebd38a5f5872408e5b840ed28006dec
// @downloadURL https://gist.github.com/JonnyWong16/1ebd38a5f5872408e5b840ed28006dec/raw/10e6888a0d989f47ffa8d76ab662bc933494e053/openPlexSearch.user.js
// @updateURL https://gist.github.com/JonnyWong16/1ebd38a5f5872408e5b840ed28006dec/raw/10e6888a0d989f47ffa8d76ab662bc933494e053/openPlexSearch.user.js
// @match https://app.plex.tv/*
@JonnyWong16
JonnyWong16 / mark_watched.py
Last active May 29, 2022
Automatically mark a video (movie, show, season, or episode) as played in Plex for a specific users.
View mark_watched.py
#!/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 Aug 23, 2021
Test Plex API performance
View plexAPIPerformanceTest.py
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 Jul 5, 2021
Generate Plex accounts
View mass_plex_accounts.py
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 May 21, 2022
Rename Masterclass seasons in Plex with summary.
View rename_seasons_masterclass.py
#!/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 Jun 17, 2021
Create a new Plex.tv token for your app.
View get_plex_token.py
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 Feb 4, 2022
Open the Plex metadata XML info for any media page with Ctrl+I
View openPlexMetadataXML.user.js
// ==UserScript==
// @name Open Plex Metadata XML
// @namespace https://app.plex.tv
// @version 1.0
// @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/e96f8523f342d705d0ff2414e4eee18a7dc3c99c/openPlexMetadataXML.user.js
// @updateURL https://gist.github.com/JonnyWong16/ec660094e4cd7233f1dd96b4b4d62e21/raw/e96f8523f342d705d0ff2414e4eee18a7dc3c99c/openPlexMetadataXML.user.js
// @match https://app.plex.tv/*
@JonnyWong16
JonnyWong16 / README.md
Created Jul 12, 2020 — forked from MarMed/README.md
Routing plex traffic through an SSH tunnel
View README.md

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
Check Plex remote access using CanYouSeeMe.org and send a notification
View canyouseemeorg_check.py
#!/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 May 15, 2019
Automatically add a movie to a collection based on release date.
View recently_added_collection.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Automatically add a movie to a collection based on release date.
# Author: /u/SwiftPanda16
# Requires: plexapi
# Tautulli script trigger:
# * Notify on recently added
# Tautulli script conditions:
# * Filter which media to add to collection.