Spaces:
Runtime error
Runtime error
Commit ·
ad953b8
1
Parent(s): b63372f
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,13 +83,19 @@ def gen_draw(user_query:str)->tuple:
|
|
| 83 |
return "Invalid prompt"
|
| 84 |
|
| 85 |
|
| 86 |
-
|
| 87 |
def vid_tube(user_query:str) -> tuple:
|
| 88 |
py_tube_list_of_videos = Search(user_query)
|
| 89 |
first_video = py_tube_list_of_videos.results[0]
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
|
| 95 |
def search_internet(user_query:str,*,key_number:int) -> str:
|
|
|
|
| 83 |
return "Invalid prompt"
|
| 84 |
|
| 85 |
|
|
|
|
| 86 |
def vid_tube(user_query:str) -> tuple:
|
| 87 |
py_tube_list_of_videos = Search(user_query)
|
| 88 |
first_video = py_tube_list_of_videos.results[0]
|
| 89 |
+
yt_flag = False
|
| 90 |
+
for vid in py_tube_list_of_videos.results:
|
| 91 |
+
print(vid.vid_info.keys())
|
| 92 |
+
if vid.vid_info.get('streamingData'):
|
| 93 |
+
print(vid.vid_info.keys(),'-')
|
| 94 |
+
yt_flag = True
|
| 95 |
+
file_path = vid.streams.get_highest_resolution().download('/content/')
|
| 96 |
+
break
|
| 97 |
+
|
| 98 |
+
return (file_path,) if yt_flag else "The system cannot fulfill your request currently please try later"
|
| 99 |
|
| 100 |
|
| 101 |
def search_internet(user_query:str,*,key_number:int) -> str:
|