From 950ac3e687c99cf8c29654f7fec8f8af5d7d803b Mon Sep 17 00:00:00 2001 From: Jim Scarborough Date: Mon, 14 Mar 2022 21:18:41 -0400 Subject: [PATCH] Update ffprobe.py In apparently rare cases, the lines don't contain =, such as section headers. When that happens, you'll get an error about not enough fields to unpack to fill the map on the next line. --- ffprobe/ffprobe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffprobe/ffprobe.py b/ffprobe/ffprobe.py index f1eb3dc..bee9cdf 100644 --- a/ffprobe/ffprobe.py +++ b/ffprobe/ffprobe.py @@ -117,7 +117,7 @@ class FFStream: """ def __init__(self, data_lines): - for line in data_lines: + for line in filter(lambda l: "=" in l, data_lines): self.__dict__.update({key: value for key, value, *_ in [line.strip().split('=')]}) try: