Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,9 +9,9 @@ from tempfile import TemporaryDirectory
|
|
9 |
cachedir = ".cache"
|
10 |
|
11 |
|
12 |
-
def clip(yt_url, start_timestamp,
|
13 |
-
start_timestamp =
|
14 |
-
duration =
|
15 |
|
16 |
with TemporaryDirectory() as tmpdir:
|
17 |
video_output_path = os.path.join(tmpdir, "video.mp4")
|
@@ -40,9 +40,9 @@ def clip(yt_url, start_timestamp, duration):
|
|
40 |
|
41 |
url_link = gr.Textbox(label="YouTube URL")
|
42 |
start_timestamp = gr.Textbox(label="Clip start timestamp (in seconds)")
|
43 |
-
|
44 |
|
45 |
-
interface = gr.Interface(clip, [url_link, start_timestamp,
|
46 |
|
47 |
if __name__=="__main__":
|
48 |
-
interface.queue().launch()
|
|
|
9 |
cachedir = ".cache"
|
10 |
|
11 |
|
12 |
+
def clip(yt_url, start_timestamp, end_timestamp):
|
13 |
+
start_timestamp = int(start_timestamp)
|
14 |
+
duration = int(end_timestamp) - int(start_timestamp)
|
15 |
|
16 |
with TemporaryDirectory() as tmpdir:
|
17 |
video_output_path = os.path.join(tmpdir, "video.mp4")
|
|
|
40 |
|
41 |
url_link = gr.Textbox(label="YouTube URL")
|
42 |
start_timestamp = gr.Textbox(label="Clip start timestamp (in seconds)")
|
43 |
+
end_timestamp = gr.Textbox(label="Clip end timestamp (in seconds)")
|
44 |
|
45 |
+
interface = gr.Interface(clip, [url_link, start_timestamp, end_timestamp], "audio", title="YouTube Clipper", description="After downloading the clips, please go to https://demo.deepsync.co/11-voice-cloning to clone the voice.")
|
46 |
|
47 |
if __name__=="__main__":
|
48 |
+
interface.queue().launch(auth=(os.environ.get("GRADIO_USERNAME"), os.environ.get("GRADIO_PASSWORD")))
|