Update app.py
Browse files4 unmodified lines567891011121314151624 unmodified lines4142434445464748495051525354555620 unmodified lines777879808182834 unmodified linesfrom phi.tools.duckduckgo import DuckDuckGofrom google.generativeai import upload_file, get_fileimport google.generativeai as genaiimport timefrom pathlib import Pathfrom dotenv import load_dotenvimport osimport tempfile# Load environment variablesload_dotenv()24 unmodified linesmultimodal_Agent = initialize_agent()# Function to download YouTube video using yt-dlpfrom yt_dlp import YoutubeDLimport tempfiledef 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."""20 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",4 unmodified lines5678910111213141524 unmodified lines4041424344454647484950515220 unmodified lines7374757677784 unmodified linesfrom phi.tools.duckduckgo import DuckDuckGofrom google.generativeai import upload_file, get_fileimport google.generativeai as genaiimport timeimport osfrom pathlib import Pathimport tempfilefrom dotenv import load_dotenv# Load environment variablesload_dotenv()24 unmodified linesmultimodal_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."""20 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+4-9