Spaces:
Runtime error
Runtime error
| # PATH: bot/youtube/metadata.py | |
| def normalize_privacy(p: str) -> str: | |
| p = (p or "private").lower().strip() | |
| if p not in ("private", "unlisted", "public"): | |
| return "private" | |
| return p | |
| def build_metadata(title: str, description: str, privacy: str = "private") -> dict: | |
| privacy = normalize_privacy(privacy) | |
| return { | |
| "snippet": { | |
| "title": title[:95], | |
| "description": description[:4900], | |
| "categoryId": "22", # People & Blogs default | |
| }, | |
| "status": { | |
| "privacyStatus": privacy | |
| } | |
| } |