tensorkelechi commited on
Commit
dcef7e3
·
verified ·
1 Parent(s): aa86aaf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -26,16 +26,16 @@ def youtube_video_downloader(url):
26
  yt_vid.streams.filter(progressive=True, file_extension="mp4")
27
  .order_by("resolution")
28
  .desc()
29
- .first()
 
30
  )
31
  vid_dld = vid_dld.download()
32
  return vid_dld, title
33
 
34
 
35
  def audio_extraction(video_file, output_format):
36
- video_path = f"{video_file}"
37
  audio = extract_audio(
38
- input_path=os.fspath(video_file), output_path=f"{str(video_path)[:-4]}.mp3", output_format=f"{output_format}"
39
  )
40
  return audio
41
 
@@ -89,9 +89,7 @@ with youtube_url_tab:
89
  if st.button("Generate Summary"):
90
  summary = generate_ai_summary(ytvideo_transcript)
91
  st.write(summary)
92
-
93
- except Exception as e:
94
- st.error(f"Enter a valid url: {e}")
95
 
96
  # Video file transcription
97
 
 
26
  yt_vid.streams.filter(progressive=True, file_extension="mp4")
27
  .order_by("resolution")
28
  .desc()
29
+ .first
30
+ ()
31
  )
32
  vid_dld = vid_dld.download()
33
  return vid_dld, title
34
 
35
 
36
  def audio_extraction(video_file, output_format):
 
37
  audio = extract_audio(
38
+ input_path=os.fspath(video_file), output_path=f"{str(video_file)[:-4]}.mp3", output_format=f"{output_format}"
39
  )
40
  return audio
41
 
 
89
  if st.button("Generate Summary"):
90
  summary = generate_ai_summary(ytvideo_transcript)
91
  st.write(summary)
92
+
 
 
93
 
94
  # Video file transcription
95