azamat commited on
Commit
69a9eb6
·
1 Parent(s): 27c9a3a

Add video download

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -21,7 +21,8 @@ def remove_downloaded_videos():
21
  def search(query):
22
  remove_downloaded_videos() # Remove previously downloaded videos
23
  shorts = weaviate_explorer.explore(query)
24
- video_path = gdown.download(shorts[0]["link"], output=downloads_dir, quiet=False)
 
25
  video_player.value = video_path
26
  return video_player, "\n\n".join([f"{r['title']}\n{r['link']}" for r in shorts])
27
 
 
21
  def search(query):
22
  remove_downloaded_videos() # Remove previously downloaded videos
23
  shorts = weaviate_explorer.explore(query)
24
+ download_url = f"https://drive.google.com/uc?id={shorts[0]['link'][-2]}"
25
+ video_path = gdown.download(download_url, output=downloads_dir)
26
  video_player.value = video_path
27
  return video_player, "\n\n".join([f"{r['title']}\n{r['link']}" for r in shorts])
28