So you've got a Plex server stuffed with more cinematic gold and TV trash, than a Blockbuster from 2003 (RIP, sweet prince), and you want to know what the hell you actually have? Well buckle up, buttercup! This isn't just another boring README written by some code monkey who thinks "fun" is a variable name.
This is a comprehensive collection of Python scripts that'll export your Plex content into Excel reports so detailed, they'd make the IRS weep tears of joy. We're talking movie catalogs, TV show completeness tracking, and enough color-coding to make a rainbow jealous.
Meet your new best frenemy: a trio of Python-powered bad boys that rip your Plex library a new spreadsheet.
- Plex Media Export: The Swiss Army Chainsaw of Excel reports. Movies AND TV shows. Together. Harmony.
- Movie Exporter: Just movies. Just the facts. Just justice.
- TV Show Audit Tool: Completion stats, TVMaze brainpower, and a color-coded guilt trip for your binge-watching sins.
- Complete inventory because you probably forgot you own Green Lantern (we don't talk about Green Lantern)
- Resolution-based highlighting that'll shame you for your 480p collection
- Technical details for the nerds (you know who you are)
- Content metadata so you can remember why you bought Cats (spoiler: there's no good reason)
- Customizable fields via .env because I'm not your mom – configure it yourself
- Alphabetical sorting because chaos is only fun in combat
- It's like IMDB got Excel-itis.
- Finds missing episodes you didn't know you were avoiding.
- Series completion tracking with TVMaze integration (because manual counting is for psychopaths)
- Season-by-season breakdown that's more detailed than my therapy sessions
- Color-coded status indicators:
- 🟩 Green: Complete (like my collection of regrets)
- 🟥 Red: Incomplete (like my understanding of healthy relationships)
- ⬛ Gray: This never existed (Like my social life)
- Multi-threaded processing (faster than my mouth in a fight)
- Environment variables from .env files (because hardcoding is what killed the dinosaurs)
- Memory-optimized Excel generation (won't crash your potato computer)
- Cached TVMaze lookups (because API rate limits are the real enemy)
- Progress reporting more detailed than my therapy notes
- Handles errors like an emotionally mature adult. (Not me.)
- Sortable Excel tables (organization is my middle name... actually it's Winston, but whatever)
- Python 3.6+
- Plex server (not imaginary)
- Plex token (like a golden key but nerdier)
- Internet (for TVMaze, not for my OnlyFans)
git clone https://github.com/PrimePoobah/plex-media-export.git
cd plex-media-export
pip install plexapi pandas openpyxl requests python-dotenv
cp .env.example .env
nano .env # Or edit in Notepad if you're stuck in 2005
Configure your settings (this is where the magic happens):
PLEX_URL="http://{Your_Plex_IP}:32400"
PLEX_TOKEN="{YourSuperSecretPlexToken}"
PLEX_EXPORT_DIR="{WhereYouWantYourFiles}"
PLEX_MOVIE_EXPORT_FIELDS="Title,Year,Studio,ContentRating,Video Resolution,File Path,Container,Duration (min)"
PLEX_SHOW_EXPORT_FIELDS="Title,Year,Studio,ContentRating"
- Log into Plex web interface (you know, that thing you use to procrastinate)
- Play any media file (I suggest Deadpool)
- Click the three dots (⋮) because apparently we're all ancient Greeks now
- Select "Get Info" (getting philosophical, are we?)
- Click "View XML" (now we're speaking in tongues)
- Find "X-Plex-Token" in the URL (congratulations, you're now a hacker)
This script does everything. It's like the Swiss Army knife of Plex tools, if Swiss Army knives could judge your media collection.
python PlexMediaExport.py
Output: PlexMediaExport_YYYYMMDD_HHMMSS.xlsx
Because timestamps are like signatures – they prove you were here
Contains both:
- Movies tab
- TV Shows tab (with Maze magic)
For when you only care about movies. It's focused, dedicated, and probably has commitment issues.
python plex_movie_export.py
Output: plex_movies.xlsx
Simple name for simple people
This one tracks TV show completion like a particularly obsessive stalker.
python plex_tv_shows.py
Output: plex_tv_shows_YYYYMMDD.xlsx
With a timestamp because even TV shows deserve to know when they were cataloged
Column | Description |
---|---|
Title | Movie name |
Resolution | 4K? Fancy. SD? Eww. |
Year | Release year |
Studio | Studio magic |
File | Full path to shame |
Container | MKV? MP4? VHS? |
Duration | Minutes of regret |
Etc. | You decide via .env |
Column | Description |
---|---|
Title | Show name |
Complete | Yes, no, or… yikes |
Season X | Episodes present/total |
- 🟩 4K/UHD = 4K content (oh shiny!)
- 🟨 720p or lower (we don't judge... much)
- ⬜ 1080p (the standard bearer of mediocrity)
- 🟩 Season done. Victory lap.
- 🟥 You slacked off.
- ⬛ Didn’t even exist. Move on.
Edit .env
like a wizard.
Title, Year, Studio, Rating, Bitrate, Codec, Genres, Labels...
Title, Seasons, Ratings, ViewCount, Summary, Tagline...
plexapi>=4.15.4
pandas>=1.3.0
openpyxl>=3.0.9
requests>=2.26.0
python-dotenv>=0.19.0
Want to help make this thing better? Great! Here's how to not screw it up:
- Fork it (like a code buffet)
- Branch it (
git checkout -b feature/MyAwesomeFeature
) - Commit it (
git commit -m 'Add something that doesn't break everything'
) - Push it (
git push origin feature/MyAwesomeFeature
) - Pull Request it (and pray I'm in a good mood)
Bonus points for witty commit messages.
This thing is licensed under the GNU AGPL v3.0
It’s free to use, but don’t be a villain. LICENSE
- python-plexapi For making Plex integration not suck
- TVMaze API For knowing more about TV than my mother
- OpenPyXL For making Excel files that don't crash
- Pandas For data processing that's smarter than me
- Plex For existing so we can hoard media legally-ish
- nledenyi For contributing and not running away screaming
- python-dotenv For managing environment variables better than I manage my life
- And you... yeah you, for actually reading this far
Want to high-five the mastermind?
PrimePoobah — GitHub
Project Link: plex-media-export
A: Yes, unlike me, these scripts don't need a pretty face to function.
A: Nope, it's read-only. Less invasive than a wellness check.
A: Depends how often you add stuff. Weekly if you're obsessive, monthly if you have a life.
A: Sure, dive into the code and make it fabulous. Rainbow everything if you want.
A: Because Plex and TVMaze sometimes disagree more than a married couple on vacation.
A: Same folder as the script, unless you specify otherwise. It's not hide-and-seek.
If this helped you organize your digital hoarding:
-
⭐️ Star this repo (make me feel special)
-
Share it with other media addicts
-
Contribute improvements (or just fix my terrible jokes)
Now go! Export that media like the spreadsheet superhero you were born to be.
P.S. - If you're reading this far, you either really need this tool or you have way too much time on your hands. Either way, welcome to the club.
P.P.S. - No, I won't help you organize your actual physical media. That's what fire is for.
[END OF TRANSMISSION]
This README was written while consuming an ungodly amount of chimichangas and watching my own movies on repeat. Any resemblance to actual documentation is purely coincidental.