Commit 05c98e72 authored by wang's avatar wang

jiami

parent cdd01640
...@@ -61,6 +61,29 @@ class PxBypass { ...@@ -61,6 +61,29 @@ class PxBypass {
} }
async add_headers() {
let cks = Object.keys(this.cookies).map((v, k) => `${v}=${this.cookies[v]}`).join('; ')
let headers = {
"authority": "booking.flyfrontier.com",
"accept": "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",
"accept-language": "en-US,en;q=0.9",
"user-agent": this.ua,
"cookie": cks
}
let res = await axios.post('http://ymx-lcc.unififi.com/header/add', JSON.stringify({
'brush_fromto': 'LAS-BOS',
'brush_fromdate': '2023-05-26',
'brush_header': headers,
'brush_proxy': this.prox,
'brush_mode': 'shopping',
'brush_name': 'js0',
'brush_type': 'cookieF9',
}));
this.log.debug(res.data)
}
async do_collector(data) { async do_collector(data) {
try { try {
if (typeof data === 'object') { if (typeof data === 'object') {
...@@ -254,6 +277,7 @@ class PxBypass { ...@@ -254,6 +277,7 @@ class PxBypass {
if (res.data.status_code === 200) { if (res.data.status_code === 200) {
this.log.warn('success', res.data.status_code, res.data.text.includes('FlightData')) this.log.warn('success', res.data.status_code, res.data.text.includes('FlightData'))
await this.add_headers()
} else { } else {
this.log.error(error, res.data.status_code) this.log.error(error, res.data.status_code)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment