Skip to content

Instantly share code, notes, and snippets.

@mp998
mp998 / PlexPy_email_notifiation.py
Last active July 6, 2018 05:51
This script will allow you to send a detailed email with PlexPy when new media is added to your PLEX server. Tested and works well with TV shows and movies. Not sure what will happen with music but its worth giving it a shot.
from email.mime.text import MIMEText
import email.utils
import smtplib
import sys
# Arguments passed from PlexPy
# {show_name} {episode_name} {season_num00} {episode_num00} {server_name} {media_type} {poster_url} {title} {summary} {library_name}
show_name = sys.argv[1]
# You can add more arguments if you want more details in the email body
episode_name = sys.argv[2]
@Hellowlol
Hellowlol / restart_plex.bat
Last active February 21, 2020 01:53
Restart plex plexpyscript
REM Add this script to Plex down and/or Plex remote down to restart plex if
REM server is unreachable.
TASKKILL /f /im "Plex Media Server.exe"
TASKKILL /f /im "PlexScriptHost.exe"
"C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe"
@Echostream
Echostream / SurfingKeys.js
Last active July 7, 2016 18:11
Enable gi to focus the first text box on the whole web page by SurfingKeys
mapkey('gi', 'test', function() {
var inputs = document.getElementsByTagName('input');
var input = null;
for(var i=0; i<inputs.length; i++) {
if(inputs[i].type=='text') {
input = inputs[i];
break;
}
}
if(input) {
@JonnyWong16
JonnyWong16 / notify_transcoding_telegram.sh
Last active June 30, 2016 18:18
Get notified on Telegram when a user is transcoding
#!/bin/sh
# Written by pmow
# Upload to Gist by JonnyWong16
# For this video transcode alert script, you should select the script for action types where it would be useful:
# Playback Start and Playback Resume, for example.
# Under Settings > Notifications > Scripts, set the parameters that should get passed to the script.
## Telegram notification basic script
### Based on Matriphe's at https://gist.github.com/matriphe/9a51169508f266d97313
@JonnyWong16
JonnyWong16 / notify_transcoding_telegram.py
Last active June 30, 2016 18:18
Get notified on Telegram when a user is transcoding
# Written by pmow/Hellowlol
# Upload to Gist by JonnyWong16
# For this video transcode alert script, you should select the script for action types where it would be useful:
# Playback Start and Playback Resume, for example.
# Under Settings > Notifications > Scripts, set the parameters that should get passed to the script.
import sys
import requests
@JonnyWong16
JonnyWong16 / delete_old_plexpy_history.py
Last active June 11, 2023 14:46
Delete Tautulli history older than "X" days
### WARNING: This script has not been tested! ###
# 1. Set api_sql = 1 in the config.ini file.
# 2. Install the requests module for python.
# pip install requests
# 3. Use some method to run the script on a schedule.
import requests
## EDIT THESE SETTINGS ##
@lingkz
lingkz / surfingkeys
Last active June 20, 2018 02:10
surfingkeys
// an example to create a new mapping `ctrl-y`
mapkey('<Ctrl-y>', 'Show me the money', function() {
Normal.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// an example to replace `u` with `?`, click `Default mappings` to see how `u` works.
map('?', 'u');
// an example to remove mapkey `Ctrl-i`
unmap('<Ctrl-i>');
@greinacker
greinacker / get_kc.py
Last active December 31, 2018 15:26
Workflow/Pythonista samples for saving/retrieving from keychain
# coding: utf-8
import sys
import keychain
import clipboard
import webbrowser
key = sys.argv[1]
value = keychain.get_password("workflow", key)
if value != None:
@JonnyWong16
JonnyWong16 / notify_on_show.py
Last active October 2, 2017 09:52
Send an Email notification when a specific show is added to Plex
from email.mime.text import MIMEText
import email.utils
import smtplib
import sys
# Arguments passed from PlexPy
# {show_name} {episode_name} {season_num} {episode_num}
show_name = sys.argv[1]
# You can add more arguments if you want more details in the email body
# episode_name = sys.argv[2]