Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -175,16 +175,16 @@ async def youtube_video(payload: YouTubeBase):
|
|
175 |
with open(f"{yt_file}.mp4", "rb") as video_file:
|
176 |
encoded_string = base64.b64encode(video_file.read())
|
177 |
return SuccessResponse(
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
except Exception as e:
|
189 |
return SuccessResponse(
|
190 |
status="False",
|
|
|
175 |
with open(f"{yt_file}.mp4", "rb") as video_file:
|
176 |
encoded_string = base64.b64encode(video_file.read())
|
177 |
return SuccessResponse(
|
178 |
+
status="True",
|
179 |
+
randydev={
|
180 |
+
"video_data": encoded_string,
|
181 |
+
"title": yt_data['title'],
|
182 |
+
"views": yt_data['view_count'],
|
183 |
+
"duration": secs_to_mins(int(yt_data['duration'])),
|
184 |
+
"thumbnail": f"https://i.ytimg.com/vi/{yt_data['id']}/hqdefault.jpg",
|
185 |
+
"time_second": time_second
|
186 |
+
}
|
187 |
+
)
|
188 |
except Exception as e:
|
189 |
return SuccessResponse(
|
190 |
status="False",
|