Update app.py
Browse files38 unmodified lines39404142434445464748495051524 unmodified lines575859606162636465666 unmodified lines73747576777838 unmodified lines# Initialize the agentmultimodal_Agent = initialize_agent()# Function to download YouTube video using yt-dlpdef download_youtube_video(youtube_url):"""Downloads a YouTube video using yt-dlp with cookies for authentication.Parameters:- youtube_url: The URL of the YouTube video.Returns:- The path to the downloaded video file."""4 unmodified lines# yt-dlp optionsydl_opts = {'format': 'bestvideo+bestaudio/best', # Download best video and audio'outtmpl': temp_video_path, # Output file path'merge_output_format': 'mp4', # Merge into MP4 format'cookies': 'cookies.txt', # Path to the cookies file'quiet': True, # Suppress yt-dlp output}try:6 unmodified linesexcept Exception as e:raise RuntimeError(f"An error occurred while downloading the video: {str(e)}")# YouTube video URL inputyoutube_url = st.text_input("Enter the YouTube video link",38 unmodified lines394041424344454647484950515253544 unmodified lines596061626364656667686 unmodified lines7576777879808138 unmodified lines# Initialize the agentmultimodal_Agent = initialize_agent()import tempfilefrom yt_dlp import YoutubeDLdef download_youtube_video(youtube_url):"""Downloads a YouTube video using yt-dlp with cookies for authentication.Parameters:- youtube_url: The URL of the YouTube video.Returns:- The path to the downloaded video file."""4 unmodified lines# yt-dlp optionsydl_opts = {'format': 'bestvideo+bestaudio/best', # Download best video and audio'outtmpl': temp_video_path, # Output file path'merge_output_format': 'mp4', # Merge into MP4 format'cookies': 'cookies.txt', # Path to the cookies file'quiet': True, # Suppress yt-dlp output}try:6 unmodified linesexcept Exception as e:raise RuntimeError(f"An error occurred while downloading the video: {str(e)}")# YouTube video URL inputyoutube_url = st.text_input("Enter the YouTube video link",
app.py+10-7