Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Nov 7, 2024
1 parent 1e698e3 commit 89df2e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/InternetSearch/Client/HunterClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public List<SearchResultEntry> parseResp(String respbody) {
try {
JSONObject obj = new JSONObject(respbody);
int code = obj.getInt("code");
if (code == 429) {
//{"code":429,"data":null,"message":"请求太多啦,稍后再试试"}
return result;
}

if (code == 200 || code == 40205) {
JSONObject data = obj.getJSONObject("data");
if (!data.get("arr").toString().equals("null")) {
Expand Down
5 changes: 5 additions & 0 deletions src/InternetSearch/Client/QuakeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public List<SearchResultEntry> parseResp(String respbody) {
JSONObject obj = new JSONObject(respbody);
// q5000 或者 0
String code = obj.get("code") + "";
if (code.equals("q3005")) {
//{"code":"q3005","message":"调用API过于频繁","data":{},"meta":{}}
return result;
}

if (code.equals("0")) {
JSONArray results = obj.getJSONArray("data");
for (Object item : results) {
Expand Down

0 comments on commit 89df2e6

Please sign in to comment.