Commit 75a6be56 authored by wang's avatar wang

111

parent 6ff2176d
This diff is collapsed.
......@@ -4,9 +4,12 @@ import re
import subprocess
import time
import bson
import loguru
import requests
import json
import tls_client
# import tls_client
from bson import ObjectId
import hashlib
......@@ -15,6 +18,7 @@ from loguru import logger
def get_random_location():
return ''
t1 = '''var _hostname, _origin,_host,_protocol,_port,_pathname,_search,_hash;
Object.defineProperties(location, {'''
......@@ -130,14 +134,18 @@ def md5(text):
client = MongoClient('mongodb://lcc-spider:JIUsfhiad&^@18.144.59.80:27017/?authSource=admin&directConnection=true')
db = client.env
# 查询所有文档
# result = db.env_shape.find({'env.funcs' :{'$ne': None}})
# data = {str(x['_id']): x['env'] for x in result}
# print(result)
# result = db.env_shape.find({'_id':bson.ObjectId('7200df020739d51726fb6c49')})
# result = db.env_shape.find({'_id':bson.ObjectId('410cf20960c6a7487b38a8ad')})
# result = db.env_shape.find({'env.funcs': {'$ne': None}})
# data = {}
# for x in result:
# if '₹' in x['env']['fontsres']['1000px monospace']:
# data[str(x['_id'])] = x['env']
# with open('env.json', 'w', encoding='utf-8') as f:
# f.write(json.dumps(data))
with open('env.json', 'r', encoding='utf-8') as f:
data = json.loads(f.read())
envs = data.keys()
envs = list(data.keys())
# session = requests.session()
......@@ -174,14 +182,14 @@ while True:
# continue
logger.debug('开始刷值')
lastHash = ''
usedTime = 10
usedTime = 20
code = open('src.js', 'r', encoding='utf-8').read()
code1 = open('js_dom_run.js', 'r', encoding='utf-8').read()
for i in range(30):
try:
# selectId = '55a8fe24a752595e774341d6'
selectId = random.choice(list(envs))
selectId = envs.pop()
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)}'
......@@ -200,8 +208,9 @@ while True:
# proxy = random.choice([proxy, proxy1])
tlsV = f'chrome_{random.randint(105, 113)}'
tlsV = 'chrome_112'
# session = tls_client.Session(tlsV)
session = requests.S
session = tls_client.Session(tlsV)
session.verify = False
# session = requests.Session()
session.proxies = {
'http': proxy,
'https': proxy,
......@@ -214,8 +223,7 @@ while True:
# selectId = 'a74b38e7115cf4d1b1f6976c'
if usedTime > 10:
c = session.get('https://www.southwest.com/assets/app/scripts/swa-common.js',
insecure_skip_verify=True).text
c = session.get('https://www.southwest.com/assets/app/scripts/swa-common.js').text
usedTime = 0
logger.debug('js变化')
token = re.findall('nt"\),\["(.+?)",', c)[0]
......@@ -254,7 +262,7 @@ while True:
print(r)
headers.update(r)
# headers = r
logger.info(f"success:{success} total:{total} {(time.time() - t1) *1000:.3f}ms {len(headers['EE30zvQLWf-a'])} {selectId} {headers['user-agent']}")
logger.info(f"success:{success} total:{total} {(time.time() - t1) *1000:.3f}ms {len(headers['ee30zvqlwf-a'])} {selectId} {headers['user-agent']}")
logger.info(f"success:{success} proxy: {proxy} token: {token}")
url = "https://www.southwest.com/api/air-booking/v1/air-booking/page/air/booking/shopping"
data = {
......@@ -291,10 +299,10 @@ while True:
total += 1
print(response.text)
if status_code != 403:
# res = db.env_shape.update_one(
# {'_id': ObjectId(selectId)},
# {"$inc": {"success": 1}}
# )
res = db.env_shape.update_one(
{'_id': ObjectId(selectId)},
{"$inc": {"success1": 1}}
)
# proxy = requests.post('http://ymx-lcc.unififi.com/proxy/get-proxy', json={
# 'type':'headerB6'
# })
......
This diff is collapsed.
......@@ -30,6 +30,7 @@
"isolated-vm": "^4.6.0",
"nwsapi": "^2.2.0",
"parse5": "6.0.1",
"pm2": "^5.3.0",
"saxes": "^5.0.1",
"superpack": "^2.3.0",
"symbol-tree": "^3.2.4",
......
const pm2 = require('pm2')
pm2.connect(function (err) {
if (err) {
console.error(err)
process.exit(2)
}
pm2.start({
script: 'src_run.js',
name: 'wn',
autorestart: false,
}, function (err, apps) {
if (err) {
console.error(err)
return pm2.disconnect()
}
setTimeout(function () {
pm2.describe(apps[0].pm_id, function (err, datas){
console.log(datas)
})
}, 1000)
// pm2.list((err, list) => {
// console.log(err, list)
//
// pm2.restart('wn', (err, proc) => {
// // Disconnects from PM2
// pm2.disconnect()
// })
// })
})
})
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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