Skip to content

Commit 0550509

Browse files
committed
有道
1 parent 509e5d7 commit 0550509

File tree

97 files changed

+266
-462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+266
-462
lines changed

Diff for: .idea/workspace.xml

+245-455
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: matplp/jieba/image/0.0兆赫.png

-81.6 KB
Binary file not shown.

Diff for: matplp/jieba/image/T-34坦克.png

-76.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/jishu.png

-66.7 KB
Binary file not shown.

Diff for: matplp/jieba/image/“大”人物.png

-77.9 KB
Binary file not shown.

Diff for: matplp/jieba/image/一吻定情.png

-78.2 KB
Binary file not shown.

Diff for: matplp/jieba/image/一条狗的回家路.png

-73.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/三方国界.png

-80.4 KB
Binary file not shown.
-75.8 KB
Binary file not shown.

Diff for: matplp/jieba/image/两大无猜.png

-81 KB
Binary file not shown.

Diff for: matplp/jieba/image/中国合伙人2.png

-80.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/伊莉莎与玛瑟拉.png

-73.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/余波.png

-68.4 KB
Binary file not shown.
-73.2 KB
Binary file not shown.

Diff for: matplp/jieba/image/偷心女盗.png

-76 KB
Binary file not shown.

Diff for: matplp/jieba/image/冷血追击.png

-78.8 KB
Binary file not shown.

Diff for: matplp/jieba/image/劫匪.png

-78.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/反贪风暴4.png

-78.2 KB
Binary file not shown.

Diff for: matplp/jieba/image/后街女孩.png

-77.2 KB
Binary file not shown.
Binary file not shown.

Diff for: matplp/jieba/image/哭泣女人的诅咒.png

-75.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/在乎你.png

-80.8 KB
Binary file not shown.

Diff for: matplp/jieba/image/地久天长.png

-69.6 KB
Binary file not shown.

Diff for: matplp/jieba/image/地面之洞.png

-73.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/复仇者.png

-70.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/大侦探皮卡丘.png

-78.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/大黄蜂.png

-69.2 KB
Binary file not shown.

Diff for: matplp/jieba/image/天气预爆.png

-71.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/女警.png

-76.8 KB
Binary file not shown.

Diff for: matplp/jieba/image/如影随心.png

-74.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/姐姐.png

-75.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/娑婆诃.png

-81.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/宠物坟场.png

-82.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/家和万事惊.png

-74.9 KB
Binary file not shown.

Diff for: matplp/jieba/image/密室逃生.png

-82.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/小猪佩奇过大年.png

-76.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/小飞象.png

-79.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/巴尔干边界.png

-76.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/干预.png

-74.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/廉政风云.png

-88.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/忌日快乐2.png

-81.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/恭喜八婆.png

-81 KB
Binary file not shown.

Diff for: matplp/jieba/image/恶霸警察.png

-68.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/惊天复制.png

-73.2 KB
Binary file not shown.

Diff for: matplp/jieba/image/惊奇队长.png

-85.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/我们.png

-74.6 KB
Binary file not shown.
-71.8 KB
Binary file not shown.

Diff for: matplp/jieba/image/我的一级兄弟.png

-77.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/我身体里的那个家伙.png

-78.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/战斗民族养成记.png

-71.7 KB
Binary file not shown.

Diff for: matplp/jieba/image/拍栗得.png

-79.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/摇摆狂潮.png

-78.9 KB
Binary file not shown.

Diff for: matplp/jieba/image/教授与疯子.png

-73.9 KB
Binary file not shown.

Diff for: matplp/jieba/image/新喜剧之王.png

-72.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/来电狂响.png

-78.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/极线杀手.png

-81.8 KB
Binary file not shown.

Diff for: matplp/jieba/image/极限职业.png

-73.7 KB
Binary file not shown.

Diff for: matplp/jieba/image/欢乐满人间2.png

-74.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/武林怪兽.png

-74.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/毒玫瑰.png

-69.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/流浪地球.png

-82.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/海滩流浪汉.png

-69.7 KB
Binary file not shown.

Diff for: matplp/jieba/image/海王.png

-78.8 KB
Binary file not shown.

Diff for: matplp/jieba/image/熊出没·原始时代.png

-81.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/狗眼看人心.png

-67 KB
Binary file not shown.

Diff for: matplp/jieba/image/玛丽女王.png

-69.6 KB
Binary file not shown.

Diff for: matplp/jieba/image/玻璃先生.png

-76.7 KB
Binary file not shown.

Diff for: matplp/jieba/image/生日.png

-82 KB
Binary file not shown.
-68.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/疯狂的外星人.png

