SteveDigital
commited on
Commit
•
129b6dc
1
Parent(s):
8553442
Update app.py
Browse files
app.py
CHANGED
@@ -10,13 +10,16 @@ summarizer = pipeline("summarization")
|
|
10 |
|
11 |
def get_audio(url):
|
12 |
yt = YouTube(url)
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
20 |
|
21 |
def get_text(url):
|
22 |
if url != '' : output_text_transcribe = ''
|
|
|
10 |
|
11 |
def get_audio(url):
|
12 |
yt = YouTube(url)
|
13 |
+
if yt.length < 540:
|
14 |
+
video = yt.streams.filter(only_audio=True).first()
|
15 |
+
out_file=video.download(output_path=".")
|
16 |
+
base, ext = os.path.splitext(out_file)
|
17 |
+
new_file = base+'.mp3'
|
18 |
+
os.rename(out_file, new_file)
|
19 |
+
a = new_file
|
20 |
+
return a
|
21 |
+
else:
|
22 |
+
return ""
|
23 |
|
24 |
def get_text(url):
|
25 |
if url != '' : output_text_transcribe = ''
|