From f364a1a245d7f582f62d437f43bd0cef183f75bf Mon Sep 17 00:00:00 2001 From: Peter Wood Date: Thu, 6 Mar 2025 19:40:17 +0000 Subject: [PATCH] scraping the plex database --- plex-recent-additions.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 plex-recent-additions.sh diff --git a/plex-recent-additions.sh b/plex-recent-additions.sh new file mode 100755 index 0000000..137b284 --- /dev/null +++ b/plex-recent-additions.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Define the path to the Plex database +PLEX_DB="/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" + +# Check if the database exists +if [ ! -f "$PLEX_DB" ]; then + echo "Plex database not found at $PLEX_DB" + exit 1 +fi + +# Query the database for items added in the last 7 days +sqlite3 "$PLEX_DB" <= strftime('%s', 'now', '-7 days') +ORDER BY added_at DESC; +EOF