import time import os import requests import subprocess import tempfile import gradio as gr import openai import whisper # Selenium imports from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service def is_direct_video_url(url: str): """ Naive check if the user input is a direct link to a video file. You can expand this list as needed (e.g. .mp4, .webm, .mov, .avi). """ video_extensions = (".mp4", ".webm", ".mov", ".avi", ".mkv") return url.lower().endswith(video_extensions) def get_video_url(page_url): """ Uses Selenium in headless mode to load the page and extract the video URL from a