Spaces:
Runtime error
Runtime error
Update run.py
Browse files
run.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
import yt_dlp
|
|
|
4 |
|
5 |
def downloader(video_url, audio_format, audio_name=None):
|
6 |
# Ensure the directory exists
|
@@ -44,8 +45,21 @@ def downloader(video_url, audio_format, audio_name=None):
|
|
44 |
# downloader('https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'mp3')
|
45 |
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
logschart = """
|
51 |
### Changelog:
|
@@ -95,7 +109,8 @@ with gr.Blocks() as demo:
|
|
95 |
download_button.click(downloader, inputs=[video_url, audio_format, audio_name], outputs=output)
|
96 |
with gr.Group():
|
97 |
with gr.Row():
|
98 |
-
gr.Markdown("Welcome :)")
|
99 |
gr.Markdown(logschart)
|
100 |
-
|
|
|
|
|
101 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
import yt_dlp
|
4 |
+
import markdown
|
5 |
|
6 |
def downloader(video_url, audio_format, audio_name=None):
|
7 |
# Ensure the directory exists
|
|
|
45 |
# downloader('https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'mp3')
|
46 |
|
47 |
|
48 |
+
# Function to read the markdown file and convert it to HTML
|
49 |
+
def read_markdown_file(file_path):
|
50 |
+
with open(file_path, 'r', encoding='utf-8') as file:
|
51 |
+
md_content = file.read()
|
52 |
+
html_content = markdown.markdown(md_content)
|
53 |
+
return html_content
|
54 |
|
55 |
+
# Path to your markdown file
|
56 |
+
markdown_file_path = 'notread.md'
|
57 |
+
|
58 |
+
# Read and convert the markdown content
|
59 |
+
html_content = read_markdown_file(markdown_file_path)
|
60 |
+
|
61 |
+
# Read and convert the markdown content
|
62 |
+
html_content = read_markdown_file(markdown_file_path)
|
63 |
|
64 |
logschart = """
|
65 |
### Changelog:
|
|
|
109 |
download_button.click(downloader, inputs=[video_url, audio_format, audio_name], outputs=output)
|
110 |
with gr.Group():
|
111 |
with gr.Row():
|
|
|
112 |
gr.Markdown(logschart)
|
113 |
+
with gr.Row():
|
114 |
+
gr.HTML(html_content)
|
115 |
+
|
116 |
demo.launch()
|