feat: search suggestions
This commit is contained in:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user