filter meta data

This commit is contained in:
Roy Olav Purser 2021-05-19 09:39:30 +02:00
parent 01baf66bca
commit 4504dc7c6d
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -206,12 +206,12 @@ class UpstreamHandler():
data_new["og:video:width"] = data_raw.get("width") data_new["og:video:width"] = data_raw.get("width")
data_new["og:image:height"] = data_raw.get("thumbnail_height") data_new["og:image:height"] = data_raw.get("thumbnail_height")
data_new["og:image:width"] = data_raw.get("thumbnail_width") data_new["og:image:width"] = data_raw.get("thumbnail_width")
for elem in data_new.values(): data_filtered = {}
if not isinstance(elem, str): for key in data_new:
data_valid = False value = data_new.get(key)
break if isinstance(value, str):
if data_valid: data_filtered[key] = value
data = list(data_new.items()) data = list(data_filtered.items())
except Exception as e: except Exception as e:
logger.info(e) logger.info(e)
logger.info(data) logger.info(data)