Skip to content

Commit

Permalink
Update search.py
Browse files Browse the repository at this point in the history
  • Loading branch information
radry authored Feb 8, 2024
1 parent e773947 commit 8587848
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Backend/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import List
from termcolor import colored

def search_for_stock_videos(query: str, api_key: str, it: int) -> List[str]:
def search_for_stock_videos(query: str, api_key: str, it: int, min_dur: int) -> List[str]:
"""
Searches for stock videos based on a query.
Expand Down Expand Up @@ -36,6 +36,9 @@ def search_for_stock_videos(query: str, api_key: str, it: int) -> List[str]:
try:
# loop through each video in the result
for i in range(it):
#check if video has desired minimum duration
if response["videos"][i]["duration"] < min_dur:
continue
raw_urls = response["videos"][i]["video_files"]
temp_video_url = ""

Expand Down

0 comments on commit 8587848

Please sign in to comment.