# app.py import streamlit as st from Program_Flask import Analyze def main(): st.title("YouTube Video Analysis App") # Get the video link from the user video_link = st.text_input("Enter YouTube Video Link:") if st.button("Analyze"): # Call your analysis function analysis_result = Analyze(video_link) # Check if the analysis result is None or empty if not analysis_result: st.error("Analysis failed. Please check the provided video link.") return # Display the analysis results st.subheader("Analysis Results:") display_value("Title", analysis_result['title']) display_value("URL", analysis_result['url']) display_value("Length", f"{analysis_result['len']} seconds") display_value("Language", analysis_result['lang']) display_value("Summary", analysis_result['summary']) display_value("Sentiment", analysis_result['sentiment']) display_value("Fact or Opinion", analysis_result['foo']) display_value("Presence of Hate", analysis_result['hate']) display_value("Explanation", analysis_result['explanation']) display_value("Hate Degree", analysis_result['degree']) display_value("Part with Hate", analysis_result['part']) st.write("Transcript:") st.code(analysis_result['transcript']) def display_value(label, value): displayed_value = value if value is not None and value != '' else "N/A" st.write(f"{label}: {displayed_value}") if __name__ == "__main__": main()