mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-10-05 16:26:57 +08:00
Update video provider
This commit is contained in:
@@ -435,14 +435,16 @@ class Backend_Api(Api):
|
||||
return jsonify({"error": {"message": "Not found"}}), 404
|
||||
if search not in self.match_files:
|
||||
self.match_files[search] = {}
|
||||
found_mime_type = False
|
||||
for root, _, files in os.walk(media_dir):
|
||||
for file in files:
|
||||
mime_type = is_allowed_extension(file)
|
||||
if mime_type is not None:
|
||||
mime_type = secure_filename(mime_type)
|
||||
if safe_search[0] in mime_type:
|
||||
found_mime_type = True
|
||||
self.match_files[search][file] = self.match_files[search].get(file, 0) + 1
|
||||
for tag in safe_search:
|
||||
for tag in safe_search[1:] if found_mime_type else safe_search:
|
||||
if tag in file.lower():
|
||||
self.match_files[search][file] = self.match_files[search].get(file, 0) + 1
|
||||
break
|
||||
|
Reference in New Issue
Block a user