This script allows you to automatically generate blog posts from your Plex movie ratings and reviews. It connects to your Plex server, fetches movies you’ve rated, and creates Jekyll-formatted markdown files ready to be published on your blog.
pip install plexapi pyyaml python-slugify
chmod +x plex-reviews-to-posts.py
./plex-reviews-to-posts.py --url "http://your-plex-server:32400" --token "your-plex-token"
./plex-reviews-to-posts.py --account --username "your-username" --password "your-password" --server "Your Server Name"
--output-dir
: Directory where blog posts will be created (default: _posts
)--tag
: Default tag to apply to all posts (default: movies
)--min-rating
: Only include movies with this rating or higher (0-10)--days
: Only fetch reviews from the last N days--limit
: Limit number of reviews to process--dry-run
: Don’t write files, just print what would be createdGenerate posts for all movies rated 7 or higher:
./plex-reviews-to-posts.py --url "http://your-plex-server:32400" --token "your-plex-token" --min-rating 7
Get the 5 most recent reviews:
./plex-reviews-to-posts.py --url "http://your-plex-server:32400" --token "your-plex-token" --limit 5
Only include reviews from the last 30 days:
./plex-reviews-to-posts.py --url "http://your-plex-server:32400" --token "your-plex-token" --days 30
You need your Plex token to authenticate with your server. Here are a few ways to find it:
From your Plex configuration files (location varies by OS)
from plexapi.myplex import MyPlexAccount
account = MyPlexAccount('your-username', 'your-password')
print(f"Your Plex token is: {account.authenticationToken}")
create_post_content
function to change the layout of generated postsMake sure to create a tag file for movies reviews:
mkdir -p tag
echo "---
layout: tag
tag: movies
title: \"Movie Reviews\"
permalink: /tag/movies/
---" > tag/movies.md
This script is provided as-is under the MIT License. Feel free to modify and use it as needed.