Spaces:
Sleeping
Sleeping
Commit
·
a0a2b50
1
Parent(s):
6d79162
search: dict -> list
Browse files- routes/ytApi/search.py +1 -3
routes/ytApi/search.py
CHANGED
@@ -8,9 +8,7 @@ def search(request):
|
|
8 |
try:
|
9 |
html = urllib.request.urlopen("https://www.youtube.com/results?search_query={}".format(urllib.parse.quote_plus(searchQuery)))
|
10 |
videoList = re.findall(r"watch\?v=(\S{11})", html.read().decode())
|
11 |
-
videoIds
|
12 |
-
for i in range(len(videoList)): videoIds.update({i: videoList[i]})
|
13 |
-
return {"status": "pass", "query": searchQuery, "videoIds": videoIds}
|
14 |
except Exception as e:
|
15 |
print(e)
|
16 |
return {"status": "error", "details": { "error_code": 666, "error_details": "Something went wrong..." }}, 500
|
|
|
8 |
try:
|
9 |
html = urllib.request.urlopen("https://www.youtube.com/results?search_query={}".format(urllib.parse.quote_plus(searchQuery)))
|
10 |
videoList = re.findall(r"watch\?v=(\S{11})", html.read().decode())
|
11 |
+
return {"status": "pass", "query": searchQuery, "videoIds": videoList}
|
|
|
|
|
12 |
except Exception as e:
|
13 |
print(e)
|
14 |
return {"status": "error", "details": { "error_code": 666, "error_details": "Something went wrong..." }}, 500
|