diff --git a/config/spider-smart_timetable_login_home/spider-smart_timetable_login_home.json b/config/spider-smart_timetable_login_home/spider-smart_timetable_login_home.json new file mode 100644 index 0000000000000000000000000000000000000000..96235df3577e7ffd28310920d8f660aacac7b6c4 --- /dev/null +++ b/config/spider-smart_timetable_login_home/spider-smart_timetable_login_home.json @@ -0,0 +1,219 @@ +{ + "name": "smart_timetable_login_home", + "version": 1, + "engine": { + "cookie": true, + "forceSSL": true, + "delay": 500 + }, + "environment": ["ul", "pl", "redirect_url", "redirect_url_login", "date"], + "task": [ + { + "name": "get_lt", + "url": "https://zhlgd.whut.edu.cn/tpass/login?service=$(redirect_url)", + "method": "get", + "redirect": false, + "success": 200, + "content": { + "type": "regex", + "patten": "(LT-\\d+-.+?-tpass).+?(e\\d{1}s\\d{1})", + "value": [ + { + "key": "lt", + "path": "1" + }, + { + "key": "execution", + "path": "2" + } + ] + }, + "header": [], + "delay": 3000 + }, + { + "name": "ias_login", + "url": "https://zhlgd.whut.edu.cn/tpass/login?service=$(redirect_url_login)", + "method": "post", + "redirect": false, + "success": 302, + "payload": { + "type": "form", + "patten": "", + "value": [ + { + "key": "rsa", + "value": "", + "type": "string" + }, + { + "key": "ul", + "value": "$(ul)", + "type": "string" + }, + { + "key": "pl", + "value": "$(pl)", + "type": "string" + }, + { + "key": "lt", + "value": "$(lt)", + "type": "string" + }, + { + "key": "execution", + "value": "$(execution)", + "type": "string" + }, + { + "key": "_eventId", + "value": "submit", + "type": "string" + } + ], + "header": [ + { + "key": "Host", + "value": "zhlgd.whut.edu.cn", + "type": "string" + }, + { + "key": "Origin", + "value": "https://zhlgd.whut.edu.cn", + "type": "string" + }, + { + "key": "Referer", + "value": "https://zhlgd.whut.edu.cn/tpass/login?service=$(redirect_url)", + "type": "string" + }, + { + "key": "Sec-Fetch-Dest", + "value": "document", + "type": "string" + }, + { + "key": "Sec-Fetch-Mode", + "value": "navigate", + "type": "string" + }, + { + "key": "Sec-Fetch-Site", + "value": "same-origin", + "type": "string" + }, + { + "key": "Sec-Fetch-User", + "value": "?1", + "type": "string" + }, + { + "key": "Upgrade-Insecure-Requests", + "value": "1", + "type": "string" + }, + { + "key": "sec-ch-ua", + "value": "\"Not A(Brand\";v=\"8\", \"Chromium\";v=\"132\", \"Microsoft Edge\";v=\"132\"", + "type": "string" + }, + { + "key": "sec-ch-ua-mobile", + "value": "?0", + "type": "string" + }, + { + "key": "sec-ch-ua-platform", + "value": "\"Windows\"", + "type": "string" + }, + { + "key": "Accept", + "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", + "type": "string" + }, + { + "key": "Accept-Encoding", + "value": "gzip, deflate, bar, zstd", + "type": "string" + }, + { + "key": "Cache-Control", + "value": "max-age=0", + "type": "string" + } + ] + }, + "content": null, + "header":[ + { + "key": "Location", + "path": "Location" + } + ] + }, + { + "name": "redirect1", + "url": "$(Location)", + "method": "get", + "redirect": false, + "success": 302, + "content": null, + "header":[ + { + "key": "Location", + "path": "Location" + } + ] + }, + { + "name": "redirect2", + "url": "$(Location)", + "method": "get", + "redirect": false, + "success": 302, + "content": null, + "header": [ + { + "key": "cookies", + "path": "Set-Cookie" + } + ] + }, + { + "name": "get_class", + "url": "https://yjapi.lgzk.whut.edu.cn/courseapi/v2/schedule/get-week-schedules", + "method": "get", + "redirect": false, + "success": 200, + "payload": { + "type": "params", + "patten": "", + "value": [ + { + "key": "start_at", + "value": "$(date)", + "type": "string" + }, + { + "key": "end_at", + "value": "$(date)", + "type": "string" + } + ] + }, + "content": { + "type": "json", + "patten": "", + "value": [ + { + "key": "list", + "path": "result.list.0.course" + } + ] + } + } + ], + "output": ["list", "cookies"] +} diff --git a/config/spiderlist/spiderlist.json b/config/spiderlist/spiderlist.json index feded5e5607d5f891069b27e24369650416e354f..4239615b1658b47e77970a1d67c2333be8699e26 100644 --- a/config/spiderlist/spiderlist.json +++ b/config/spiderlist/spiderlist.json @@ -4,6 +4,11 @@ "key": "library_login_home", "enable": true, "version": 1 + }, + { + "key": "smart_timetable_login_home", + "enable": true, + "version": 1 } ] } \ No newline at end of file