I have been reviewing python and php code but still dont understand how to get the resolution of episode object's. Can anyone post some sample python or php code that will list the resolution of each episode of each show. I know that the video object contains the resolution that plex detects but not sure how to access it.
The goal is to create a report that shows resolution for each episodes in each TV Show so that i know which ones are 480p, 720p, 1080p. If I could get some same code showing a simple listing that would be great and i would share the code in forums(or github) for everyone to use if i could get sample code to point in right direction.
Example what i am looking for (note - means missing):
Arrested Development (3 Seasons)
Season 1 (20 episodes)
01. 720p
02. -
03 . 720p
04. 480p
.....
20. 720p
There are some complicated ways to do this and some simpler ones. If that is the data that you want I recommend the simpler setup. In the unsupported app store for channels for plex there is an app called plex2csv...you can output all your stuff in csv format and one of the fields is resolution. Hope that helps!
Yeah, it sure did export it. Now just to write a query or something to make the data a bit more eye friendly.
UPDATE:
Thanks this works great, i have a few little tweaks to add and some options but will update comment when complete. The script is located at the following location in git. Please note there may be bugs and what not while i continue to update. I will post new comment when done.
Updated the script and does what I needed it to do. The purpose of this script is print the resolution of each video file in a section from a .csv file generated with Plex2CVS.
Sample of the output that is generated from reading a .csv file generated by the plugin Plex2CSV. Please give the full path to the file.
$ ~/github/dot.config/bin/bin.plex/plex-csvreader.py /tmp/Documentaries-Extreme-20140728-121721.csv
INFO The parsing of the csv will start.
INFO There was 5630 records in the csv file.
A list of all the videos that are NOT High Defination(HD):
series title season episode video resolution
------------------------------------------- ------ ------- ----------------
Ancient Rome The Rise and Fall of an Empire 1 1 480
Ancient Rome The Rise and Fall of an Empire 1 2 480
Ancient Rome The Rise and Fall of an Empire 1 3 480
Ancient Rome The Rise and Fall of an Empire 1 4 480
Ancient Rome The Rise and Fall of an Empire 1 5 480
.....
What We Still Don't Know 1 3 sd
A list of all the videos that are High Defination(HD):
series title season episode video resolution
BBC Documentaries 2011 188 720
BBC Documentaries 2013 226 720
BBC Documentaries 2014 5 720
The Beauty of Diagrams 1 1 720
I take it I'm doomed if I change the field names now in Plex2CSV :lol:
Nice script, but for the death of it, I simply don't understand why you just opened the export from Plex2CSV, and then deleted the unwanted collumns in like Excel etc?
I dont do Excel, i can code python in minutes(lot of code i ripped from my other programs so just a copy/paste), and reusable by me or whoever. If u change field names it should be easy fix, so no problem.i
Refactor my code and made easier and simpler to use. Now the code will parse the data created by Plex2cvs. The python script is located on github for plex-csvreader.py.
Here is example of the command parsing the extreme or higher data created by Plex2cvs.
Note this currently only works for TV Shows and add Movies later. This code was written so that I can have a better idea of video files that I have.
This example lists all the TV Shows that are in .avi container.
$ ./plex-csvreader.py -f ~/Desktop/Plex2csv/Documentaries.csv -c avi
INFO Analyzing the .csv file: /Users/sbradley/Desktop/Plex2csv/Documentaries.csv
Ancient Rome The Rise and Fall of an Empire: 6 episodes
Season 01 Episode 01 | Container: avi | Resolution: 480 (368hx672w)
Season 01 Episode 02 | Container: avi | Resolution: 480 (384hx688w)
Season 01 Episode 03 | Container: avi | Resolution: 480 (384hx688w)
Season 01 Episode 04 | Container: avi | Resolution: 480 (384hx688w)
Season 01 Episode 05 | Container: avi | Resolution: 480 (384hx688w)
Season 01 Episode 06 | Container: avi | Resolution: 480 (368hx672w)
Chemistry: A Volatile History: 3 episodes
Season 01 Episode 01 | Container: avi | Resolution: 480 (400hx720w)
Season 01 Episode 02 | Container: avi | Resolution: 480 (400hx720w)
Season 01 Episode 03 | Container: avi | Resolution: 480 (400hx720w)
Egypt: 6 episodes
Season 01 Episode 01 | Container: avi | Resolution: 480 (384hx688w)
Season 01 Episode 02 | Container: avi | Resolution: 480 (384hx688w)
Season 01 Episode 03 | Container: avi | Resolution: 480 (384hx688w)
Season 01 Episode 04 | Container: avi | Resolution: 480 (384hx688w)
Season 01 Episode 05 | Container: avi | Resolution: 480 (384hx688w)
Season 01 Episode 06 | Container: avi | Resolution: 480 (384hx688w)
Light Fantastic: 4 episodes
Season 01 Episode 01 | Container: avi | Resolution: 480 (400hx704w)
Season 01 Episode 02 | Container: avi | Resolution: 480 (400hx704w)
Season 01 Episode 03 | Container: avi | Resolution: 480 (400hx704w)
Season 01 Episode 04 | Container: avi | Resolution: 480 (400hx704w)
Note the -c and -r option cannot be used at the same time and each option takes multiple values. See the help (-h) for more information and examples. Please note the the TV Show total is for the total number of episodes in Series and not total returned for -c or -r option.