Salman11223
commited on
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
imort download_youtube_video
|
2 |
+
|
3 |
+
def app(video_link):
|
4 |
+
downloaded_file_path = download_youtube_video(video_link)
|
5 |
+
if downloaded_file_path:
|
6 |
+
# Do something with the downloaded video file, such as returning it to the user
|
7 |
+
with open(downloaded_file_path, 'rb') as f:
|
8 |
+
video_data = f.read()
|
9 |
+
# Return the video data here (e.g., send it as a response in a web application)
|
10 |
+
|
11 |
+
interface = gr.Interface(fn = app, inputs = [gr.components.Textbox(label="Enter youtube link")],
|
12 |
+
outputs=[gr.components.Video(label="Your result")]
|
13 |
+
)
|
14 |
+
|
15 |
+
interface.launch(debug=True)
|