Skip to content

Instantly share code, notes, and snippets.

@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 / 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_imdb_director.py
Last active March 6, 2017 23:44
Send a PlexPy notification with the movie directors' IMDB page
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Send a PlexPy notification with the directors' IMDB page.
# Author: /u/SwiftPanda16
# Requires: requests, imdbpie
# PlexPy script trigger: Playback stop
# PlexPy script arguments: "{title}" {imdb_id}
@JonnyWong16
JonnyWong16 / create_plex_library.py
Last active June 8, 2017 14:04
Create a Plex movies library using the API
import platform
import requests
from uuid import getnode
'''
Available options to create a movie library:
agent: com.plexapp.agents.imdb # Freebase
com.plexapp.agents.themoviedb # The Movie Database
com.plexapp.agents.none # Personal Media
@JonnyWong16
JonnyWong16 / save_artist_jpg.py
Created July 16, 2017 00:33
Saves artist.jpg to the Artist folder.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Saves artist.jpg to the Artist folder.
# Author: /u/SwiftPanda16
# Requires: plexapi, requests
from plexapi.server import PlexServer
import os
import requests
@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]
@JonnyWong16
JonnyWong16 / notify_stream_threshold.py
Created March 5, 2017 20:37
Send a PlexPy notification when the total number of streams exceeds a threshold.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Send a PlexPy notification when the total
# number of streams exceeds a threshold.
# Author: /u/SwiftPanda16
# Requires: requests
# PlexPy script trigger: Playback start
# PlexPy script arguments: {streams}
@JonnyWong16
JonnyWong16 / kill_stream.py
Created January 15, 2018 22:44
Kill a Plex stream
import requests
import sys
PLEXPY_URL = 'http://localhost:8181'
APIKEY = 'xxxxxxxxxx'
MESSAGE = 'Your stream was terminated for "reasons"'
session_id = sys.argv[1]
payload = {'apikey': APIKEY,
@JonnyWong16
JonnyWong16 / notify_random_chuck_norris.py
Last active July 17, 2018 06:37
Send a random Chuck Norris joke when a movie starring Chuck Norris is played.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Send a random Chuck Norris joke when a movie
# starring Chuck Norris is played.
# Author: /u/SwiftPanda16
# Requires: requests, lxml
# PlexPy script trigger: Playback start
# PlexPy script arguments: "{actors}"
@JonnyWong16
JonnyWong16 / update_history_grouping.py
Last active October 17, 2018 19:44
Updates history grouping in the Tautulli database with the new logic on v2.1.12.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Updates history grouping in the Tautulli database with the new logic on v2.1.12.
# Author: /u/SwiftPanda16
# Requires: requests
import requests
### EDIT SETTINGS ###