zohadev commited on
Commit
f7245b5
·
verified ·
1 Parent(s): d18b634

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -17
app.py CHANGED
@@ -24,20 +24,23 @@ def download_video(url, quality, crop_start, crop_end):
24
 
25
  return {"video": video_path, "audio": audio_path}
26
 
27
-
28
- iface = gr.Interface(
29
- fn=download_video,
30
- inputs=[
31
- gr.Textbox(label="YouTube URL"),
32
- gr.Radio(label="Quality", choices=["144p", "240p", "360p", "480p", "720p", "1080p"]),
33
- gr.Number(label="Crop start (seconds)"),
34
- gr.Number(label="Crop end (seconds)"),
35
- ],
36
- outputs=[
37
- gr.File(label="Video"),
38
- gr.File(label="Audio"),
39
- ],
40
- title="YouTube Audio and Video Downloader with Cropping",
41
- description="Enter a YouTube URL, select a quality, and optionally enter crop start and end times to download the video and audio with cropping.",
42
- )
43
- iface.launch()
 
 
 
 
24
 
25
  return {"video": video_path, "audio": audio_path}
26
 
27
+ def main():
28
+ iface = gr.Interface(
29
+ fn=download_video,
30
+ inputs=[
31
+ gr.Textbox(label="YouTube URL"),
32
+ gr.Radio(label="Quality", choices=["144p", "240p", "360p", "480p", "720p", "1080p"]),
33
+ gr.Number(label="Crop start (seconds)"),
34
+ gr.Number(label="Crop end (seconds)"),
35
+ ],
36
+ outputs=[
37
+ gr.File(label="Video"),
38
+ gr.File(label="Audio"),
39
+ ],
40
+ title="YouTube Audio and Video Downloader with Cropping",
41
+ description="Enter a YouTube URL, select a quality, and optionally enter crop start and end times to download the video and audio with cropping.",
42
+ )
43
+ iface.launch()
44
+
45
+ if __name__ == "__main__":
46
+ main()