download image error
hong鈥唄ei 发布于2020-01 浏览:1097 回复:3
1
收藏
快速回复

public static String imageCensorUserDefinedURL(String url) throws UnsupportedEncodingException {
String keyWord = URLEncoder.encode(url, "UTF-8");
System.out.println(keyWord);
JSONObject response = client.imageCensorUserDefined(keyWord, EImgType.URL, null);
System.out.println(response);

int conclusionType = response.getInt("conclusionType");

logger.info(response.toString());
if(conclusionType==1){
return null;
}else {
JSONArray jsonArray =response.getJSONArray("data");
JSONObject jsonObject=jsonArray.getJSONObject(0);
return jsonObject.getString("msg");
}
}


public static void main(String args[]) throws UnsupportedEncodingException {

System.out.println(imageCensorUserDefinedURL("https://deputy.yireninfo.com/imgUp/travel/13598181150266.png"));

}

 

 

https%3A%2F%2Fdeputy.yireninfo.com%2FimgUp%2Ftravel%2F13598181150266.png
21:52:50.811 [main] INFO com.baidu.aip.client.BaseClient - get access_token success. current state: STATE_AIP_AUTH_OK
21:52:50.815 [main] DEBUG com.baidu.aip.client.BaseClient - current state after check priviledge: STATE_TRUE_AIP_USER
Exception in thread "main" org.json.JSONException: JSONObject["conclusionType"] not found.
at org.json.JSONObject.get(JSONObject.java:471)
at org.json.JSONObject.getInt(JSONObject.java:598)
at com.yr.deputyReward.util.Sample.imageCensorUserDefinedURL(Sample.java:51)
at com.yr.deputyReward.util.Sample.main(Sample.java:66)
{"log_id":15783187714826801,"error_msg":"download image error","error_code":282804}

 

 

收藏
点赞
1
个赞
共3条回复 最后由hong鈥唄ei回复于2020-01
#2hong鈥唄ei回复于2020-01

太难了,百度的开发文档

1
#4hong鈥唄ei回复于2020-01

不是 清晰度的问题

 

0
#3hong鈥唄ei回复于2020-01

弄了一下午了   服了  有毒把

 

0
TOP
切换版块