JettChenT / wechat-exporter

Export your WeChat chat history to json!
MIT License
71 stars 3 forks source link

运行报错 #3

Closed hxzhouh closed 1 year ago

hxzhouh commented 1 year ago

~/tools/wechat-exporter on main > python main.py ./foo at 19:16:41 Traceback (most recent call last):

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connection.py", line 203, in _new_conn sock = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection raise err

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa)

ConnectionRefusedError: [Errno 61] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 790, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 496, in _make_request conn.request(

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connection.py", line 395, in request self.endheaders()

File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1281, in endheaders self._send_output(message_body, encode_chunked=encode_chunked)

File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1041, in _send_output self.send(msg)

File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 979, in send self.connect()

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connection.py", line 243, in connect self.sock = self._new_conn() ^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connection.py", line 218, in _new_conn raise NewConnectionError(

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x10474c490>: Failed to establish a new connection: [Errno 61] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "/opt/homebrew/lib/python3.11/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 844, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/urllib3/util/retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=48065): Max retries exceeded with url: /wechat/allcontacts (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10474c490>: Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/Users/hxzhouh/tools/wechat-exporter/main.py", line 77, in app()

File "/Users/hxzhouh/tools/wechat-exporter/main.py", line 66, in export_all all_users = requests.get("http://localhost:48065/wechat/allcontacts").json() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request)

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=48065): Max retries exceeded with url: /wechat/allcontacts (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10474c490>: Failed to establish a new connection: [Errno 61] Connection refused'))

mac m1 : 13.4.1 (22F82)

JettChenT commented 1 year ago

看起来程序调用的API访问不了。请问你这边有通过 wechattweaks-cli 安装修改后的 wechatTweaks 插件吗? 没有的话可以参考一下这个 section

hxzhouh commented 1 year ago

重新安装后,还是报错 ,麻烦op帮忙看看

python3 main.py ./foo Traceback (most recent call last):

File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/Users/hxzhouh/tools/wechat-exporter/main.py", line 77, in app()

File "/Users/hxzhouh/tools/wechat-exporter/main.py", line 66, in export_all all_users = requests.get("http://localhost:48065/wechat/allcontacts").json() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

JettChenT commented 1 year ago
curl -i http://localhost:48065/wechat/
curl -i http://localhost:48065/wechat/search
curl -i http://localhost:48065/wechat/allcontacts

可以麻烦运行一下这几个命令,然后把结果发过来看看吗?如果真的返回了联系人数据那么务必省略一下。

JettChenT commented 1 year ago

closed due to inactivity

Ricardokevins commented 7 months ago
curl -i http://localhost:48065/wechat/allcontacts

运行了,只有search是工作的,其他都会报错

HTTP/1.1 501 Not Implemented
Server: GCDWebServer
Connection: Close
Date: Fri, 23 Feb 2024 19:09:33 GMT