Skip to content

Instantly share code, notes, and snippets.

@JonnyWong16
JonnyWong16 / plex_imdb_top_250_library.py
Last active January 23, 2024 03:22
Automatically create an IMDB Top 250 library in Plex using an existing movie library
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
#
# Automated IMDB Top 250 Plex library script by /u/SwiftPanda16
#
# *** Use at your own risk! ***
# *** I am not responsible for damages to your Plex server or libraries. ***
#
#------------------------------------------------------------------------------
@JonnyWong16
JonnyWong16 / plex_imdb_top_250_collection.py
Last active March 6, 2024 14:13
Automatically create an IMDB Top 250 collection in Plex using an existing movie library
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
#
# Automated IMDB Top 250 Plex collection script by /u/SwiftPanda16
#
# *** Use at your own risk! ***
# *** I am not responsible for damages to your Plex server or libraries. ***
#
#------------------------------------------------------------------------------
@JonnyWong16
JonnyWong16 / exec_command_no_sessions.py
Created March 5, 2017 20:02
Execute a command when no Plex sessions are active.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Execute a command when no Plex sessions are active.
# Author: /u/SwiftPanda16
# Requires: plexapi
import shlex
import subprocess
from plexapi.server import PlexServer
@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 / 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 / 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 / collection_from_rating_keys.py
Created March 5, 2017 23:09
Create a Plex collection from a text file list of rating keys.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Create a Plex collection from a text file list of rating keys.
# Author: /u/SwiftPanda16
# Requires: plexapi, requests
import requests
from plexapi.server import PlexServer
@JonnyWong16
JonnyWong16 / sync_playlists_to_users.py
Last active April 20, 2024 12:14
Sync Plex playlists to shared users.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Description: Sync Plex playlists to shared users.
# Author: /u/SwiftPanda16
# Requires: plexapi
from plexapi.exceptions import NotFound
from plexapi.server import PlexServer
@JonnyWong16
JonnyWong16 / add_label_recently_added.py
Last active May 3, 2024 07:09
Automatically add a label to recently added items in your Plex library
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Automatically add a label to recently added items in your Plex library
# Author: /u/SwiftPanda16
# Requires: requests
# Tautulli script trigger:
# * Notify on recently added
# Tautulli script conditions:
# * Filter which media to add labels to using conditions. Examples:
@JonnyWong16
JonnyWong16 / remove_movie_collections.py
Last active October 20, 2023 22:34
Removes ALL collections from ALL movies.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Removes ALL collections from ALL movies.
# Author: /u/SwiftPanda16
# Requires: plexapi
from plexapi.server import PlexServer
### EDIT SETTINGS ###