Multi-Rag / src /Web /utils /main_utils.py
VashuTheGreat's picture
Clean commit without images
1f725d8
import re
def is_youtube_video(url: str) -> bool:
youtube_regex = r"(https?://)?(www\.)?(youtube\.com|youtu\.be)/(watch\?v=|shorts/|embed/)?([A-Za-z0-9_-]{11})"
match = re.search(youtube_regex, url)
return bool(match)