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: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)