Commit 45b90032 by zhangxujie

1

parents
This diff is collapsed. Click to expand it.
import execjs
import requests
import re
url="https://36kr.com/user/5452796"
re_one = requests.get(url=url).text
print(re_one)
arg1=re.findall("(?<=var arg1=')\w+",re_one)[0]
new_cookie=execjs.compile(open(r"雪球热点话题.js").read()).call('getAcwScV2', arg1)
cookies = {
'acw_sc__v2': new_cookie,
}
print(cookies)
# response= requests.get(url=url,cookies=cookies)
# print(response.text)
const CryptoJS = require("crypto-js");
var reqtranceno = function() {
var e = (new Date).getTime();
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (function(n) {
var t = (e + 16 * Math.random()) % 16 | 0;
return e = Math.floor(e / 16),
("x" === n ? t : 7 & t | 8).toString(16)
}
))
};
var main = function() {
var arguments = {
"0": {
"authType": "SHA1_1",
"coordinate": "168.49679,28.82855",
"custString": "1.36",
"machineNo": "864375028810514",
"msgVersion": "3.6.1",
"platform": "ios",
"reqAppId": "ios_app_wanlitong",
"screenSize": "960*480",
"saleSort": "",
"timeSort": "",
"priceSort": "",
"pageNo": 11,
"parentCatalogId": "",
"catalogId": "",
"mgrBrandId": "",
"leafCatalogId": "",
"keywords": "%E6%B2%90%E6%B5%B4%E9%9C%B2",
"kwOrTag": "",
"yqbToken": "",
"sellerMerId": "",
"picAttr": "270_270.webp",
"client": "04",
"repositoryId": "1681",
"pageSize": "10",
"reqtranceno": "23e93430-50b5-4a60-ceb4-21735e8e5f73",
"reqTime": new Date().getTime(),
"mallModeId": "STANDARD",
"sourceAppId": "M",
"mediumId": "YQB",
"reqChannelFlag": "YQB_M"
}
}
var e, n = "09FB84B1-D90E-4C14-84DB-DEE924A87B51", t = "reqTime", r = arguments, a = r[0] || {}, i = r.length > 1 ? r[1] : n, s = [];
for (var c in a)
if (a.hasOwnProperty(c)) {
if (c === t) {
e = a[c];
continue
}
s.push(c)
}
s.sort();
var u = "";
if (e) {
for (var _ in s)
if (s.hasOwnProperty(_)) {
var l = s[_]
, d = 0 === a[l] ? "0" : a[l] ? a[l].toString() : "";
u += d + e.toString()
}
u += i;
var p = CryptoJS.SHA1(u).toString()
return {"sign":p,"time":r[0]["reqTime"]}
}
};
console.log(main())
import execjs
import requests
session = requests.session()
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
import time
from loguru import logger
import requests
headers = {
'authority': 'mapi.wanlitong.com',
'accept': 'application/json',
'accept-language': 'zh-CN,zh;q=0.9',
'cache-control': 'no-cache',
'content-type': 'application/x-www-form-urlencoded',
'machineno': '93388ba69660ffc14b026a348a381827',
'origin': 'https://m.yqb.com',
'pragma': 'no-cache',
'referer': 'https://m.yqb.com/',
'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'cross-site',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
}
data = execjs.compile(open('AllTest.js').read()).call('main')
data = 'authType=SHA1_1&coordinate=168.49679,28.82855&custString=1.36&machineNo=864375028810514&msgVersion=3.6.1&platform=ios&reqAppId=ios_app_wanlitong&screenSize=960*480&saleSort=&timeSort=&priceSort=&pageNo=11&parentCatalogId=&catalogId=&mgrBrandId=&leafCatalogId=&keywords=%25E6%25B2%2590%25E6%25B5%25B4%25E9%259C%25B2&kwOrTag=&yqbToken=&sellerMerId=&picAttr=270_270.webp&client=04&repositoryId=1681&pageSize=10&reqtranceno=23e93430-50b5-4a60-ceb4-21735e8e5f73&reqTime=' + str(data.get('time')) + '&mallModeId=STANDARD&sourceAppId=M&mediumId=YQB&reqChannelFlag=YQB_M&sign=' + data.get('sign')
response = requests.post('https://mapi.wanlitong.com/mobileapi/m2s/product/queryProdList.json', headers=headers, data=data)
print(response.text)
import requests
import re
headers = {
'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': 'zh-CN,zh;q=0.9',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
# 'Cookie': 'HMF_CI=3e8917d56f5be896ad6cb2f3e8ac64268a2039dfc2a4b4f16250504ee7656030ddf9cc899419dbd9ba0392410ba59ac24e5c65361b9342930d019485d165f08ab7; _ebrunUu=1700034257233*266413238*1985748581; _ebrunUv=1700034257240*130686973*52194789; C3VK=60b231',
'Pragma': 'no-cache',
'Referer': 'https://www.ebrun.com/20231115/534418.shtml?eb=dszx_chan_feed',
'Sec-Fetch-Dest': 'document',
'Sec-Fetch-Mode': 'navigate',
'Sec-Fetch-Site': 'same-origin',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36',
'sec-ch-ua': '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
}
params = {
'eb': 'dszx_chan_feed',
}
session = requests.session()
response = session.get('https://www.ebrun.com/20231115/534418.shtml', params=params, headers=headers)
print(response.text)
C3VK = re.findall("(?<=C3VK=)\w+",response.text)[0]
cookies = {
'C3VK': C3VK,
}
cookies.update(response.cookies)
print(cookies)
response_one = session.get('https://www.ebrun.com/20231115/534418.shtml?eb=dszx_chan_feed', params=params, headers=headers,cookies=cookies)
print(response_one.text)
\ No newline at end of file
import requests
import requests
import execjs
import re
import json
from lxml import etree
headers={
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36',
}
cookies={}
url='https://gxq.hefei.gov.cn/wzdt/index.html'
res_first = requests.get(url=url,headers=headers)
cookies.update(res_first.cookies)
cookie_code = res_first.text.replace('<script>document.cookie=','').replace(';location.href=location.pathname+location.search</script>','')
cookies['__jsl_clearance_s'] = execjs.eval(cookie_code).split(';')[0].split("=")[1]
res_sec = requests.get(url=url,headers=headers,cookies=cookies).text
# print(res_sec)
cs = re.findall('\{"bts.*?\}',res_sec)[0]
cs = json.loads(cs)
jiami= re.findall('"ha":".*?"',res_sec)[0].replace('"ha":"','').replace('"','')
print(cs)
if jiami=='sha256':
jsl_clearance_s = execjs.compile(open('中华人民共和国公安部_sha256.js',encoding='utf-8').read()).call('go',cs)
elif jiami=='md5':
jsl_clearance_s = execjs.compile(open('中华人民共和国公安部_md5.js',encoding='utf-8').read()).call('go',cs)
elif jiami=='sha1':
jsl_clearance_s = execjs.compile(open('中华人民共和国公安部_sha1.js',encoding='utf-8').read()).call('go',cs)
print(jsl_clearance_s)
cookies['__jsl_clearance_s']=jsl_clearance_s
res_thr = requests.get(url=url,headers=headers,cookies=cookies)
res_thr.encoding='GB2312'
title= etree.HTML(res_thr.text).xpath("//title/text()")[0]
print(title)
var Q = '/WZWSRELw=='
var Q = '/WZWSRELw=='
, M = 'opEJA>vVLiY5S'
, t = '1884'
function g7(C, d) {
return C < d;
}
function y(M,t) {
u = 0
A = ['5', '2', '0', '1', '4', '3']
while (!![]) {
switch (A[u++]) {
case '0':
for (k = 0x1 * 0x21ad + 0x1 * -0x3cd + -0x20 * 0xef; g7(k, M['lengt' + 'h']); k++) {
P += M["charC" + 'odeAt'](k);
}
continue;
case '1':
P *= t;
continue;
case '2':
var k = 0x258f + 0x2 * 0x125f + 0x4a4d * -0x1;
continue;
case '3':
return 'WZWS_CONFIRM_PREFIX_LABEL' + P;
case '4':
P += -0x1 * 0x2317d + -0x1 * 0x1a622 + 0x589a6 * 0x1;
continue;
case '5':
var P = -0xa * 0x3ca + -0x1668 + 0x22 * 0x1c6;
continue;
}
break;
}
}
console.log(y(M,t))
\ No newline at end of file
import execjs
import execjs
import requests
import re
import base64
headers = {
'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': 'zh-CN,zh;q=0.9',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
# Requests sorts cookies= alphabetically
# 'Cookie': 'wzws_sessionid=gDExNS4yMzEuMjE0LjIzNII3NGNmNDGBZTNmODEwoGUnZIs=; wzws_cid=8de91c63aa3b559f5a4b85ce2f9a25a1a4c9d4929b64886f22023158fdd59308eec35f006f1677357fedf8d21ba92d382a42b6efa91cd6a82f866f252b4135727de4175be7865786c895c866afb3ef7acefd16b344e0ea78d94206dd0423fe57',
'Pragma': 'no-cache',
'Referer': 'http://www.pbc.gov.cn/',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
}
cookies={}
url='http://www.pbc.gov.cn/goutongjiaoliu/113456/113469/5084347/index.html'
res = requests.get(url=url,headers=headers)
cookies.update(res.cookies)
print(cookies)
a = re.findall("(?<=var Q=').*?(?=')" ,res.text)[0]
M = re.findall("(?<=M=').*?(?=')" ,res.text)[0]
t = re.findall("(?<=t=').*?(?=')" ,res.text)[0]
sgin = execjs.compile(open('中国人民银行.js').read()).call('y',M,t)
base_sgin = str(base64.b64encode(sgin.encode('utf-8')),'utf-8')
url_sgin = 'http://www.pbc.gov.cn'+a+'?wzwschallenge='+base_sgin
res_one = requests.get(url=url_sgin,headers=headers,cookies=cookies, allow_redirects= False)
cookies.update(res_one.cookies)
print(url_sgin)
res_two = requests.get(url=url,headers=headers,cookies=cookies)
print(res_two.text)
# res =requests.post(url=url,headers=headers)
# print(res.text)
# res_one =requests.post(url=url,headers=headers)
# print(res_one.text)
const CryptoJS = require("crypto-js");
const CryptoJS = require("crypto-js");
var wordtext="GJmlTpQ0OTCDocWgEOQE9NT1si4FI0lgUQ11nhp_lUwS_wvL3zWif4UmCHD2pQWGDAsKqYnG9_lY\\n24FQSTrtln4pzGopSbWwIxT7w+HqELJWTR0zrcFhqMKDQGxkky30I8rkweX0l5Sgmu6fOY4RbzHg\\nDVCB8euIOsvxL_a3HBWa62ZPqtsuv6XHuNLomQOaPVvo0LKdahHSufAGc_YOzNy6iRfGiqnHj2DE\\nsz8MWrIP42o0lxMwzfe6f+k1JUqGSGrTVO+esjAzoXT6ckg79+OzVjJK3m9fHNCTo+_gReTQzt1T\\no7uGFagblFG63Ini5xrlRbZ8efN4WB1YV2OYrYHrrCBKB2VYkWWzt+NSYwE_7oWuFAEKtX8ZWwW2\\nU6xSZMACOCmkLaZ5ZYVmXGI5_dP59Is5RW+GKJEnWc38GNN8a3uKEfVm1SlCnPWM_wkz5T07g+Yh\\nhhGdJBSxk38b1UFCkKCr5ldsMuW0gfNU90k5mQsiH96dPVCGCov_ZWIC3B0CYCyYx_zEpiaZlZMR\\nqurU0p4nu4e7Z7XqKMmPuVkpr_ygzjn+D6081Ilpf+yHiofWJHMW7HYkmnUTtQbCHiCJM5zdxWXE\\nWokyM+0tI2KwKlt6lx13GSHG9dIvnsAyX2G16rJ39Xwg13YS7HiRV8fyCr3LvgxL+jHw7aZQ29p6\\nLiMPeIFKNGr2OUwknqUbDbVU9afp2BvCXpyAFqy+_s_v3hxj++7DL_10yICHQtXlXkyqzgNBpXxa\\no4TTMxPIc36NrypScCGKf7qtwq+MZyobjf_wplPoyDFMrF2_xR_qu9VpQVKLnoxdQyxnpm3n4FMI\\n+ojBPYBLhpP8t7Yyw1N53iYY0wWqsjXoBcV5L91knWMumIrxzuQsuMxJr0JNuBJDlgMxhNY9HSK1\\ncsrjIyXXKNbtZREe28VsyZ8M9NJDW4ky7sDfijE7jrbxagVHwcZzBck1imH6lSk7A8Cysc7sYib1\\nEWuOgHH0W81ylkIHGWMnZ3kFUUZpQRkghuJJLALGYJ0aN9F5CCs8AGMHvfxhYqLygXfqswZrwZiU\\neP6Lnd7DdgWPnci_POj5wwvsgyE+RQO2cR0gn29WF7nKlhSsv7LPKtlpDfA0YnEUBSS4aeXjGp6Z\\nR5a9mt2JaNHxdOlBUBvfn7Wp_7qP7FTfhb5J84D6JhsjjoxDCmf38G0kJ82HMKABT0qMD29iJQA1\\n3TD9Aqv40_BPjFJhZqFoluCnoOw_x7Nhvyg_jm0gOiwa1A9BZGMtiQw2Qf8RMGpsIYIFN241IgRX\\nGgdk566V1W2gpeA_9d_Zc1b73iJdKKE3CceikuxJISkF5ACV4HYb4QYsFfRXL04wsb+eKxrrWgC4\\n+hxUgAhWFskC6Mz+jHOvXdRZDXjDXEU+Y4e_K4WF4cVMbYxhXa81BsdksFMd_eAiuxNR+DYCuNAh\\ngfAcQNSDC4y4FSpZTHNF4cGmftfbPiQ8BiqklJeu+XgrX1q+9t3EqKzeIX2ostk35j_blHkVi22R\\nhLL1xNp97e+r+3HawFAFI2fkqpuhrLjrSAhhfbxqYz7UMYIFe+w5qHEmPISB1smVtaVgT+QDn048\\nyV6Ar_UrzKm1ft+EDerRJqYoKH3Cg1H+0ljcgxj0K_fS_9E6PXPJhep9UxLLrx6jbwP1E+NvNr5R\\nUHICupGk9ImcI51AMFJ_KtMYXv18142NigcAUlr7xpv6r8kuuFJX+xdTheiFJVfe0i1PZfx_0Qom\\n13srHN_PlFw5+s1eAOVODoe5hL4RooDGtjSUIfnJKxsFgdtDYxCcImnebhwxT6K2lpudirn9yFnI\\n21raR_QJL6NANNu6aWk0YjZL7hYL5cz7EZS4BvKUFNXqWWDDwm8+mBPevVw13buLuzM_nDcQhiTC\\nn6QwHQk_F1H4dMv7+ifGp6BF9Z8Wduq7KQM6EhhpdjdC3erDMQ4eiSqWVy0BClgXs_eHX1lXK8u0\\nn5mxSu8fTH3EVro30ismuQUvwx6trg+aCorAxVkD1BpQ8Q5OAgrkFlFYTtmxl_o3g4dkqZ5TV2JF\\nV+NGr_ceown13Z14AAnL+wvTs1rHk3I4BrKIDD9qfhWn_65CUj689i2VaXkEWpmjPnTbNBv3T7H2\\nofXtHpIW7HnK4QGcDMK+V+N4n9LTYVpibvSrAVA7n0Xx4jCyMwo_2EvYOV75v77gGo1G8A=="
var keyby = CryptoJS.enc.Utf8.parse("QaZB7ddSo0bedGhW");
var ivby = CryptoJS.enc.Utf8.parse("EKK+ya_uO3K6KOa1");
const AesDecode = function (word,key,iv) {
let encryptedHexStr = CryptoJS.enc.Base64.parse(word);
let srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
let decrypt = CryptoJS.AES.decrypt(srcs, key, {iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7});
let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
return decryptedStr.toString();
};
// return AesDecode($input.replace(/_/g, "/").replace(/\\n/g,''),keyby,ivby);
console.log(AesDecode(wordtext.replace(/_/g, "/").replace(/\\n/g,''),keyby,ivby))
// function aesencrypt(text,key,iv){
// return CryptoJS.AES.encrypt(text,CryptoJS.enc.Utf8.parse(key),{
// iv:CryptoJS.enc.Utf8.parse(iv),
// mode:CryptoJS.mode.CBC,
// padding:CryptoJS.pad.Pkcs7
// }).toString().replace(/\//g, "_")
// };
//
// // return aesencrypt($Ctx.get('$cur.t'),"QaZB7ddSo0bedGhW",$Ctx.get('$cur.iv'));
// var t = Math.random().toString(36).slice(-8) + "-" + Math.random().toString(36).slice(-8) + (new Date).getTime();
// var e = aesencrypt(t, "E08247708934F42E", "0A234C4C639E015D").replace("_", "");
// var iv = e.substring(1, 17);
//
// var text='{"uuid":"8319491f-ab1f-47ec-a506-3216a77d17ad","url":"http://news.pxnews.cn/content/6_126129.html","cid":"ooayhny5","_":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36|ooayhny5","common":{"isPost":false,"postBody":"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36","platform":"Win32","language":"zh-CN","languages":"zh-CN,zh","timeZone":"Asia/Shanghai","tabId":"20yglp3ip9","referrer":"http://news.pxnews.cn/content/6_126129.html","isReload":true,"docType":"<!DOCTYPE html>","screenWidth":1920,"screenHeight":1080,"windowWidth":155,"windowHeight":930,"isMobile":false,"urlPrefix":"http://news.pxnews.cn/1ywuKELSO2ahQuWZ/pr/0","cookies":null,"zoomFactor":1},"extension":{"reuse":false,"simMode":false}}'
// console.log(aesencrypt(text,"QaZB7ddSo0bedGhW","C6lHN+UCatV3cEEY"))
const CryptoJS = require("crypto-js");
const CryptoJS = require("crypto-js");
function randomWord(e, t, n) {
var r = ""
, i = t
, o = ""
, a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
e && (i = Math.round(Math.random() * (n - t)) + t);
for (var s = 0; s < i; s++)
o = Math.round(Math.random() * (a.length - 1)),
r += a[o];
return r
}
function get_token() {
var n = '63f428d9da5cc0e6d43760f78fb1b425';
var r = randomWord(!1, 36);
var o = new Date().toISOString();
var a = CryptoJS.MD5((new Date).getTime() + "deviceID").toString();
var srcKey = CryptoJS.SHA1(n + r + o + '1.0' + a + '2').toString();
return {
'tenant': n,
'nonce': r,
'timestamp': o,
'sign': srcKey,
'deviceID': a
}
}
// return get_token()
function get_sign(columns,id,token) {
var n = '63f428d9da5cc0e6d43760f78fb1b425';
var r = randomWord(!1, 36);
var o = new Date().toISOString();
var a = id;
var srcKey = CryptoJS.SHA1(n + r + o + '1.0' + columns +'00'+ a +'2'+token).toString();
return {
'tenant': n,
'nonce': r,
'timestamp': o,
'sign': srcKey,
'deviceID': a
}
}
console.log(get_sign('44458', '18a01d3e6c3a21bfae6ca24cad2a15a4','bad617614b07ddbc06fbcc926350b5d3370e3360cf952d051d0188ad5d13e6e7'))
function randomWord(e, t, n) {
var r = "",
i = t,
o = "",
a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
e && (i = Math.round(Math.random() * (n - t)) + t);
for (var s = 0; s < i; s++) o = Math.round(Math.random() * (a.length - 1)), r += a[o];
return r
}
function get_sign(columns, id, token) {
var n = '16c44f6530970e1270bde08cd9334941';
var r = randomWord(!1, 36);
var o = new Date()
.toISOString();
var a = id;
var srcKey = CryptoJS.SHA1(n + r + o + '1.0' + columns + a + '2' + token)
.toString();
return {
'tenant': n,
'nonce': r,
'timestamp': o,
'sign': srcKey,
'deviceID': a
}
}
return get_sign($Ctx.get('$pre.columnID'), $Ctx.get('$pre.deviceID'), $Ctx.get('$cur.authtoken'))
#coding=utf-8
#coding=utf-8
import execjs
import requests
sign = execjs.compile(open('中国财经报.js').read()).call('get_token')
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36',
'nonce': sign['nonce'],
'tenant': sign['tenant'],
'timestamp': sign['timestamp'],
'version': '1.0'
}
json_data = {
'sid': 'zgcjb',
'deviceID': sign['deviceID'],
'source': 2,
'sign': sign['sign'],
}
response = requests.post('https://h5.newaircloud.com/api/getAppToken', headers=headers, json=json_data)
authtoken = response.json().get('authtoken')
columns = '44459'
id=sign['deviceID']
next_sign = execjs.compile(open('中国财经报.js').read()).call('get_sign',columns,id,authtoken)
print(next_sign)
headers = {
'authtoken': authtoken,
'nonce': next_sign['nonce'],
'tenant': next_sign['tenant'],
'timestamp': next_sign['timestamp'],
'version': '1.0'
}
url='https://h5.newaircloud.com/api/getArticlesDy?deviceID='+id +'&source=2&sign='+next_sign['sign']+'&sid=zgcjb&cid='+columns+'&lastFileID=0&rowNumber=0'
response = requests.get(url=url, headers=headers)
print(response.json())
const CryptoJS = require("crypto-js");
const CryptoJS = require("crypto-js");
var hash = {
'md5': function(a){return CryptoJS.MD5(a).toString()},
'sha1': function(a){return CryptoJS.SHA1(a).toString()},
'sha256': function(a){return CryptoJS.SHA256(a).toString()}
};
var _0x2228a0 = {
"mLZyz" : function(_0x435347, _0x8098d) {
return _0x435347 < _0x8098d;
},
"DRnYs" : function(_0x4573a2, _0x3855be) {
return _0x4573a2 === _0x3855be;
},
"ZJMqu" : function(_0x3af043, _0x1dbbb7) {
return _0x3af043 - _0x1dbbb7;
},
};
function go(_0x60274b){
var _0x34d7a8 = new Date();
function _0x14e035(_0x56cbce, _0x5e5712) {
var _0x2d0a43 = _0x60274b['chars']['length'];
for (var _0x212ce4 = 0x0; _0x212ce4 < _0x2d0a43; _0x212ce4++) {
for (var _0x8164 = 0x0; _0x2228a0["mLZyz"](_0x8164, _0x2d0a43); _0x8164++) {
var _0x2a7ea9 = _0x5e5712[0] + _0x60274b["chars"]["substr"](_0x212ce4, 1) + _0x60274b["chars"]["substr"](_0x8164, 1) + _0x5e5712[1];
if (hash[_0x60274b['ha']](_0x2a7ea9) === _0x56cbce) {
return [_0x2a7ea9, _0x2228a0["ZJMqu"](new Date(), _0x34d7a8)];
}
}
}
}
var _0x732635 = _0x14e035(_0x60274b['ct'], _0x60274b['bts']);
return _0x732635[0];
}
// a=go(JSON.parse($input));
// return a;
a={"bts":["1684912963.989|0|AfQ","2aX7iABZR1PNfFj6FdzEak%3D"],"chars":"zEcZKcMNTpEQPUkSXIlyGx","ct":"9e7dd340c0931d0310060a1ec47c626b8689b554","ha":"sha1","tn":"__jsl_clearance_s","vt":"3600","wt":"1500"}
console.log(go(a))
import json
import json
import requests
import execjs
import re
from lxml import etree
cookies = {}
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
}
url = "http://www.cb.com.cn/"
resp_first = requests.get(url=url, headers=headers)
# 获取 jsluid_s
cookies.update(resp_first.cookies)
js_clearance = re.findall('cookie=(.*?);location', resp_first.text)[0]
aa_result = execjs.eval(js_clearance).split(';')[0]
# 获取第一次响应生成的 __jsl_clearance_s 参数
cookies['__jsl_clearance_s'] = aa_result.split("=")[1]
resp_second = requests.get(url=url, headers=headers, cookies=cookies)
print(resp_second.text)
dd = re.findall(';go\((.*?)\)</script>', resp_second.text)[0]
print(dd)
# 获取字典内容
params = json.loads(dd)
js_clearance_s = execjs.compile(open('加速乐.js',encoding='utf-8').read()).call('go',params)
# 获取第二次响应生成的 js_clearance_s 参数
print(js_clearance_s)
cookies['__jsl_clearance_s']=js_clearance_s
resp_third = requests.get(url=url, headers=headers, cookies=cookies)
resp_third.encoding = 'utf-8'
print(resp_third.text)
function $ue(e, t) {
function $ue(e, t) {
switch (arguments.length) {
case 1:
return parseInt(Math.random() * e + 1, 10);
case 2:
return parseInt(Math.random() * (t - e + 1) + e, 10);
default:
return 0
}
}
const o2 = "zxcvbnmlkjhgfdsaqwertyuiop0987654321QWERTYUIOPLKJHGFDSAZXCVBNM"
, ere = o2 + "-@#$%^&*+!";
function yr(e=[]) {
return e.map(t=>ere[t]).join("")
}
function tre(e) {
return [...Array(e)].map(()=>o2[$ue(0, 61)]).join("")
}
console.log(tre(16))
\ No newline at end of file
#coding=utf-8
#coding=utf-8
import execjs
import requests
import time
import hashlib
proxies = {
'https': 'http://13586775464~HEAVY~:Zxj13656741895@192.168.0.35:21211',
'http': 'http://13586775464~HEAVY~:Zxj13656741895@192.168.0.35:21211'
}
nonce = execjs.compile(open('广东省公共资源交易平台.js').read()).call('tre',16)
print(nonce)
timestamp = str(int(round(time.time())*1000))
print(timestamp)
signature = nonce + "k8tUyS$m" + "dateType=&openConvert=false&pageNo=1&pageSize=10&projectType=&publishEndTime=&publishStartTime=&secondType=B&siteCode=44&thirdType=&total=229004&type=trading-type" + timestamp
real_signature = hashlib.sha256(signature.encode()).hexdigest()
print(real_signature)
headers = {
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Origin': 'https://ygp.gdzwfw.gov.cn',
'Pragma': 'no-cache',
'Referer': 'https://ygp.gdzwfw.gov.cn/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
'X-Dgi-Req-App': 'ggzy-portal',
'X-Dgi-Req-Nonce': nonce,
'X-Dgi-Req-Signature': real_signature,
'X-Dgi-Req-Timestamp': timestamp,
'sec-ch-ua': '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
}
json_data = {
'type': 'trading-type',
'publishStartTime': '',
'publishEndTime': '',
'siteCode': '44',
'secondType': 'B',
'projectType': '',
'thirdType': '',
'dateType': '',
'total': 229004,
'pageNo': 1,
'pageSize': 10,
'openConvert': False,
}
response = requests.post('https://ygp.gdzwfw.gov.cn/ggzy-portal/search/v1/items', headers=headers, json=json_data, proxies=proxies)
print(response.text)
import json
import json
import math
import random
import time
import execjs
import requests
def get_uuid():
js = '''
function _uuid(){
var d = (new Date).getTime();
var _ss = "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxxxxxx".replace(/[xy]/g, function(c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == "x" ? r : r & 3 | 8).toString(16)
});
return _ss
};
'''
js = execjs.compile(js)
uuid = js.call('_uuid')
print(uuid)
return uuid
def main():
getUrlData = get_sign()
headers = {
'Host': 'app.qingyangwang.com.cn',
'Connection': 'keep-alive',
'Pragma': 'no-cache',
'Cache-Control': 'no-cache',
'sec-ch-ua': '"Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110"',
'version': '1.0',
'nonce': getUrlData['nonce'],
'sec-ch-ua-mobile': '?0',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36',
'tenant': getUrlData['headers']['tenant'],
'authtoken': getUrlData['authtoken'],
'Accept': 'application/json, text/plain, */*',
'timestamp': getUrlData['headers']['timestamp'],
'sec-ch-ua-platform': '"Windows"',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://app.qingyangwang.com.cn/home/10502_zzqy.html',
'Accept-Language': 'zh-CN,zh;q=0.9',
}
# getUrlData = get_sign().get('getUrlData')
url = f'https://app.qingyangwang.com.cn/api/getSunColumnsDy?sid=zzqy&cid=10502&_={str(time.time() * 1000)}{getUrlData["getUrlData"]}',
response = requests.get(
url=url[0],
headers=headers,
)
print(response.text)
def get_sign():
with open('掌中庆阳.js', encoding='utf-8') as f:
jsdata = f.read()
ctx = execjs.compile(jsdata)
result = ctx.call('getTokenData', 'zzqy', 10502, '')
print(result)
return result
def _uuid():
d = int(time.time() * 1000)
_ss = "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxxxxxx".replace("xy", '')
uuid = ''
for i in _ss:
r = int((d + random.random() * 16) % 16) if (d + random.random() * 16) % 16 else 0
d = math.floor(d / 16)
result = r if i == 'x' else r & 3 + 8
result = hex(result).replace('0x', '')
uuid += str(result)
print(uuid)
return uuid
if __name__ == '__main__':
main()
'''
var _uuid = function() {
var d = (new Date).getTime();
var _ss = "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxxxxxx".replace(/[xy]/g, function(c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == "x" ? r : r & 3 | 8).toString(16)
});
return _ss
};
'''
const CryptoJS = require("crypto-js");
const CryptoJS = require("crypto-js");
function encrypted(message , key){
key = CryptoJS.enc.Utf8.parse(key);
var o = CryptoJS.enc.Utf8.stringify(CryptoJS.enc.Base64.parse(message)),
i = CryptoJS.enc.Hex.parse(o),
realmessage = CryptoJS.enc.Base64.stringify(i);
  const encrypted = CryptoJS.TripleDES.decrypt(realmessage, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
});
return CryptoJS.enc.Utf8.stringify(encrypted); // 返回加密后的字符串
}
function main(api_data,appKey,appSecret,serverTime,beftime){
var a = (new Date).getTime()
// var a = 1704361015951
, r = 0
, u = api_data
, l = {
apiData: u.substring(38, 42) + u.substring(2, 16) + u.substring(31, 33) + u.substring(21, 25),
appKey: appKey,
appSecret: appSecret,
serverTime: serverTime
};
r = serverTime - (beftime + a) / 2
var m = encrypted(l.appKey, l.apiData)
, p = encrypted(l.appSecret, l.apiData)
, A = ((new Date).getTime() + parseInt(r)).toString()
, f = {
appKey: m,
time: A,
sign: CryptoJS.MD5(p + A + p.substring(2, 7)).toString(),
secret: p,
vi: r
};
return f
}
function getsign(vi,secret,authToken,api_data) {
var a = api_data.substring(40, 45) + api_data.substring(5, 21) + api_data.substring(33, 36)
,token = encrypted(authToken, a)
,c = (new Date).getTime() + (null == vi ? 0 : parseInt(vi))
,sign = CryptoJS.MD5(token + secret + c).toString()
return {"token":token,"sign":sign,"time":c}
}
// var api = "MTcwNDM2MTAxNTc1MjE3MDQzNjEwMTU3NTIxNzA0MzYxMDE1NzUy",
// appkey = "MDZjNmIxN2FkYWQzOTcxOTE1MmRhYWRmZGEyYTAxNWVjMjJkZmQwMWU3OTliYzE4YWU0MmRkZDU2ZDEwOWIwNjRhMzdjYTI4NmQzOGQxOGE=",
// sercet = "NDQyMWYxODE5Njk3OTNlM2NjMGYyOGQxZWE0ZDc5NWNlYzgxYzM5OGI1NmYyNzY4NzhmMDk0ZDIzMTViOWNjMTRhMzdjYTI4NmQzOGQxOGE=",
// severtime = 1704361015752,
// bef_time = 1704361015842
// console.log(main(api,appkey,sercet,severtime,bef_time))
// var text1 = "NjNjZDM1NDIxZTAxNWMzMWIxNjViY2YyZGJjYzc3NGRiMmU5ZDI1NzY1ZWIyNjkxOWY5ZGYxMTgzZjM5YjIzYmYzOWNkMmE1MTgwYWFlZjc=",
// key1 = "A0NDcwNDQyNjg3MjMyzMDQ0M"
// console.log(encrypted(text1,key1))
import execjs
import execjs
import requests
session = requests.session()
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
import time
from loguru import logger
'''
获取token前必要的参数
'''
before_time = int(round(time.time() * 1000))
testdata = requests.get("https://api1.fjdaily.com/app_if/authinfo")
api_data = testdata.headers.get("api-data")
appKey = testdata.json().get("data").get("appKey")
appSecret = testdata.json().get("data").get("appSecret")
serverTime = testdata.json().get("data").get("serverTime")
body = execjs.compile(open("新福建.js",encoding='utf-8').read()).call("main",api_data,appKey,appSecret,serverTime,before_time)
print(body)
'''
获取token
'''
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Origin': 'https://share.fjdaily.com',
'Referer': 'https://share.fjdaily.com/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
'auth': 'true'
}
data = {
'appKey': body.get("appKey"),
'time': body.get("time"),
'sign': body.get("sign")
}
response = requests.post('https://api1.fjdaily.com/app_if/auth', headers=headers, data=data)
api_data_token = response.headers.get("api-data")
authToken = response.json().get("data").get("authToken")
print(authToken,api_data_token)
'''
获取sign
'''
sign = execjs.compile(open("新福建.js",encoding='utf-8').read()).call("getsign",body.get("vi"),body.get("secret"),authToken,api_data_token)
print(sign)
'''
最后获取文章内容
'''
headers = {
'Origin': 'https://share.fjdaily.com',
'Referer': 'https://share.fjdaily.com/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
'abc': '1',
'authToken': sign.get("token"),
'sign': sign.get("sign"),
'time': str(sign.get("time")),
}
params = {
'id': '331755',
}
response = requests.get('https://api1.fjdaily.com/app_if/getPaperArticle', params=params, headers=headers)
print(response.json())
\ No newline at end of file
function rawMD5(s) {
function rawMD5(s) {
return rstrMD5(str2rstrUTF8(s))
}
function binlMD5(x, len) {
x[len >> 5] |= 128 << (len % 32);
x[((len + 64) >>> 9 << 4) + 14] = len;
var i;
var olda;
var oldb;
var oldc;
var oldd;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for (i = 0; i < x.length; i += 16) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = md5ff(a, b, c, d, x[i], 7, -680876936);
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
b = md5gg(b, c, d, a, x[i], 20, -373897302);
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
d = md5hh(d, a, b, c, x[i], 11, -358537222);
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
a = md5ii(a, b, c, d, x[i], 6, -198630844);
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
a = safeAdd(a, olda);
b = safeAdd(b, oldb);
c = safeAdd(c, oldc);
d = safeAdd(d, oldd)
}
return [a, b, c, d]
}
function bitRotateLeft(num, cnt) {
return (num << cnt) | (num >>> (32 - cnt))
}
function md5gg(a, b, c, d, x, s, t) {
return md5cmn((b & d) | (c & ~d), a, b, x, s, t)
}
function md5ii(a, b, c, d, x, s, t) {
return md5cmn(c ^ (b | ~d), a, b, x, s, t)
}
function md5hh(a, b, c, d, x, s, t) {
return md5cmn(b ^ c ^ d, a, b, x, s, t)
}
function md5ff(a, b, c, d, x, s, t) {
return md5cmn((b & c) | (~b & d), a, b, x, s, t)
}
function safeAdd(x, y) {
var lsw = (x & 65535) + (y & 65535);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 65535)
}
function md5cmn(q, a, b, x, s, t) {
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)
}
function rstr2binl(input) {
var i;
var output = [];
output[(input.length >> 2) - 1] = undefined;
for (i = 0; i < output.length; i += 1) {
output[i] = 0
}
var length8 = input.length * 8;
for (i = 0; i < length8; i += 8) {
output[i >> 5] |= (input.charCodeAt(i / 8) & 255) << (i % 32)
}
return output
}
function binl2rstr(input) {
var i;
var output = "";
var length32 = input.length * 32;
for (i = 0; i < length32; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 255)
}
return output
}
function str2rstrUTF8(input) {
return unescape(encodeURIComponent(input))
}
function rstrMD5(s) {
return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))
}
function rstr2hex(input) {
var hexTab = "0123456789abcdef";
var output = "";
var x;
var i;
for (i = 0; i < input.length; i += 1) {
x = input.charCodeAt(i);
output += hexTab.charAt((x >>> 4) & 15) + hexTab.charAt(x & 15)
}
return output
}
function hexMD5(s) {
return rstr2hex(rawMD5(s))
}
function md5(string, key, raw) {
if (!key) {
if (!raw) {
return hexMD5(string)
}
return rawMD5(string)
}
if (!raw) {
return hexHMACMD5(key, string)
}
return rawHMACMD5(key, string)
}
function transformT(t) {
t = parseInt(t);
var tBytes = [t & 255, (t & 65280) >> 8, (t & 16711680) >> 16, (t & 4278190080) >> 24];
for (var i = 0; i < tBytes.length; i++) {
tBytes[i] = ((tBytes[i] & 240) ^ 240) | (((tBytes[i] & 15) + 1) & 15)
}
return tBytes[3] | (tBytes[2] << 8) | (tBytes[1] << 16) | (tBytes[0] << 24)
}
function getValidUrl(url) {
// url = (url.indexOf("?") == -1) ? (url + "?AppID=" + jsbcGetAppInfo(appInfo.appSecretId)) : (url + "&AppID=" + jsbcGetAppInfo(appInfo.appSecretId));
// var check = url.substr(url.indexOf("//") + 2);
// check = check.substr(check.indexOf("/"));A
try {
var y = parseInt(new Date().getTime() / 1000)
var tt = transformT(y);
var objStr = "appIdd21ff884cc77487ab4c892a6bfad4a6dplatform41uuiduX6k1u6GiowKnIEouO7rnp3E5OXOHsAh";
var finalString = "CX@#$2Z3C_sv$863&(GB2&8NA_sv@=4%" + "/JwtAuth/GetWebToken?AppID=convergedmedia" + objStr + y;
var hashStr = md5(finalString);
return url + "&TT=" + tt + "&Sign=" + hashStr
} catch (e) {
console.log(e)
return ""
}
}
console.log(getValidUrl("https://api-auth.ha101.cn/JwtAuth/GetWebToken?AppID=convergedmedia"))
uid="uX6k1u6GiowKnIEouO7rnp3E5OXOHsAh"
appId="d21ff884cc77487ab4c892a6bfad4a6d"
\ No newline at end of file
#coding=utf-8
#coding=utf-8
import execjs
import requests
import time
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="gb18030")
proxies = {
'https': 'http://13586775464~HEAVY~:Zxj13656741895@192.168.0.35:21211',
'http': 'http://13586775464~HEAVY~:Zxj13656741895@192.168.0.35:21211'
}
headers = {
'authority': 'api-auth.ha101.cn',
'accept': 'application/json, text/javascript, */*; q=0.01',
'accept-language': 'zh-CN,zh;q=0.9',
'cache-control': 'no-cache',
'origin': 'https://news.ha101.cn',
'pragma': 'no-cache',
'sec-ch-ua': '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
}
json_data = {
'platform': 41,
'uuid': 'uX6k1u6GiowKnIEouO7rnp3E5OXOHsAh',
'appId': 'd21ff884cc77487ab4c892a6bfad4a6d',
}
url=execjs.compile(open('淮安新闻网.js').read()).call('getValidUrl','https://api-auth.ha101.cn/JwtAuth/GetWebToken?AppID=convergedmedia')
response = requests.post(url=url, headers=headers, json=json_data).json()
authorization='Bearer '+response.get('data').get('accessToken')
print(authorization)
headers = {
'authority': 'publish.ha101.cn',
'accept': '*/*',
'accept-language': 'zh-CN,zh;q=0.9',
'authorization': authorization,
'cache-control': 'no-cache',
'origin': 'https://news.ha101.cn',
'pragma': 'no-cache',
'sec-ch-ua': '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
}
params = {
'orderIndex': '0',
'pageSize': '20',
}
response = requests.get('https://publish.ha101.cn/nav/31494?orderIndex=0&pageSize=20', params=params, headers=headers)
print(response.text)
#coding=utf-8
#coding=utf-8
import json
import re
import gevent
from gevent import monkey
from gevent.pool import Pool
monkey.patch_all()
import requests
import pandas as pd
from retrying import retry
import execjs
# from curl_cffi import requests
proxies = {
'https': 'http://13586775464~HEAVY~:Zxj13656741895@192.168.0.35:21211',
'http': 'http://13586775464~HEAVY~:Zxj13656741895@192.168.0.35:21211'
}
name="baidu.com"
s='{"keyword":"'+name+'"}'
data=execjs.compile(open('站长工具ipc备案.js').read()).call('get_return',s)
rd=data[0].split(',')[0]
print(data)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
'key': str(data[0]),
'rd': str(rd),
'token': str(data[2]),
'ts': str(data[1]),
}
json_data = {
'keyword':name
}
response = requests.post('https://icp.chinaz.com/index/api/queryPermit', headers=headers, json=json_data) #impersonate="chrome101"
print(response.text)
'''
js运行后参数是正确的
'''
const CryptoJS = require("crypto-js");
const CryptoJS = require("crypto-js");
function hmacsha256(t, e) {
let i = CryptoJS.enc.Utf8.parse(e);
let s = CryptoJS.enc.Utf8.parse(t);
let n = CryptoJS.HmacSHA256(s, i);
let m = CryptoJS.enc.Base64.stringify(n);
// let m = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(n.toString()));
return m;
}
ttt="GET\nhttps://gdtv-api.gdtv.cn/api/news/v1/news/b439e1e09062bf344ba703463d1a859d\n1681890793894\n"
console.log(hmacsha256(ttt, "dfkcY1c3sfuw0Cii9DWjOUO3iQy2hqlDxyvDXd1oVMxwYAJSgeB6phO8eW1dfuwX"))
import binascii
import binascii
from Crypto.Cipher import AES
import random
from datetime import datetime
import requests
import httpx
import json
mode = AES.MODE_CBC
class AESCipher:
def __init__(self, key, mode, iv):
self.key = key
self.mode = mode
self.iv = iv
def encrypt(self, text):
text = text.encode('utf-8')
cryptor = AES.new(self.key, self.mode, self.iv)
length = 16
count = len(text)
padding = length - (count % length)
text += bytes([padding]) * padding
ciphertext = cryptor.encrypt(text)
return binascii.b2a_base64(ciphertext).rstrip().decode('utf-8')
def decrypt(self, text):
text = binascii.a2b_base64(text.encode('utf-8'))
cryptor = AES.new(self.key, self.mode, self.iv)
plaintext = cryptor.decrypt(text)
padding = plaintext[-1]
if padding < 1 or padding > 16:
return None
plaintext = plaintext[:-padding]
return plaintext.decode('utf-8')
# 解密
# plaintext = cipher.decrypt(ciphertext)
# print(plaintext) # 输出:Hello, world!
def get_iv():
random_str1 = ''.join(random.choice('abcdefghijklmnopqrstuvwxyz0123456789') for _ in range(8))
random_str2 = ''.join(random.choice('abcdefghijklmnopqrstuvwxyz0123456789') for _ in range(8))
timestamp = str(int(datetime.now().timestamp()))
result = random_str1 + "-" + random_str2 + timestamp
key = b'E08247708934F42E'
iv = b'0A234C4C639E015D'
cipher = AESCipher(key, mode, iv)
ciphertext = cipher.encrypt(result).replace("_", "")
my_iv = ciphertext[1:17]
return my_iv
data = '{"uuid":"ec429667-a2f0-4cdf-b1a0-6c39a068916f","url":"https://www.pingxiang.gov.cn/art/2023/6/28/art_322_1242494.html","cid":"ivbvlcwv","_":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36|ivbvlcwv","common":{"isPost":false,"postBody":"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36","platform":"Win32","language":"zh-CN","languages":"zh-CN,zh","timeZone":"Asia/Shanghai","tabId":"dmfhqtxb9f","referrer":"","isReload":true,"docType":"<!DOCTYPE html>","screenWidth":2066,"screenHeight":1162,"windowWidth":537,"windowHeight":1029,"isMobile":false,"urlPrefix":"https://www.pingxiang.gov.cn/1ywuKELSO2ahQuWZ/pr/0","cookies":null,"zoomFactor":124},"extension":{"reuse":false,"simMode":false}}'
new_iv = get_iv()
cipher = AESCipher('QaZB7ddSo0bedGhW'.encode('utf-8'), mode, new_iv.encode('utf-8'))
enc_data = cipher.encrypt(data)
# print(enc_data)
headers = {
'authority': 'www.pingxiang.gov.cn',
'accept': 'application/json, text/javascript, */*; q=0.01',
'accept-language': 'zh-CN,zh;q=0.9',
'cache-control': 'no-cache',
'content-type': 'application/json; charset=UTF-8',
'etag': new_iv,
'fetch-mode': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
'origin': 'https://www.pingxiang.gov.cn',
'pragma': 'no-cache',
'referer': 'https://www.pingxiang.gov.cn/art/2023/6/28/art_322_1242494.html',
'sec-ch-ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
}
json_data = {
'data': enc_data
}
with httpx.Client() as client:
response = client.post('https://www.pingxiang.gov.cn/1ywuKELSO2ahQuWZ/api/v1/sessions', headers=headers,
json=json_data).text
data = json.loads(response).get("data")
print(response)
print(new_iv)
# print(cipher.decrypt(data))
var _0x5e8b26 = '3000176000856006061501533003690027800375'
var _0x5e8b26 = '3000176000856006061501533003690027800375'
var getAcwScV2 = function (arg1) {
String['prototype']['hexXor'] = function(_0x4e08d8) {
var _0x5a5d3b = '';
for (var _0xe89588 = 0x0; _0xe89588 < this['length'] && _0xe89588 < _0x4e08d8['length']; _0xe89588 += 0x2) {
var _0x401af1 = parseInt(this['slice'](_0xe89588, _0xe89588 + 0x2), 0x10);
var _0x105f59 = parseInt(_0x4e08d8['slice'](_0xe89588, _0xe89588 + 0x2), 0x10);
var _0x189e2c = (_0x401af1 ^ _0x105f59)['toString'](0x10);
if (_0x189e2c['length'] === 0x1) {
_0x189e2c = '\x30' + _0x189e2c;
}
_0x5a5d3b += _0x189e2c;
}
return _0x5a5d3b;
}
;
String['prototype']['unsbox'] = function() {
var _0x4b082b = [0xf, 0x23, 0x1d, 0x18, 0x21, 0x10, 0x1, 0x26, 0xa, 0x9, 0x13, 0x1f, 0x28, 0x1b, 0x16, 0x17, 0x19, 0xd, 0x6, 0xb, 0x27, 0x12, 0x14, 0x8, 0xe, 0x15, 0x20, 0x1a, 0x2, 0x1e, 0x7, 0x4, 0x11, 0x5, 0x3, 0x1c, 0x22, 0x25, 0xc, 0x24];
var _0x4da0dc = [];
var _0x12605e = '';
for (var _0x20a7bf = 0x0; _0x20a7bf < this['\x6c\x65\x6e\x67\x74\x68']; _0x20a7bf++) {
var _0x385ee3 = this[_0x20a7bf];
for (var _0x217721 = 0x0; _0x217721 < _0x4b082b['length']; _0x217721++) {
if (_0x4b082b[_0x217721] === _0x20a7bf + 0x1) {
_0x4da0dc[_0x217721] = _0x385ee3;
}
}
}
_0x12605e = _0x4da0dc['\x6a\x6f\x69\x6e']('');
return _0x12605e;
}
;
var _0x23a392 = arg1['unsbox']();
arg2 = _0x23a392['hexXor'](_0x5e8b26);
return arg2
};
//
var arg1 = '2410463826D86A52A5BB43A13A80BAE6C4122A73';
console.log(getAcwScV2(arg1))
\ No newline at end of file
#coding=utf-8
#coding=utf-8
import requests
session = requests.session()
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
import execjs
import re
headers = {
'Accept': '*/*',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Connection': 'keep-alive',
# Requests sorts cookies= alphabetically
# 'Cookie': 'xq_a_token=51d351b43f9ca116112b30f56fbed181c7acbbf4; xqat=51d351b43f9ca116112b30f56fbed181c7acbbf4; xq_r_token=d5c015e44d4eb51cf9fee6298d2cace7b94ba8c8; xq_id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1aWQiOi0xLCJpc3MiOiJ1YyIsImV4cCI6MTY4MTI1OTA1MywiY3RtIjoxNjc4OTU1MDg0MDc2LCJjaWQiOiJkOWQwbjRBWnVwIn0.HUPOJUd0kPYsNqpdlozszdxV1GAbECIZJW-g6BMNYvPvRoefPlqZX4z1jn-nT35x6-tnUh3KigQLFTJS7xiZm2SCoxIHo_IA11Gf1vB119wPYqdYUOH0fRndOHAiLPx_9bSUYuTGKBJlm5o12P43EnWO1fhbYe-Ehblwq_oiSrIyljHDAlIdlQ3cjuucIQnthosR69X0__s18Ou0k8CwbgDRzT08_YOLZcNVL0nEQbQjyX9QIZ4Vd6_eDqoVgrfxGusXi5QO3vqG8PnZNThFd3xSiTwzIBOjFQVWoEWCa2yHi7Dpd7CWPp357GruSyDU3pi870JH9kP2ue2Rn0jvKg; u=481678955137869; Hm_lvt_1db88642e346389874251b5a1eded6e3=1678952561,1678955146; device_id=60db2b35b3a73870c25dbfe7618e9e49; SL_G_WPT_TO=zh-CN; SL_GWPT_Show_Hide_tmp=1; SL_wptGlobTipTmp=1; acw_tc=2760826c16789561546241265e04d3ad39543b6481c7aa9781f0d508836cbc; acw_sc__v2=6412d68cb001b73fae469a3452302b6cbf0ac9ed; Hm_lpvt_1db88642e346389874251b5a1eded6e3=1678956173',
'Referer': 'https://xueqiu.com/today',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest',
'elastic-apm-traceparent': '00-c3ed8e034380cffa56f7c3454ae35342-54beb62cde91fd1d-00',
'sec-ch-ua': '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
}
proxies = {
'https': 'http://13586775464~HEAVY~:Zxj13656741895@192.168.0.35:21211',
'http': 'http://13586775464~HEAVY~:Zxj13656741895@192.168.0.35:21211'
}
url='https://segmentfault.com/a/1190000022183269'
re_one = requests.get(url=url,headers=headers).text
print(re_one)
arg1=re.findall("(?<=var arg1=')\w+",re_one)[0]
new_cookie=execjs.compile(open(r"雪球热点话题.js").read()).call('getAcwScV2', arg1)
cookies = {
'acw_sc__v2': new_cookie,
}
response= requests.get(url='https://segmentfault.com/a/1190000022183269',headers=headers,cookies=cookies)
response.encoding=response.apparent_encoding
print(response.text)
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