Update app.py
Browse files
app.py
CHANGED
|
@@ -115,7 +115,7 @@ def process_m3u(m3u_text):
|
|
| 115 |
|
| 116 |
return out_247, out_events, "\n".join(log)
|
| 117 |
|
| 118 |
-
# Gradio UI
|
| 119 |
def run_app(m3u_text):
|
| 120 |
out_247, out_events, log = process_m3u(m3u_text)
|
| 121 |
file_247 = random_filename(uppercase=True)
|
|
@@ -124,12 +124,13 @@ def run_app(m3u_text):
|
|
| 124 |
f.write(out_247)
|
| 125 |
with open(file_events, "w", encoding="utf-8") as f:
|
| 126 |
f.write(out_events)
|
| 127 |
-
|
|
|
|
| 128 |
|
| 129 |
iface = gr.Interface(
|
| 130 |
fn=run_app,
|
| 131 |
inputs=gr.Textbox(lines=15, placeholder="Paste your M3U playlist here..."),
|
| 132 |
-
outputs="
|
| 133 |
title="Project 1 Playlist Processor",
|
| 134 |
description="Splits 24/7 and Events playlists, applies JSON tvg-id mappings, adds special sports rules, and outputs two clean M3Us."
|
| 135 |
)
|
|
|
|
| 115 |
|
| 116 |
return out_247, out_events, "\n".join(log)
|
| 117 |
|
| 118 |
+
# Gradio UI with file downloads
|
| 119 |
def run_app(m3u_text):
|
| 120 |
out_247, out_events, log = process_m3u(m3u_text)
|
| 121 |
file_247 = random_filename(uppercase=True)
|
|
|
|
| 124 |
f.write(out_247)
|
| 125 |
with open(file_events, "w", encoding="utf-8") as f:
|
| 126 |
f.write(out_events)
|
| 127 |
+
|
| 128 |
+
return file_247, file_events, log
|
| 129 |
|
| 130 |
iface = gr.Interface(
|
| 131 |
fn=run_app,
|
| 132 |
inputs=gr.Textbox(lines=15, placeholder="Paste your M3U playlist here..."),
|
| 133 |
+
outputs=[gr.File(label="24/7 Playlist"), gr.File(label="Events Playlist"), gr.Textbox(label="Log")],
|
| 134 |
title="Project 1 Playlist Processor",
|
| 135 |
description="Splits 24/7 and Events playlists, applies JSON tvg-id mappings, adds special sports rules, and outputs two clean M3Us."
|
| 136 |
)
|