Update main.py
Browse files
main.py
CHANGED
@@ -99,7 +99,11 @@ def opds_root() -> Response:
|
|
99 |
return Response(content=xml_data, media_type="application/atom+xml")
|
100 |
|
101 |
@app.get("/opds/search")
|
102 |
-
def opds_search(
|
|
|
|
|
|
|
|
|
103 |
results = duckduckgo_search(q)
|
104 |
xml_data = generate_search_feed(q, results)
|
105 |
return Response(content=xml_data, media_type="application/atom+xml")
|
|
|
99 |
return Response(content=xml_data, media_type="application/atom+xml")
|
100 |
|
101 |
@app.get("/opds/search")
|
102 |
+
def opds_search(
|
103 |
+
q: str = Query(..., description="Search query"),
|
104 |
+
searchType: str = Query(None, alias="searchType")
|
105 |
+
) -> Response:
|
106 |
+
# Ignoring searchType parameter if provided
|
107 |
results = duckduckgo_search(q)
|
108 |
xml_data = generate_search_feed(q, results)
|
109 |
return Response(content=xml_data, media_type="application/atom+xml")
|