def get_quality(self) -> Optional[Quality]:
        """Uses ffprode to grab the quality of the stream."""

        if self.__stream_quality is None:

            if shutil.which("ffprobe") is None:
                return None

            args = [
                "ffprobe", 
                "-v", 
                "error", 
                "-select_streams", 
                "v", 
                "-show_entries", 
                "stream=width,height", 
                "-of",
                "json",
                self.url
            ]

            out = str(subprocess.check_output(args), "utf-8")

            stream = json.loads(out).get("streams", [])

            if not stream == []:
                width = stream[0]["width"]
                height = stream[0]["height"]

                target_dimension_px = height

                if height > width:
                    target_dimension_px = width

                heights_lower_than_target_height = [
                    quality_height for quality_height in Quality._value2member_map_ if target_dimension_px >= quality_height
                ]

                closest_quality_height = min(heights_lower_than_target_height, key = lambda x: abs(x - target_dimension_px))

                self.__stream_quality = Quality(closest_quality_height)

        return self.__stream_quality
Uses ffprode to grab the quality of the stream.
mov_cli/media/media.py