Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to crack youdao JS encryption by Python

Shulou Source: shulou.com Published: 2022-06-01 20:03:40 10月02日 Update

This article mainly explains "Python how to crack JS encryption," interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "Python how to crack JS encryption"!

Development environment:

Interpreter: Python 3.6.5| Anaconda, Inc.

Editor: pycharm Community Edition

portions of code

import randomimport timeimport requestsfrom hashlib import md5#Enter the URL you want to visit post_url = 'fanyi.youdao.com/translate_o? smartresult=dict&smartresult=rule'appVersion = "5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"#Request headers = { "Accept": "application/json, text/javascript, */*; q=0.01", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9", "Cache-Control": "no-cache", "Connection": "keep-alive", "Content-Length": "281", "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "Cookie": "OUTFOX_SEARCH_USER_ID=728181645@10.169.0.82; OUTFOX_SEARCH_USER_ID_NCOO=1392777521.250264; JSESSIONID=aaaapitSB3EHV64Y44Spx; ___rl__test__cookies=1597407303179", "Host": "fanyi.youdao.com", "Origin": "http://fanyi.youdao.com", "Pragma": "no-cache", "Referer": "http://fanyi.youdao.com/", "User-Agent": appVersion, "X-Requested-With": "XMLHttpRequest", if __name__ == '__main__': # while True: # word = input ('Please input the translation you want: ') with open ('article content.txt ', mode ='r', encoding ='utf-8') as f: text = f.read() results = fanyi(text) r_s = results['translateResult'][0] with open ('bilingual.txt', mode='w', encoding='utf-8') as f: for r in r_s: f.write(r['src']) f.write('\n') f.write(r['tgt']) f.write('\n') f.write('\n') print(r['src']) print(r['tgt']) #Make bilingual articles #Students who want complete source code can pay attention to my public number: squirrels love cookies #Reply to "There is a translation" to get it for free

effect is as follows

At this point, I believe that everyone has a deeper understanding of "Python how to crack JS encryption," so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Tags: Content encryption bilingual article learning input practical deeper code public interest parameter classmate practical practical simple operation effect method more friends Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Docker macOS Microsoft Shulou Technology