filter meta data
This commit is contained in:
parent
01baf66bca
commit
4504dc7c6d
12
stream.py
12
stream.py
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user