| | |
| | | public static List<ImageInfo> getTBDetailImageWithSizev2(Long auctionId,ProxyIP ip) {
|
| | | List<ImageInfo> imgList = new ArrayList<>();
|
| | | try {
|
| | | Map<String, String> headers = new HashMap<>();
|
| | | headers.put("User-Agent",
|
| | | "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1");
|
| | | headers.put("Referer", "https://detail.tmall.com/item.htm?id=" + auctionId);
|
| | | String url = String.format("https://hws.m.taobao.com/cache/desc/5.0?id=" + auctionId);
|
| | | String result = HttpUtil.get(url,null,ip);
|
| | | LogHelper.test("代理IP:" + ip.getIp() + ":" + ip.getPort());
|
| | | String result = HttpUtil.get(url, headers, ip);
|
| | | LogHelper.test("返回内容:" + result);
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | JSONObject data = JSONObject.fromObject(result);
|
| | |
|
| | | JSONArray array = data.optJSONObject("wdescContent").optJSONArray("pages");
|
| | |
| | | imgList.add(img);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|