From 4504dc7c6d6a4483d0f6d98e1a126180352150de Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 19 May 2021 09:39:30 +0200 Subject: [PATCH] filter meta data --- stream.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stream.py b/stream.py index 3c203da..952f118 100755 --- a/stream.py +++ b/stream.py @@ -206,12 +206,12 @@ class UpstreamHandler(): data_new["og:video:width"] = data_raw.get("width") data_new["og:image:height"] = data_raw.get("thumbnail_height") data_new["og:image:width"] = data_raw.get("thumbnail_width") - for elem in data_new.values(): - if not isinstance(elem, str): - data_valid = False - break - if data_valid: - data = list(data_new.items()) + data_filtered = {} + for key in data_new: + value = data_new.get(key) + if isinstance(value, str): + data_filtered[key] = value + data = list(data_filtered.items()) except Exception as e: logger.info(e) logger.info(data)