Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,8 @@ sys.path.append(os.environ['PRIVATE_DIR'])
|
|
| 26 |
from models import *
|
| 27 |
|
| 28 |
def download_audio_(link):
|
| 29 |
-
with yt_dlp.YoutubeDL({'extract_audio': True, 'format': 'bestaudio', 'outtmpl': '%(title)s.mp3'}) as video:
|
|
|
|
| 30 |
info_dict = video.extract_info(link, download = True)
|
| 31 |
video_title = info_dict['title']
|
| 32 |
video.download(link)
|
|
@@ -137,7 +138,7 @@ with gr.Blocks() as demo:
|
|
| 137 |
inputs = [audio_url_input],
|
| 138 |
outputs = [html,top1_name, top1, top2_name, top2, top3_name, top3, top4_name, top4, top5_name, top5, top6_name, top6, top7_name, top7, top8_name, top8, top9_name, top9, top10_name, top10],
|
| 139 |
fn = process_url,
|
| 140 |
-
cache_examples=
|
| 141 |
)
|
| 142 |
analyze_file_btn.click(process_file, inputs=[audio_input_file],
|
| 143 |
outputs=[top1_name, top1, top2_name, top2, top3_name, top3, top4_name, top4, top5_name, top5, top6_name, top6, top7_name, top7, top8_name, top8, top9_name, top9, top10_name, top10])
|
|
|
|
| 26 |
from models import *
|
| 27 |
|
| 28 |
def download_audio_(link):
|
| 29 |
+
#with yt_dlp.YoutubeDL({'extract_audio': True, 'format': 'bestaudio', 'outtmpl': '%(title)s.mp3'}) as video:
|
| 30 |
+
with yt_dlp.YoutubeDL({'extract_audio': True, 'format': 'bestaudio', 'outtmpl': 'tmp.mp3'}) as video:
|
| 31 |
info_dict = video.extract_info(link, download = True)
|
| 32 |
video_title = info_dict['title']
|
| 33 |
video.download(link)
|
|
|
|
| 138 |
inputs = [audio_url_input],
|
| 139 |
outputs = [html,top1_name, top1, top2_name, top2, top3_name, top3, top4_name, top4, top5_name, top5, top6_name, top6, top7_name, top7, top8_name, top8, top9_name, top9, top10_name, top10],
|
| 140 |
fn = process_url,
|
| 141 |
+
cache_examples=False,
|
| 142 |
)
|
| 143 |
analyze_file_btn.click(process_file, inputs=[audio_input_file],
|
| 144 |
outputs=[top1_name, top1, top2_name, top2, top3_name, top3, top4_name, top4, top5_name, top5, top6_name, top6, top7_name, top7, top8_name, top8, top9_name, top9, top10_name, top10])
|