deepsync commited on
Commit
090c7e0
1 Parent(s): f10c2d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -9,9 +9,9 @@ from tempfile import TemporaryDirectory
9
  cachedir = ".cache"
10
 
11
 
12
- def clip(yt_url, start_timestamp, duration):
13
- start_timestamp = round(float(start_timestamp), 3)
14
- duration = round(float(duration), 3)
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
- clip_length = gr.Textbox(label="Clip length (in seconds)")
44
 
45
- interface = gr.Interface(clip, [url_link, start_timestamp, clip_length], "audio", title="YouTube Clipper")
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")))