Sanitize values from Odysee a little bit
They offer some basic sanitization, but we need to apparently strip whitespace, because that's not something they do
This commit is contained in:
parent
c925aea731
commit
f9786ddb64
@ -49,11 +49,13 @@ def odysee_get_releases(handle):
|
||||
if not item["value"].get("source", {}).get("hash"):
|
||||
continue
|
||||
releases[item["claim_id"]] = {
|
||||
"name": item.get("name", "Unnamed Release"),
|
||||
"title": item["value"].get("title", "Untitled Release"),
|
||||
# Fields with .strip() at the end are user-controlled and may mess with sorting if
|
||||
# leading/trailing whitespace is left in.
|
||||
"name": item.get("name", "Unnamed Release").strip(),
|
||||
"title": item["value"].get("title", "Untitled Release").strip(),
|
||||
# This field is an int in unixtime
|
||||
"publishdate": int(item["value"].get("release_time", 0)),
|
||||
"description": item["value"].get("description", "No description provided for this release"),
|
||||
"description": item["value"].get("description", "No description provided for this release").strip(),
|
||||
"thumbnail": item["value"].get("thumbnail", {}).get("url", ""),
|
||||
"url": f"{odysee_get_channel_url(handle)}/{item['name']}",
|
||||
"filehash": item["value"].get("source", {}).get("hash", "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user