-80.9 KB
Binary file not shown.

Diff for: matplp/jieba/image/白蛇:缘起.png

-66.6 KB
Binary file not shown.
-82.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/神奇乐园历险记.png

-65.8 KB
Binary file not shown.

Diff for: matplp/jieba/image/神探蒲松龄.png

-82.8 KB
Binary file not shown.
-65.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/神童.png

-75.9 KB
Binary file not shown.
Binary file not shown.

Diff for: matplp/jieba/image/老师·好.png

-72.7 KB
Binary file not shown.

Diff for: matplp/jieba/image/脱欧:无理之战.png

-80.6 KB
Binary file not shown.

Diff for: matplp/jieba/image/致命之旅.png

-78.8 KB
Binary file not shown.

Diff for: matplp/jieba/image/蒙上你的眼.png

-80.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/蝙蝠侠大战忍者神龟.png

-76 KB
Binary file not shown.

Diff for: matplp/jieba/image/证人.png

-76.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/词典.png

-75.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/谋杀疑案.png

-70.1 KB
Binary file not shown.

Diff for: matplp/jieba/image/超人王朝.png

-77.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/遇见女孩的感觉.png

-73.6 KB
Binary file not shown.

Diff for: matplp/jieba/image/钢铁苍穹2:即临种族.png

-83 KB
Binary file not shown.

Diff for: matplp/jieba/image/阳台上.png

-79.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/雷霆沙赞!.png

-81.4 KB
Binary file not shown.

Diff for: matplp/jieba/image/非分熟女.png

-78.6 KB
Binary file not shown.

Diff for: matplp/jieba/image/飞驰人生.png

-72.5 KB
Binary file not shown.

Diff for: matplp/jieba/image/麻药王.png

-76 KB
Binary file not shown.

Diff for: matplp/jieba/image/黑镜:潘达斯奈基.png

-76.3 KB
Binary file not shown.

Diff for: matplp/jieba/image/龙珠超:布罗利.png

-77 KB
Binary file not shown.

Diff for: 爬虫/Include/微信/itchat.pkl

105 KB
Binary file not shown.

Diff for: 爬虫/Include/微信/liaomei.py renamed to 爬虫/Include/微信/translate.py

+21-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#撩妹专用,祝你撩妹成功
21
#更多请关注公众号:bigsai
32
import itchat
43
import requests
@@ -7,6 +6,7 @@
76
import urllib.parse
87

98
jud=False#默认是先不开启
9+
isreturn=False#是否回复
1010
To='en'#翻译成的语言默认是英语
1111

1212
def nmd5(str):#md5加密
@@ -59,9 +59,14 @@ def text_reply(msg):
5959
# 返回信息调用信息
6060
global jud
6161
global To
62+
global isreturn
6263
text=msg['Text']
6364
dict = formdata(text)
64-
if "就像这样" in text:
65+
if "翻译模式" in text:
66+
isreturn =True
67+
elif "停止翻译" in text:
68+
isreturn=False
69+
if "开始" in text:
6570
jud=True
6671
elif "停止" in text:
6772
jud=False
@@ -73,17 +78,26 @@ def text_reply(msg):
7378
To = 'ko'
7479
elif "法语" in text:
7580
To = 'fr'
76-
elif "阿拉伯语" in text:
77-
To = 'ar'
7881
if jud:#说明需要运行
79-
dict['To']=To
82+
dict['to']=To
83+
dict['from']= 'AUTO'
8084
dict = urllib.parse.urlencode(dict)
8185
dict = str(dict)
8286
req = requests.post(url, timeout=1, data=dict, headers=header)
8387
val = req.json()
8488
transtr = val['translateResult'][0][0]['tgt']
8589
print(msg)
8690
itchat.send(transtr, toUserName=msg['ToUserName'])
87-
# return msg['Text']#这个加上是如果对面发消息的监听。比如你是双向翻译可以尝试下
91+
##返回监听对面说的话
92+
if isreturn:
93+
dict['from']='AUTO'
94+
dict['to']='zh-CHS'##翻译成中文
95+
dict = urllib.parse.urlencode(dict)
96+
# dict = str(dict)
97+
req = requests.post(url, timeout=1, data=dict, headers=header)
98+
val = req.json()
99+
transtr = val['translateResult'][0][0]['tgt']
100+
print(msg)
101+
return 'ta说:'+str(transtr)#这个加上是如果对面发消息的监听。比如你是双向翻译可以尝试下
88102
# 绑定消息响应事件后,让itchat运行起来,监听消息
89-
itchat.run()
103+
itchat.run()

0 commit comments

Comments
 (0)