This repository has been archived on 2026-11-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

7 lines
307 B
Python

def media_url(v, kind="thumb"):
key = {"video": "optimized_path", "source": "download_path",
"poster": "poster_path", "thumb": "thumb_path",
"preview": "preview_path"}.get(kind, "thumb_path")
if not v or not v.get(key):
return None
return f"/media/{v['id']}/{kind}"