Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 690 Bytes
07505ba |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import asyncio
from modules.dropbox.video import fetch_video_urls_from_dropbox
from modules.video.model import VideoRequest
async def svc_get_video_urls(req: VideoRequest):
videos = await fetch_video_urls_from_dropbox(scripture_name=req.scripture_name)
matching_videos = [
video
for video in videos
if video.global_index == req.global_index
and video.scripture == req.scripture_name
]
return {video.type: video.video_url for video in matching_videos}
if __name__ == "__main__":
data = asyncio.run(
svc_get_video_urls(
VideoRequest(global_index=4, scripture_name="divya_prabandham")
)
)
print(data)
|