- 帖子
- 20
- 精华
- 0
- 积分
- 166
- 阅读权限
- 20
- 注册时间
- 2018-10-15
- 最后登录
- 2019-4-13
|
- # coding: utf-8
- import itchat
- import tkinter.messagebox
- import winsound
- # import os
- # import pygame
- def alarm():
- # Windows嗡鸣声
- winsound.Beep(37, 3000)
- # # Mac语音
- # os.system('say "有人发红包了,赶紧去抢啊!红红火火恍恍惚惚哈哈哈哈"')
- # # 播放MP3
- # pygame.mixer.init()
- # track = pygame.mixer.music.load('alarm.mp3')
- # pygame.mixer.music.play()
- tkinter.messagebox.showwarning('重要提醒','有人发红包了!')
- @itchat.msg_register('Note', isGroupChat=True)
- def get_note(msg):
- if '红包' in msg['Text']:
- print('note:',msg['Text'])
- alarm()
- @itchat.msg_register(itchat.content.TEXT, isGroupChat=True)
- def _(msg):
- print('text:',msg['Text'])
- itchat.auto_login(hotReload=True)
- itchat.run()
- itchat.logout()
复制代码- Traceback (most recent call last):
- File "G:\Python\python35\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
- chunked=chunked)
- File "G:\Python\python35\lib\site-packages\urllib3\connectionpool.py", line 384, in _make_request
- six.raise_from(e, None)
- File "<string>", line 2, in raise_from
- File "G:\Python\python35\lib\site-packages\urllib3\connectionpool.py", line 380, in _make_request
- httplib_response = conn.getresponse()
- File "G:\Python\python35\lib\http\client.py", line 1321, in getresponse
- response.begin()
- File "G:\Python\python35\lib\http\client.py", line 296, in begin
- version, status, reason = self._read_status()
- File "G:\Python\python35\lib\http\client.py", line 257, in _read_status
- line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
- File "G:\Python\python35\lib\socket.py", line 589, in readinto
- return self._sock.recv_into(b)
- File "G:\Python\python35\lib\ssl.py", line 1052, in recv_into
- return self.read(nbytes, buffer)
- File "G:\Python\python35\lib\ssl.py", line 911, in read
- return self._sslobj.read(len, buffer)
- ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "G:\Python\python35\lib\site-packages\requests\adapters.py", line 449, in send
- timeout=timeout
- File "G:\Python\python35\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
- _stacktrace=sys.exc_info()[2])
- File "G:\Python\python35\lib\site-packages\urllib3\util\retry.py", line 398, in increment
- raise MaxRetryError(_pool, url, error or ResponseError(cause))
- urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='wx2.qq.com', port=443): Max retries exceeded with url: /cgi-bin/mmwebwx-bin/webwxsync?sid=LwxWFEQn4p4uhsn+&skey=@crypt_ff6d3ee_f08fccb8288070191159a29e88b3d5d4&pass_ticket=AzJsbONuPu3ZNmQd9%2BLUAC0S0yygdupk7CRcEaQ1nss5DQ8wvwB0Bcbh%2BEykeDSm (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)))
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "G:\Python\python35\lib\site-packages\itchat\components\login.py", line 237, in maintain_loop
- msgList, contactList = self.get_msg()
- File "G:\Python\python35\lib\site-packages\itchat\components\login.py", line 302, in get_msg
- r = self.s.post(url, data=json.dumps(data), headers=headers)
- File "G:\Python\python35\lib\site-packages\requests\sessions.py", line 581, in post
- return self.request('POST', url, data=data, json=json, **kwargs)
- File "G:\Python\python35\lib\site-packages\requests\sessions.py", line 533, in request
- resp = self.send(prep, **send_kwargs)
- File "G:\Python\python35\lib\site-packages\requests\sessions.py", line 646, in send
- r = adapter.send(request, **kwargs)
- File "G:\Python\python35\lib\site-packages\requests\adapters.py", line 510, in send
- raise ProxyError(e, request=request)
- requests.exceptions.ProxyError: HTTPSConnectionPool(host='wx2.qq.com', port=443): Max retries exceeded with url: /cgi-bin/mmwebwx-bin/webwxsync?sid=LwxWFEQn4p4uhsn+&skey=@crypt_ff6d3ee_f08fccb8288070191159a29e88b3d5d4&pass_ticket=AzJsbONuPu3ZNmQd9%2BLUAC0S0yygdupk7CRcEaQ1nss5DQ8wvwB0Bcbh%2BEykeDSm (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)))
- Traceback (most recent call last):
- File "G:\Python\python35\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
- chunked=chunked)
- File "G:\Python\python35\lib\site-packages\urllib3\connectionpool.py", line 384, in _make_request
- six.raise_from(e, None)
- File "<string>", line 2, in raise_from
- File "G:\Python\python35\lib\site-packages\urllib3\connectionpool.py", line 380, in _make_request
- httplib_response = conn.getresponse()
- File "G:\Python\python35\lib\http\client.py", line 1321, in getresponse
- response.begin()
- File "G:\Python\python35\lib\http\client.py", line 296, in begin
- version, status, reason = self._read_status()
- File "G:\Python\python35\lib\http\client.py", line 257, in _read_status
- line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
- File "G:\Python\python35\lib\socket.py", line 589, in readinto
- return self._sock.recv_into(b)
- File "G:\Python\python35\lib\ssl.py", line 1052, in recv_into
- return self.read(nbytes, buffer)
- File "G:\Python\python35\lib\ssl.py", line 911, in read
- return self._sslobj.read(len, buffer)
- ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "G:\Python\python35\lib\site-packages\requests\adapters.py", line 449, in send
- timeout=timeout
- File "G:\Python\python35\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
- _stacktrace=sys.exc_info()[2])
- File "G:\Python\python35\lib\site-packages\urllib3\util\retry.py", line 398, in increment
- raise MaxRetryError(_pool, url, error or ResponseError(cause))
- urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='webpush.wx2.qq.com', port=443): Max retries exceeded with url: /cgi-bin/mmwebwx-bin/synccheck?r=1549117899719&skey=%40crypt_ff6d3ee_f08fccb8288070191159a29e88b3d5d4&sid=LwxWFEQn4p4uhsn%2B&uin=2697288210&deviceid=e481114857544419&synckey=1_662763427%7C2_662764203%7C3_662764137%7C11_662764202%7C201_1549117737%7C203_1549117721%7C1000_1549117203%7C1001_1549114636&_=1549117899719 (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)))
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "G:\Python\python35\lib\site-packages\itchat\components\login.py", line 231, in maintain_loop
- i = sync_check(self)
- File "G:\Python\python35\lib\site-packages\itchat\components\login.py", line 283, in sync_check
- r = self.s.get(url, params=params, headers=headers)
- File "G:\Python\python35\lib\site-packages\requests\sessions.py", line 546, in get
- return self.request('GET', url, **kwargs)
- File "G:\Python\python35\lib\site-packages\requests\sessions.py", line 533, in request
- resp = self.send(prep, **send_kwargs)
- File "G:\Python\python35\lib\site-packages\requests\sessions.py", line 646, in send
- r = adapter.send(request, **kwargs)
- File "G:\Python\python35\lib\site-packages\requests\adapters.py", line 510, in send
- raise ProxyError(e, request=request)
- requests.exceptions.ProxyError: HTTPSConnectionPool(host='webpush.wx2.qq.com', port=443): Max retries exceeded with url: /cgi-bin/mmwebwx-bin/synccheck?r=1549117899719&skey=%40crypt_ff6d3ee_f08fccb8288070191159a29e88b3d5d4&sid=LwxWFEQn4p4uhsn%2B&uin=2697288210&deviceid=e481114857544419&synckey=1_662763427%7C2_662764203%7C3_662764137%7C11_662764202%7C201_1549117737%7C203_1549117721%7C1000_1549117203%7C1001_1549114636&_=1549117899719 (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)))
复制代码 微信收到红包,电脑没有提示,这是被拒绝访问了吗
|
|