How to print listing of all tv shows episodes resolution?

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.

https://github.com/sbradley7777/dot.config/blob/master/bin/bin.plex/plex-csvreader.py

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.

Plex2CVS which can be found here: https://forums.plex.tv/topic/103115-rel-plex2csv/.

The script is located on github: https://github.com/s...ex-csvreader.py.

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?

/T

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

If u change field names it should be easy fix, so no problem.i

I was just kidding  ;)

hehe, thanks for cool script because pretty much what i needed.

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)

This example lists all the TV Show that 1080p:

$ ./plex-csvreader.py -f ~/Desktop/Plex2csv/Documentaries.csv  -r 1080
INFO Analyzing the .csv file: /Users/sbradley/Desktop/Plex2csv/Documentaries.csv
Nova: 15 episodes
  Season   07  Episode 01  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 02  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 03  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 04  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 05  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 06  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 07  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 08  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 09  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 10  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 11  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 12  | Container: mp4 | Resolution: 1080 (800hx1422w)
  Season   07  Episode 13  | Container: mp4 | Resolution: 1080 (798hx1422w)

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.

Added movie support and color coding alternate lines to make easier reading and better display of result tables.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.