Comments (7)
实测把headers里面的User-Agent改成
Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36
可以登录
from pytrader.
f12 手机排版不需要安全控件
调整代码还是没登录成功。
from pytrader.
今天正好也碰到同样的问题...
from pytrader.
实测把headers里面的User-Agent改成 Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36 可以登录
咦 我这边改了不行 翻了下js代码。感觉需要实现password: EMTradeEncrypt.encrypt(v), post提交上去的密文是动态变化的
from pytrader.
折腾好久,还改写了加密部分代码,结果一直调试不通过。
最后发现,头部改写浏览器类别就好,其他改乱了(把这个给放开了X-Requested-With": "XMLHttpRequest",)
成功恢复
from pytrader.
headers里面的User-Agent改成 Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36 可以登录
另外附上密码密文部分处理代码:
from Crypto.Cipher import PKCS1_v1_5 as Cipher_pksc1_v1_5
from Crypto.PublicKey import RSA
def encrpt(password, public_key):
rsakey = RSA.importKey(public_key)
cipher = Cipher_pksc1_v1_5.new(rsakey)
cipher_text = base64.b64encode(cipher.encrypt(password.encode()))
return cipher_text.decode()
key是公钥,需要修改成自己的之后再进行加密
public_key ="- https://jywg.18.cn/JsBundles/BaseJS 中查找-'''
res=self.s.post(self.config['authentication'], data={
'duration': 1800,
'password': encrpt(self.account_config['password']明文密码, public_key) ,
'identifyCode': identifyCode,
from pytrader.
headers里面的User-Agent改成 Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36 可以登录
另外附上密码密文部分处理代码: from Crypto.Cipher import PKCS1_v1_5 as Cipher_pksc1_v1_5 from Crypto.PublicKey import RSA
def encrpt(password, public_key): rsakey = RSA.importKey(public_key) cipher = Cipher_pksc1_v1_5.new(rsakey) cipher_text = base64.b64encode(cipher.encrypt(password.encode())) return cipher_text.decode()
key是公钥,需要修改成自己的之后再进行加密 public_key ="- https://jywg.18.cn/JsBundles/BaseJS 中查找-'''
res=self.s.post(self.config['authentication'], data={ 'duration': 1800, 'password': encrpt(self.account_config['password']明文密码, public_key) , 'identifyCode': identifyCode,
新版本代码支持了
from pytrader.
Related Issues (8)
- 东方财富登录问题
- assets获取失败404 HOT 2
- 登录时抓包发现不再时简单的密码,而是改用加密后的密码 HOT 12
- 最近在研究ETF 网格交易做 T 有没有相关算法 HOT 1
- what's the structure of jqdata.json HOT 1
- ./utils/base.exe HOT 2
- 网页登录异常 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytrader.