55 "episodes" : ["id" , "count" , "title" , "saga_id" , "arc_id" ],
66 "movies" : ["id" , "count" , "title" ],
77 "tomes" : ["id" , "count" , "title" ],
8- "chapters" : ["id" , "count" , "title" ],
9- "arcs" : ["id" , "count" , "title " ],
8+ "chapters" : ["id" , "count" , "title" , "tome_id" , "tome" ],
9+ "arcs" : ["id" , "count" , "saga_id " ],
1010 "sagas" : ["id" , "count" , "title" ],
11- "hakis" : ["id" , "count" , "name" , "roman_name" ],
11+ "hakis" : ["id" , "count" , "name" , "roman_name" , "characters_id" ],
1212 "characters" : ["id" , "count" , "name" , "job" , "bounty" , "status" , "size" ],
1313 "dials" : ["id" , "count" , "name" , "type" ],
1414 "luffy/gears" : ["id" , "count" , "title" ],
15- "luffy/techniques" : ["id" , "count" , "name" , "translation" ],
15+ "luffy/techniques" : ["id" , "count" , "name" , "translation" , "gear_id" ],
1616 "locates" : ["id" , "count" , "name" , "sea" , "affiliation" ],
1717 "fruits" : ["id" , "count" , "type" ],
1818 "swords" : ["id" , "count" , "name" ],
1919 "boats" : ["id" , "count" , "name" , "type" , "crew_id" , "captain_id" ],
2020 "crews" : ["id" , "count" , "name" , "status" , "yonko" ],
2121}
2222
23- STRING_SEARCHES = ["name" , "job" , "bounty" , "status" , "size" , "type" ]
23+ STRING_SEARCHES = ["name" , "job" , "bounty" , "status" , "size" , "type" , "tome_name" , "roman_name" , "sea" , "affiliation" ]
2424ID_SEARCHES = ["crew_id" , "captain_id" ]
25- NO_SEARCH_ID_SEARCHES = ["saga_id" , "arc_id" ]
25+ NO_SEARCH_ID_SEARCHES = ["saga_id" , "arc_id" , "characters_id" , "gear_id" , "tome_id" ]
2626NO_RESOURCE_SEARCHES = ["count" , "yonko" ]
2727
2828
@@ -51,7 +51,7 @@ def build_url(endpoint, search=None, resource_id=None):
5151def adding_search (endpoint , search , resource_id = None ):
5252 if search in STRING_SEARCHES :
5353 return f"{ URL } { endpoint } /search/{ search } /{ resource_id } "
54- elif search in ID_SEARCHES :
54+ elif search in ID_SEARCHES or ( endpoint == "arcs" and 'id' in search and search != "id" ) :
5555 return f"{ URL } { endpoint } /search/{ search [:- 3 ]} /{ resource_id } "
5656 elif search in NO_SEARCH_ID_SEARCHES :
5757 return f"{ URL } { endpoint } /{ search [:- 3 ]} /{ resource_id } "
@@ -67,4 +67,4 @@ def convert_name(name):
6767
6868
6969def pretty_print (data ):
70- return json .dumps (data , indent = 4 )
70+ return json .dumps (data , indent = 4 , ensure_ascii = False ). encode ( "utf8" ). decode ( )
0 commit comments