1Prarthana commited on
Commit
2f90f69
·
verified ·
1 Parent(s): 9451c89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -108,14 +108,25 @@ def extract_video_id(video_url):
108
 
109
 
110
  # Fetch YouTube Transcript
 
 
 
 
 
 
 
 
111
  def extract_transcript_details(video_id):
112
  try:
113
  transcript_text = YouTubeTranscriptApi.get_transcript(video_id)
114
  return " ".join([i["text"] for i in transcript_text])
115
- except Exception:
 
 
116
  return None
117
 
118
 
 
119
  # Generate Summary with Gemini AI
120
  def generate_gemini_content(transcript_text):
121
  prompt = """You are an AI-based YouTube video summarizer.
 
108
 
109
 
110
  # Fetch YouTube Transcript
111
+ # def extract_transcript_details(video_id):
112
+ # try:
113
+ # transcript_text = YouTubeTranscriptApi.get_transcript(video_id)
114
+ # return " ".join([i["text"] for i in transcript_text])
115
+ # except Exception:
116
+ # return None
117
+
118
+
119
  def extract_transcript_details(video_id):
120
  try:
121
  transcript_text = YouTubeTranscriptApi.get_transcript(video_id)
122
  return " ".join([i["text"] for i in transcript_text])
123
+ except Exception as e:
124
+ print(f"❌ Error Type: {type(e).__name__}")
125
+ print(f"❌ Error Message: {e}")
126
  return None
127
 
128
 
129
+
130
  # Generate Summary with Gemini AI
131
  def generate_gemini_content(transcript_text):
132
  prompt = """You are an AI-based YouTube video summarizer.