仅供学习参考
请勿用于非法用途!!!
ck 获取 :https://m.iqiyi.com/u/
搜索请求头关键字 psp_cki= 或 P00001= 或 authcookie= 都可以
[Java] 纯文本查看 复制代码 package com.xxl.job.executor.service.test;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
public class test_iqy {
public static final RestTemplate re = new RestTemplate();
public static final HttpHeaders headers = new HttpHeaders();
public static final String CK = "";
public static void main(String[] args) {
StringBuffer log = new StringBuffer();
String url = "https://tc.vip.iqiyi.com/taskCenter/task/queryUserTask?autoSign=yes&P00001=" + CK;
String url1 = "https://iface2.iqiyi.com/aggregate/3.0/lottery_activity?app_k=0&app_v=0&platform_id=0&dev_os=0&dev_ua=0&net_sts=0&qyid=0&psp_uid=0&psp_cki=" + CK + "&psp_status=0&secure_p=0&secure_v=0&req_sn=0";
String url2 = "https://tc.vip.iqiyi.com/growthAgency/growth-records?appname=growthValueDetail&P00001=" + CK + "&platform=97ae2982356f69d8&lang=zh_cn&pageNo=1&pageSize=1";
ResponseEntity<String> url_reponse = null;
url_reponse = re.exchange(url, HttpMethod.GET, new HttpEntity<String>(headers), String.class);
log.append("签到状态 :" + JSONObject.parseObject(url_reponse.getBody()).getString("msg") + "\n");
url_reponse = re.exchange(url1, HttpMethod.GET, new HttpEntity<String>(headers), String.class);
if (JSONObject.parseObject(url_reponse.getBody()).getString("code").equals("0")) {
log.append("奖品 :" + JSONObject.parseObject(url_reponse.getBody()).getString("awardName") + "\n");
} else {
log.append("奖品 :" + "今日抽过奖了" + "\n");
}
url_reponse = re.exchange(url2, HttpMethod.GET, new HttpEntity<String>(headers), String.class);
log.append("签到内容 :" + JSONObject.parseObject(url_reponse.getBody()).getJSONObject("data").getJSONObject("growthRecords").getJSONArray("result").getJSONObject(0).getString("description") + "\n");
log.append("获得经验 :" + JSONObject.parseObject(url_reponse.getBody()).getJSONObject("data").getJSONObject("growthRecords").getJSONArray("result").getJSONObject(0).getString("amount") + "\n");
log.append("获得时间 :" + JSONObject.parseObject(url_reponse.getBody()).getJSONObject("data").getJSONObject("growthRecords").getJSONArray("result").getJSONObject(0).getString("createTime") + "\n");
System.out.println(log.toString());
}
}
|