Spaces:
Running
Running
nothere990
commited on
Commit
·
b0582f6
1
Parent(s):
3ffddbe
made quality optional
Browse files
main.py
CHANGED
@@ -798,7 +798,7 @@ async def xnxx_search(
|
|
798 |
upload_time: Optional[str] = None,
|
799 |
length: Optional[str] = None,
|
800 |
mode: Optional[str] = None,
|
801 |
-
|
802 |
results: Optional[int] = 36
|
803 |
):
|
804 |
data_dict = {
|
@@ -824,33 +824,24 @@ async def xnxx_search(
|
|
824 |
}
|
825 |
|
826 |
try:
|
827 |
-
# Validate quality if provided
|
828 |
-
if quality is not None:
|
829 |
-
if quality not in data_dict["quality"]:
|
830 |
-
return SuccessResponse(
|
831 |
-
status="False",
|
832 |
-
randydev={"error": "Invalid quality"}
|
833 |
-
)
|
834 |
-
SearchingQuality = data_dict["quality"][quality]
|
835 |
-
else:
|
836 |
-
SearchingQuality = None
|
837 |
-
|
838 |
# Prepare search parameters
|
839 |
search_kwargs = {
|
840 |
-
"query": query
|
841 |
-
"searching_quality": SearchingQuality,
|
842 |
}
|
843 |
if length is not None:
|
844 |
search_kwargs["length"] = data_dict["length"][length]
|
845 |
|
|
|
|
|
|
|
846 |
if upload_time is not None:
|
847 |
search_kwargs["upload_time"] = data_dict["upload_time"][upload_time]
|
848 |
|
849 |
if mode is not None:
|
850 |
search_kwargs["mode"] = data_dict["mode"][mode]
|
851 |
|
852 |
-
if
|
853 |
-
search_kwargs["limit"] =
|
854 |
|
855 |
# Perform the search with only the provided parameters
|
856 |
search = xnxx_client().search(**search_kwargs)
|
|
|
798 |
upload_time: Optional[str] = None,
|
799 |
length: Optional[str] = None,
|
800 |
mode: Optional[str] = None,
|
801 |
+
page: Optional[int] = None,
|
802 |
results: Optional[int] = 36
|
803 |
):
|
804 |
data_dict = {
|
|
|
824 |
}
|
825 |
|
826 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
827 |
# Prepare search parameters
|
828 |
search_kwargs = {
|
829 |
+
"query": query
|
|
|
830 |
}
|
831 |
if length is not None:
|
832 |
search_kwargs["length"] = data_dict["length"][length]
|
833 |
|
834 |
+
if quality is not None:
|
835 |
+
search_kwargs["searching_quality"] = data_dict["quality"][quality]
|
836 |
+
|
837 |
if upload_time is not None:
|
838 |
search_kwargs["upload_time"] = data_dict["upload_time"][upload_time]
|
839 |
|
840 |
if mode is not None:
|
841 |
search_kwargs["mode"] = data_dict["mode"][mode]
|
842 |
|
843 |
+
if page is not None:
|
844 |
+
search_kwargs["limit"] = page
|
845 |
|
846 |
# Perform the search with only the provided parameters
|
847 |
search = xnxx_client().search(**search_kwargs)
|