feat: search suggestions

This commit is contained in:
2025-09-07 05:05:11 +02:00
parent 15d2de5228
commit 37e932956d
2 changed files with 36 additions and 2 deletions

View File

@@ -642,8 +642,9 @@ def search(data, req):
if (data[-2].lower() != "search" or data[-1].lower() != "") and data[-1].lower() != "search":
print(f"'{data[-2]}', '{data[-1]}'")
print("search suggestions are not yet supported")
return send(501, {"status": "error", "msg": "search suggestions not supported in this version of ythdd", "data": []})
previous_query = req.args.get('pq')
suggestions = ythdd_extractor.WEBgetSearchSuggestions(search_query, previous_query)
return send(200, suggestions)
results = ythdd_extractor.WEBextractSearchResults(search_query)
results_list = []