Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-shape
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wangmingming
lcc-shape
Commits
2f45720e
Commit
2f45720e
authored
Sep 20, 2023
by
wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收集更多信息
parent
a590ccbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
137 additions
and
128 deletions
+137
-128
jetblue.py
jetblue.py
+137
-128
No files found.
jetblue.py
View file @
2f45720e
...
...
@@ -53,133 +53,142 @@ headers = {
# 'safari_ios_15_5', 'safari_ios_15_6', 'safari_ios_16_0',
# 'safari_ios_15_6'
# ]
lastHash
=
''
usedTime
=
10
success
=
0
total
=
0
selectId
=
random
.
choice
(
list
(
envs
))
code
=
open
(
'src.js'
,
'r'
,
encoding
=
'utf-8'
)
.
read
()
code1
=
open
(
'js_dom_run.js'
,
'r'
,
encoding
=
'utf-8'
)
.
read
()
for
i
in
range
(
100
):
selectId
=
random
.
choice
(
list
(
envs
))
try
:
# selectId = '55a8fe24a752595e774341d6'
proxy
=
f
'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
# proxy = f'http://ynfflcc2023.hotmail.com:gdcfh9@69.30.227.194:{random.randint(20001, 20250)}'
# proxy = f'http://user-uni003-region-us-sessid-${random.randint(1000,5000)}-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@198.147.25.26:{int(random.randint(10000, 11149))}'
# proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# if platform.uname().system == 'Darwin':
# proxy = 'http://127.0.0.1:7890'
tlsV
=
f
'chrome_{random.randint(105, 113)}'
tlsV
=
'chrome_112'
session
=
tls_client
.
Session
(
tlsV
)
session
.
proxies
=
{
'http'
:
proxy
,
'https'
:
proxy
,
}
# selectId = 'a74b38e7115cf4d1b1f6976c'
c
=
session
.
get
(
'https://www.jetblue.com/js/src/jb-74873.js'
,
insecure_skip_verify
=
True
)
.
text
m5
=
md5
(
c
)
if
m5
!=
lastHash
and
usedTime
>
5
:
lastHash
=
m5
usedTime
=
0
logger
.
debug
(
'js变化'
)
token
=
re
.
findall
(
'nt"
\
),
\
["(.+?)",'
,
c
)[
0
]
db
.
token_shape
.
insert_one
({
'_id'
:
token
,
'update_time'
:
int
(
time
.
time
()
*
1000
)
})
code
=
open
(
'src.js'
,
'r'
,
encoding
=
'utf-8'
)
.
read
()
code1
=
open
(
'js_dom_run.js'
,
'r'
,
encoding
=
'utf-8'
)
.
read
()
with
open
(
'src_run1.js'
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
f
.
write
(
code
+
'
\n\n
'
+
c
)
# # with open('js_dom_run1.js', 'w', encoding='utf-8') as f:
# # f.write(code1 + '\n\n' + c)`
t1
=
time
.
time
()
token
=
list
(
db
.
token_shape
.
aggregate
(
[
{
'$sample'
:
{
'size'
:
1
}
}
]
))[
0
][
'_id'
]
# r = requests.get('http://127.0.0.1:5000/getinfo').json()['message']
# r = requests.get('http://127.0.0.1:3001').json()
# p = subprocess.Popen(['node', 'js_dom_run.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_chrome_105.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_company_chrome.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p
=
subprocess
.
Popen
([
'node'
,
'src_run1.js'
,
selectId
,
'11'
,
token
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
output
,
err
=
p
.
communicate
(
timeout
=
10
)
tmp
=
''
if
p
.
returncode
==
0
:
tmp
=
output
.
decode
()
.
split
(
'
\n
'
)[
-
2
]
else
:
raise
Exception
(
selectId
)
r
=
json
.
loads
(
tmp
)
# res = db.env_shape.update_one(
# {'_id': ObjectId(selectId)},
# {"$inc": {"used": 1}}
# )
usedTime
+=
1
headers
.
update
(
r
)
# headers = r
logger
.
info
(
f
"success:{success} total:{total} {(time.time() - t1) *1000:.3f}ms {len(headers['X-1ItxWO9i-a'.lower()])} {selectId} {headers['user-agent']}"
)
logger
.
info
(
f
"success:{success} proxy: {proxy} token: {token}"
)
url
=
"https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
data
=
{
"tripType"
:
"oneWay"
,
"from"
:
"LAS"
,
"to"
:
"BOS"
,
"depart"
:
"2023-05-10"
,
"cabin"
:
"economy"
,
"refundable"
:
False
,
"dates"
:
{
"before"
:
"3"
,
"after"
:
"3"
},
"pax"
:
{
"ADT"
:
1
,
"CHD"
:
0
,
"INF"
:
0
,
"UNN"
:
0
},
"redempoint"
:
False
,
"pointsBreakup"
:
{
"option"
:
""
,
"value"
:
0
},
"isMultiCity"
:
False
,
"isDomestic"
:
False
}
#
# # session = requests.Session()
#
response
=
session
.
post
(
url
,
headers
=
headers
,
json
=
data
,
insecure_skip_verify
=
True
)
logger
.
info
(
f
'tls:{tlsV} proxy:{proxy} res:: {response.status_code}'
)
# total += 1
# # print(response.text)
if
response
.
status_code
!=
403
:
res
=
db
.
env_shape
.
update_one
(
{
'_id'
:
ObjectId
(
selectId
)},
{
"$inc"
:
{
"success"
:
1
}}
)
# proxy = requests.post('http://ymx-lcc.unififi.com/proxy/get-proxy', json={
# 'type':'headerB6'
# })
print
(
headers
)
uri
=
'http://ymx-lcc.unififi.com/header/add'
# uri = 'http://52.52.23.116/header/add'
# proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
# proxy = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:10042'
while
True
:
r
=
requests
.
get
(
'http://ymx-lcc.unififi.com/header/task/pull/headerB6?brush_name=test'
)
if
r
.
json
()[
'status'
]
!=
0
:
logger
.
debug
(
f
'不需要刷值'
)
continue
logger
.
debug
(
'开始刷值'
)
selectId
=
random
.
choice
(
list
(
envs
))
lastHash
=
''
usedTime
=
10
success
=
0
total
=
0
selectId
=
random
.
choice
(
list
(
envs
))
code
=
open
(
'src.js'
,
'r'
,
encoding
=
'utf-8'
)
.
read
()
code1
=
open
(
'js_dom_run.js'
,
'r'
,
encoding
=
'utf-8'
)
.
read
()
for
i
in
range
(
100
):
try
:
# selectId = '55a8fe24a752595e774341d6'
proxy
=
f
'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
# proxy = f'http://ynfflcc2023.hotmail.com:gdcfh9@69.30.227.194:{random.randint(20001, 20250)}'
# proxy = f'http://user-uni003-region-us-sessid-${random.randint(1000,5000)}-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@198.147.25.26:{int(random.randint(10000, 11149))}'
# proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
r
=
requests
.
post
(
uri
,
json
=
{
'brush_fromto'
:
'LAS-BOS'
,
'brush_fromdate'
:
'2023-05-26'
,
'brush_header'
:
headers
,
'brush_proxy'
:
proxy
,
'brush_mode'
:
'shopping'
,
'brush_name'
:
'js2'
,
'brush_type'
:
'headerB6'
,
})
success
+=
1
logger
.
success
(
f
'添加成功 {success}'
)
# time.sleep(3)
except
Exception
as
e
:
print
(
e
)
# if platform.uname().system == 'Darwin':
# proxy = 'http://127.0.0.1:7890'
tlsV
=
f
'chrome_{random.randint(105, 113)}'
tlsV
=
'chrome_112'
session
=
tls_client
.
Session
(
tlsV
)
session
.
proxies
=
{
'http'
:
proxy
,
'https'
:
proxy
,
}
# selectId = 'a74b38e7115cf4d1b1f6976c'
c
=
session
.
get
(
'https://www.jetblue.com/js/src/jb-74873.js'
,
insecure_skip_verify
=
True
)
.
text
m5
=
md5
(
c
)
if
m5
!=
lastHash
and
usedTime
>
5
:
lastHash
=
m5
usedTime
=
0
logger
.
debug
(
'js变化'
)
token
=
re
.
findall
(
'nt"
\
),
\
["(.+?)",'
,
c
)[
0
]
db
.
token_shape
.
insert_one
({
'_id'
:
token
,
'update_time'
:
int
(
time
.
time
()
*
1000
)
})
code
=
open
(
'src.js'
,
'r'
,
encoding
=
'utf-8'
)
.
read
()
code1
=
open
(
'js_dom_run.js'
,
'r'
,
encoding
=
'utf-8'
)
.
read
()
with
open
(
'src_run1.js'
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
f
.
write
(
code
+
'
\n\n
'
+
c
)
# # with open('js_dom_run1.js', 'w', encoding='utf-8') as f:
# # f.write(code1 + '\n\n' + c)`
t1
=
time
.
time
()
token
=
list
(
db
.
token_shape
.
aggregate
(
[
{
'$sample'
:
{
'size'
:
1
}
}
]
))[
0
][
'_id'
]
# r = requests.get('http://127.0.0.1:5000/getinfo').json()['message']
# r = requests.get('http://127.0.0.1:3001').json()
# p = subprocess.Popen(['node', 'js_dom_run.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_chrome_105.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_company_chrome.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p
=
subprocess
.
Popen
([
'node'
,
'src_run1.js'
,
selectId
,
'11'
,
token
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
output
,
err
=
p
.
communicate
(
timeout
=
10
)
tmp
=
''
if
p
.
returncode
==
0
:
tmp
=
output
.
decode
()
.
split
(
'
\n
'
)[
-
2
]
else
:
raise
Exception
(
selectId
)
r
=
json
.
loads
(
tmp
)
# res = db.env_shape.update_one(
# {'_id': ObjectId(selectId)},
# {"$inc": {"used": 1}}
# )
usedTime
+=
1
headers
.
update
(
r
)
# headers = r
logger
.
info
(
f
"success:{success} total:{total} {(time.time() - t1) *1000:.3f}ms {len(headers['X-1ItxWO9i-a'.lower()])} {selectId} {headers['user-agent']}"
)
logger
.
info
(
f
"success:{success} proxy: {proxy} token: {token}"
)
url
=
"https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
data
=
{
"tripType"
:
"oneWay"
,
"from"
:
"LAS"
,
"to"
:
"BOS"
,
"depart"
:
"2023-05-10"
,
"cabin"
:
"economy"
,
"refundable"
:
False
,
"dates"
:
{
"before"
:
"3"
,
"after"
:
"3"
},
"pax"
:
{
"ADT"
:
1
,
"CHD"
:
0
,
"INF"
:
0
,
"UNN"
:
0
},
"redempoint"
:
False
,
"pointsBreakup"
:
{
"option"
:
""
,
"value"
:
0
},
"isMultiCity"
:
False
,
"isDomestic"
:
False
}
#
# # session = requests.Session()
#
response
=
session
.
post
(
url
,
headers
=
headers
,
json
=
data
,
insecure_skip_verify
=
True
)
logger
.
info
(
f
'tls:{tlsV} proxy:{proxy} res:: {response.status_code}'
)
# total += 1
# # print(response.text)
if
response
.
status_code
!=
403
:
res
=
db
.
env_shape
.
update_one
(
{
'_id'
:
ObjectId
(
selectId
)},
{
"$inc"
:
{
"success"
:
1
}}
)
# proxy = requests.post('http://ymx-lcc.unififi.com/proxy/get-proxy', json={
# 'type':'headerB6'
# })
print
(
headers
)
uri
=
'http://ymx-lcc.unififi.com/header/add'
# uri = 'http://52.52.23.116/header/add'
# proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
# proxy = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:10042'
# proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
r
=
requests
.
post
(
uri
,
json
=
{
'brush_fromto'
:
'LAS-BOS'
,
'brush_fromdate'
:
'2023-05-26'
,
'brush_header'
:
headers
,
'brush_proxy'
:
proxy
,
'brush_mode'
:
'shopping'
,
'brush_name'
:
'js2'
,
'brush_type'
:
'headerB6'
,
})
success
+=
1
logger
.
success
(
f
'添加成功 {success}'
)
# time.sleep(3)
except
Exception
as
e
:
print
(
e
)
time
.
sleep
(
10
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment