Skip to content

Instantly share code, notes, and snippets.

@blacktwin
blacktwin / create_wait_kill.py
Last active December 19, 2018 03:08
Receive transcode key from PlexPy when paused. Send key to sub-script to wait for X time then check if still paused. If paused kill.
'''
kill_transcode function from https://gist.github.com/Hellowlol/ee47b6534410b1880e19
PlexPy > Settings > Notification Agents > Scripts > Bell icon:
[X] Notify on pause
PlexPy > Settings > Notification Agents > Scripts > Gear icon:
Playback Pause: create_wait_kill.py
PlexPy > Settings > Notifications > Script > Script Arguments:
{transcode_key}
@blacktwin
blacktwin / kill_trans_pause_wait.py
Last active February 23, 2017 18:21
Receive transcode key from PlexPy when paused. Send key to sub-script to wait for X time then check if still paused. If paused kill.
'''
kill_transcode function from https://gist.github.com/Hellowlol/ee47b6534410b1880e19
PlexPy > Settings > Notification Agents > Scripts > Bell icon:
[X] Notify on pause
PlexPy > Settings > Notification Agents > Scripts > Gear icon:
Playback Pause: kill_trans_pause_wait.py
PlexPy > Settings > Notifications > Script > Script Arguments:
{transode_key}
@blacktwin
blacktwin / refresh_next_episode.py
Last active May 30, 2019 16:42
Refresh the next episode of show once current episode is watched.
'''
Refresh the next episode of show once current episode is watched.
Check PlexPy's Watched Percent in PlexPy > Settings > General
1. PlexPy > Settings > Notification Agents > Scripts > Bell icon:
[X] Notify on watched
2. PlexPy > Settings > Notification Agents > Scripts > Gear icon:
Enter the "Script folder" where you save the script.
Watched: refresh_next_episode.py
Save
@blacktwin
blacktwin / IFTTT_notify.py
Created February 14, 2017 18:54
Send IFTTT notification. Ignore any titles that are listed.
# 1. Install the requests module for python.
# pip install requests
# 2. Add script arguments in PlexPy.
# {server_name} {user} {title} {player} {platform}
import requests
import sys
server_name = sys.argv[1]
user = sys.argv[2]
@blacktwin
blacktwin / added_lastweek_FB.py
Created February 14, 2017 14:18
Notify FaceBook on what was added to Plex last week.
import requests
import sys
import time
TODAY = int(time.time())
LASTWEEK = int(TODAY - 7 * 24 * 60 * 60)
## EDIT THESE SETTINGS ##
PLEXPY_APIKEY = 'XXXXXX' # Your PlexPy API key
@blacktwin
blacktwin / userplays_weekly_reporting.py
Created February 9, 2017 18:48
Use PlexPy to count how many plays per user occurred this week and send email via PlexPy.
"""
Use PlexPy to count how many plays per user occurred this week.
Notify via PlexPy Notification
"""
import requests
import sys
import time
TODAY = int(time.time())
@blacktwin
blacktwin / notify_added_lastweek.py
Last active December 18, 2018 16:06
Send an email with what was added to Plex in the past week using PlexPy.
"""
Send an email with what was added to Plex in the past week using PlexPy.
Email includes title (TV: Show Name: Episode Name; Movie: Movie Title), time added, image, and summary.
"""
import requests
import sys
import time
import os
from email.mime.text import MIMEText
@blacktwin
blacktwin / plexapi_delete_playlists.py
Created February 3, 2017 20:02
Delete all playlists from Plex using PlexAPI
"""
Delete all playlists from Plex using PlexAPI
https://github.com/mjs7231/python-plexapi
"""
from plexapi.server import PlexServer
import requests
baseurl = 'http://localhost:32400'
@blacktwin
blacktwin / added_to_plex.py
Last active February 16, 2017 12:50
Find when media was added between STARTFRAME and ENDFRAME to Plex through PlexPy.
"""
Find when media was added between STARTFRAME and ENDFRAME to Plex through PlexPy.
Some Exceptions have been commented out to supress what is printed.
Uncomment Exceptions if you run into problem and need to investigate.
"""
import requests
import sys
import time
@blacktwin
blacktwin / plexpy_sql_month.py
Last active January 31, 2017 19:35
Find when media was added between STARTFRAME and ENDFRAME to Plex through PlexPy.
"""
Find when media was added between STARTFRAME and ENDFRAME to Plex through PlexPy.
This will only show for what has been wached.
api_sql must be manually enabled in the config file.
"""
import requests