Spaces:
Runtime error
Runtime error
Commit
·
d9bed9c
1
Parent(s):
737941f
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,16 +84,18 @@ def gen_draw(user_query:str)->tuple:
|
|
| 84 |
|
| 85 |
|
| 86 |
def vid_tube(user_query:str) -> tuple:
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
| 97 |
|
| 98 |
return (file_path,) if yt_flag else "The system cannot fulfill your request currently please try later"
|
| 99 |
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
def vid_tube(user_query:str) -> tuple:
|
| 87 |
+
|
| 88 |
+
video_id = Search(user_query).results[0].video_id
|
| 89 |
+
return f'<iframe width="560" height="315" src="https://www.youtube.com/embed/{video_id}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
|
| 90 |
+
# first_video = py_tube_list_of_videos.results[0]
|
| 91 |
+
# yt_flag = False
|
| 92 |
+
# for vid in py_tube_list_of_videos.results:
|
| 93 |
+
# print(vid.vid_info.keys())
|
| 94 |
+
# if vid.vid_info.get('streamingData'):
|
| 95 |
+
# print(vid.vid_info.keys(),'-')
|
| 96 |
+
# yt_flag = True
|
| 97 |
+
# file_path = vid.streams.get_highest_resolution().download('/tmp/')
|
| 98 |
+
# break
|
| 99 |
|
| 100 |
return (file_path,) if yt_flag else "The system cannot fulfill your request currently please try later"
|
| 101 |
|