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
8269e494
Commit
8269e494
authored
Oct 28, 2023
by
wangmingming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
请求造纸
parent
251e271d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
33 deletions
+38
-33
jetblue.py
jetblue.py
+38
-33
No files found.
jetblue.py
View file @
8269e494
...
@@ -14,13 +14,12 @@ from pymongo import MongoClient
...
@@ -14,13 +14,12 @@ from pymongo import MongoClient
from
loguru
import
logger
from
loguru
import
logger
def
md5
(
text
):
def
md5
(
text
):
m
=
hashlib
.
md5
()
m
=
hashlib
.
md5
()
m
.
update
(
text
.
encode
())
m
.
update
(
text
.
encode
())
return
m
.
hexdigest
()
return
m
.
hexdigest
()
# 连接MongoDB数据库
# 连接MongoDB数据库
client
=
MongoClient
(
'mongodb://lcc-spider:JIUsfhiad&^@18.144.59.80:27017/?authSource=admin&directConnection=true'
)
client
=
MongoClient
(
'mongodb://lcc-spider:JIUsfhiad&^@18.144.59.80:27017/?authSource=admin&directConnection=true'
)
db
=
client
.
env
db
=
client
.
env
...
@@ -28,7 +27,7 @@ db = client.env
...
@@ -28,7 +27,7 @@ db = client.env
if
platform
.
uname
()
.
system
!=
'Darwin'
:
if
platform
.
uname
()
.
system
!=
'Darwin'
:
# , 'success': {'$gte': 30}
# , 'success': {'$gte': 30}
# , 'env.navigatorparams.useragent': {'$regex': 'iPhone'}}
# , 'env.navigatorparams.useragent': {'$regex': 'iPhone'}}
result
=
db
.
env_shape
.
find
({
'env.funcs'
:
{
'$ne'
:
None
}})
result
=
db
.
env_shape
.
find
({
'env.funcs'
:
{
'$ne'
:
None
}})
data
=
{
str
(
x
[
'_id'
]):
x
[
'env'
]
for
x
in
result
}
data
=
{
str
(
x
[
'_id'
]):
x
[
'env'
]
for
x
in
result
}
print
(
result
)
print
(
result
)
with
open
(
'env.json'
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
with
open
(
'env.json'
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
...
@@ -53,11 +52,11 @@ headers = {
...
@@ -53,11 +52,11 @@ headers = {
}
}
# tlss = [ 'chrome_103', 'chrome_104', 'chrome_105', 'chrome_106',
# tlss = [ 'chrome_103', 'chrome_104', 'chrome_105', 'chrome_106',
# 'firefox_102', 'firefox_104'
# 'firefox_102', 'firefox_104'
# Opera --> opera_89, opera_90
# Opera --> opera_89, opera_90
# 'safari_15_3', 'safari_15_6_1', 'safari_16_0',
# 'safari_15_3', 'safari_15_6_1', 'safari_16_0',
# 'safari_ios_15_5', 'safari_ios_15_6', 'safari_ios_16_0',
# 'safari_ios_15_5', 'safari_ios_15_6', 'safari_ios_16_0',
# 'safari_ios_15_6'
# 'safari_ios_15_6'
# ]
# ]
success
=
0
success
=
0
total
=
0
total
=
0
...
@@ -78,8 +77,11 @@ while True:
...
@@ -78,8 +77,11 @@ while True:
try
:
try
:
# selectId = '55a8fe24a752595e774341d6'
# selectId = '55a8fe24a752595e774341d6'
proxy
=
f
'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
proxy
=
f
'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
proxy
=
random
.
choice
([
'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000'
,
proxy
])
proxy
=
random
.
choice
(
proxy
=
requests
.
post
(
'http://ymx-lcc.unififi.com/proxy/get-proxy'
,
json
=
{
'name'
:
"B6"
,
'type'
:
'shopping'
})
.
json
()[
'url'
]
[
'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000'
,
proxy
])
proxy
=
\
requests
.
post
(
'http://ymx-lcc.unififi.com/proxy/get-proxy'
,
json
=
{
'name'
:
"B6"
,
'type'
:
'shopping'
})
.
json
()[
'url'
]
# proxy = f'http://ynfflcc2023.hotmail.com:gdcfh9@69.30.227.194:{random.randint(20001, 20250)}'
# 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://user-uni003-region-us-sessid-${random.randint(1000,5000)}-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
...
@@ -98,7 +100,6 @@ while True:
...
@@ -98,7 +100,6 @@ while True:
'https'
:
'http://127.0.0.1:7890'
,
'https'
:
'http://127.0.0.1:7890'
,
}
}
selectId
=
random
.
choice
(
list
(
envs
))
selectId
=
random
.
choice
(
list
(
envs
))
# selectId = 'a74b38e7115cf4d1b1f6976c'
# selectId = 'a74b38e7115cf4d1b1f6976c'
...
@@ -132,15 +133,18 @@ while True:
...
@@ -132,15 +133,18 @@ while True:
# _process.exit(0)
# _process.exit(0)
# '''
# '''
)
)
code1
=
open
(
'js_dom_run.js'
,
'r'
)
.
read
()
code1
=
open
(
'js_dom_run.js'
,
'r'
)
.
read
()
with
open
(
'js_dom_run1.js'
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
with
open
(
'js_dom_run1.js'
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
f
.
write
(
code1
+
'
\n\n
'
+
c
)
f
.
write
(
code1
+
'
\n\n
'
+
c
)
t1
=
time
.
time
()
t1
=
time
.
time
()
token
=
list
(
db
.
token_shape
.
aggregate
(
[
{
'$match'
:
{
'update_time'
:{
'$gte'
:
int
(
time
.
time
()
*
1000
)
-
60
*
60
*
12
}}},
{
'$sample'
:
{
'size'
:
1
}
}
]
))[
0
][
'_id'
]
token
=
list
(
db
.
token_shape
.
aggregate
(
[{
'$match'
:
{
'update_time'
:
{
'$gte'
:
int
(
time
.
time
()
*
1000
)
-
60
*
60
*
12
}}},
{
'$sample'
:
{
'size'
:
1
}}]))[
0
][
'_id'
]
# token = '11'
# token = '11'
# r = requests.get('http://127.0.0.1:5000/getinfo').json()['message']
# r = requests.get('http://127.0.0.1:5000/getinfo').json()['message']
# r = requests.get('http://127.0.0.1:3001').json()
# r = requests.get('http://127.0.0.1:3001').json()
p
=
subprocess
.
Popen
([
'node'
,
'js_dom_run1.js'
,
selectId
,
'11'
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
p
=
subprocess
.
Popen
([
'node'
,
'js_dom_run1.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_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_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,
# p = subprocess.Popen(['node', 'src_run1.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
...
@@ -160,7 +164,8 @@ while True:
...
@@ -160,7 +164,8 @@ while True:
headers
.
update
(
r
)
headers
.
update
(
r
)
# headers = 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} 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}"
)
logger
.
info
(
f
"success:{success} proxy: {proxy} token: {token}"
)
url
=
"https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
url
=
"https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
...
...
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