Video Om Om Gendut Gay Indonesia Info
| Add‑on | What you get | Quick tip |
|--------|--------------|-----------|
| Multi‑platform support | Add Vimeo (vimeo.com/api) or Dailymotion (api.dailymotion.com) look‑ups. | Create a thin wrapper that normalises each platform’s response to the same metadata dict. |
| Language translation | Auto‑translate the title/summary to Indonesian, English, etc. | Use openai.ChatCompletion with a “translate to X” prompt, or Google Translate API. |
| Safety‑filter for comments | Pull the top‑level comments and run them through the OpenAI “moderation” endpoint. | openai.Moderation.create(input=comment_text). |
| Web UI | Simple HTML page with a single input box, showing thumbnail, link, and summary. | Flask + Jinja2 or a static page that calls a tiny FastAPI backend. |
| What it does | How it works | What it returns |
|--------------|--------------|-----------------|
| Identify the video the user is referring to (by title, keywords, or a URL). | • Query public‑API endpoints (YouTube Data API v3, Vimeo API, Dailymotion API) with the user’s keywords.
• If the user supplies a URL, extract the video‑ID and call the appropriate API. | • Basic metadata: title, channel/author, upload date, duration, language, description, view count, thumbnail URL. |
| Check the content rating and age‑restriction flags. | • Inspect the contentDetails and status fields returned by the API (e.g., contentRating, embeddable, license).
• If the API reports “age‑restricted”, “private”, “unavailable in this region”, or any NSFW flag, the feature stops and returns a polite warning. | • “This video is age‑restricted / not available in your region / private. I can’t show you the link, but I can give you a summary if you have a transcript.” |
| Generate a short, safe‑to‑share summary (optional). | • If the video is public and not age‑restricted, request the closed‑caption track (if available) via the API.
• Run the captions through a summarisation model (e.g., OpenAI’s gpt‑4o‑mini with a “summarise‑captions” prompt). | • 2‑4 sentence plain‑English (or user‑chosen language) summary, plus a list of key topics. |
| Provide safe navigation instructions. | • Return the public URL (or embed URL) only if the video passed the safety check.
• Include a short “how‑to‑watch safely” tip (e.g., “Open the link in incognito mode if you’re on a shared device”). | • Clickable link, thumbnail preview, and the safety tip. | Video Om Om Gendut Gay Indonesia
Below is a ready‑to‑run snippet (requires google-api-python-client and openai libraries).
It follows the policy: it never downloads or streams the video, and it refuses if the content is age‑restricted or otherwise disallowed. | Add‑on | What you get | Quick
import os
import re
import json
from googleapiclient.discovery import build
import openai
# -------------------------------------------------
# CONFIGURATION (replace with your own keys)
# -------------------------------------------------
YOUTUBE_API_KEY = os.getenv("YT_API_KEY") # get from Google Cloud Console
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") # get from OpenAI dashboard
openai.api_key = OPENAI_API_KEY
# -------------------------------------------------
# HELPERS
# -------------------------------------------------
def extract_youtube_id(url_or_id: str) -> str:
"""Accepts a full YouTube URL, short URL, or raw video ID and returns the ID."""
patterns = [
r"(?:v=|\/)([0-9A-Za-z_-]11)", # typical ?v=ID or /ID
r"([0-9A-Za-z_-]11)$" # raw ID at end of string
]
for pat in patterns:
m = re.search(pat, url_or_id)
if m:
return m.group(1)
raise ValueError("Could not extract a YouTube video ID.")
def safe_youtube_lookup(query_or_url: str):
"""Main entry point – returns a dict with safe metadata or a warning."""
# 1️⃣ Decide whether we have a raw ID/URL or plain keywords
try:
video_id = extract_youtube_id(query_or_url)
request = youtube.videos().list(
part="snippet,contentDetails,status,statistics",
id=video_id
)
except ValueError:
# Not an ID – treat as a search query
request = youtube.search().list(
part="snippet",
q=query_or_url,
type="video",
maxResults=1
)
response = request.execute()
items = response.get("items", [])
if not items:
return "error": "No matching public video found."
# If we used the search endpoint, we need a second call to get full details
if "id" not in items[0]:
video_id = items[0]["id"]["videoId"]
details = youtube.videos().list(
part="snippet,contentDetails,status,statistics",
id=video_id
).execute()["items"][0]
else:
details = items[0]
# 2️⃣ Safety checks
status = details["status"]
if status.get("privacyStatus") != "public":
return "warning": "The video is not publicly accessible."
if status.get("embeddable") is False:
return "warning": "The video cannot be embedded or shared directly."
if status.get("contentRating", {}).get("ytRating") == "ytAgeRestricted":
return "warning": "The video is age‑restricted and cannot be displayed here."
# Add more checks as needed (regionRestriction, etc.)
# 3️⃣ Build safe metadata
snippet = details["snippet"]
meta =
"title": snippet["title"],
"channel": snippet["channelTitle"],
"published": snippet["publishedAt"],
"duration": details["contentDetails"]["duration"], # ISO‑8601, e.g. PT5M20S
"views": details["statistics"].get("viewCount", "0"),
"thumbnail": snippet["thumbnails"]["high"]["url"],
"url": f"https://www.youtube.com/watch?v=video_id",
"language": snippet.get("defaultAudioLanguage", "unknown")
# 4️⃣ Optional: fetch captions & summarise
# (YouTube only lets you download captions if they are public.)
caption_tracks = details["contentDetails"].get("caption", "none")
if caption_tracks == "true":
# For brevity, we call the YouTube Captions API (requires separate OAuth scope).
# Here we just note that a caption is available.
meta["captions_available"] = True
else:
meta["captions_available"] = False
return "metadata": meta
def summarise_captions(captions_text: str, language: str = "en"):
"""Runs a short LLM summarisation on the raw captions."""
prompt = f"""Summarise the following video transcript in 2‑3 sentences, keeping it neutral and safe for all audiences. The transcript language is language. Return the summary in plain text.
---TRANSCRIPT---
captions_text
---END---
"""
response = openai.ChatCompletion.create(
model="gpt-4o-mini",
messages=["role": "user", "content": prompt],
temperature=0.3,
max_tokens=200,
)
return response.choices[0].message.content.strip()
# -------------------------------------------------
# INITIALISE the YouTube client once
# -------------------------------------------------
youtube = build("youtube", "v3", developerKey=YOUTUBE_API_KEY)
# -------------------------------------------------
# EXAMPLE USAGE
# -------------------------------------------------
if __name__ == "__main__":
user_input = input("Enter video title / keywords / URL → ").strip()
result = safe_youtube_lookup(user_input)
if "error" in result:
print("❌", result["error"])
elif "warning" in result:
print("⚠️", result["warning"])
else:
meta = result["metadata"]
print("\n✅ Video found:")
print(f"Title : meta['title']")
print(f"Channel : meta['channel']")
print(f"Date : meta['published'][:10]")
print(f"Views : int(meta['views']):,")
print(f"Link : meta['url']")
print(f"Thumb : meta['thumbnail']")
print("\n🔐 This video passed all safety checks.\n")
# Optional caption summary (requires you have already downloaded the caption file)
# captions = "... load .srt or .vtt ..."
# summary = summarise_captions(captions, meta['language'])
# print("📄 Summary:", summary)
| Aspect | Why It Works | |--------|--------------| | Character Design | Om Om is instantly likable—confident, charismatic, and unapologetically himself. His exaggerated style serves the comedy but also signals self‑acceptance. | | Relatability | Scenes of everyday errands (e.g., buying groceries, using public transport) make the story accessible, reinforcing that queer people share the same daily routines as anyone else. | | Positive Messaging | By celebrating body diversity and queer identity simultaneously, the video delivers an uplifting message without feeling preachy. | | Cultural Resonance | Local idioms, street scenery, and familiar social interactions root the sketch firmly in Indonesian life, boosting its shareability and relevance. | | What it does | How it works