JaMugen commited on
Commit
47db6ed
·
1 Parent(s): 257b22e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
- import streamlit as st
3
  import subprocess
 
4
  def install_libraries():
5
  try:
6
  subprocess.check_call(['pip', 'install', 'pytube'])
@@ -9,14 +9,17 @@ def install_libraries():
9
  except subprocess.CalledProcessError as e:
10
  print("Error during installation:", e)
11
 
12
- if __name__ == "__main__":
13
- install_libraries()
14
- import functions
15
  # Title
16
- st.title("Translate YouTube Video to French with Hugging Face")
 
 
17
  url = st.text_input("Enter YouTube Video URL")
18
- captions = functions.download_video_transcript(url)
19
- if captions:
20
- st.write(captions)
21
- else:
22
- st.write("Provided url did contain captions")
 
 
1
  import streamlit as st
 
2
  import subprocess
3
+
4
  def install_libraries():
5
  try:
6
  subprocess.check_call(['pip', 'install', 'pytube'])
 
9
  except subprocess.CalledProcessError as e:
10
  print("Error during installation:", e)
11
 
12
+
13
+ install_libraries()
14
+ import functions
15
  # Title
16
+
17
+ st.title("Translate YouTube Video to French")
18
+
19
  url = st.text_input("Enter YouTube Video URL")
20
+ if url:
21
+ captions = functions.download_video_transcript(url)
22
+ if captions:
23
+ st.write(captions)
24
+ else:
25
+ st.write("Provided URL did not contain captions")