funny-cat-happy / barknotificator

A package that allows you to send notifications to your iOS device using the Bark app without self server
GNU General Public License v3.0
34 stars 2 forks source link

plans for 1.0.0 #4

Open funny-cat-happy opened 1 year ago

funny-cat-happy commented 1 year ago

Current Issue

httpx package is very big and has so many dependency. Not support for tls to send message to apple server.

Future Plan

If so many people use it and have feedback,I will fix it and add some features.

LianLongBaGua commented 9 months ago

yes please add support, plus ive ran into problem the app says "incorrect token" now.

funny-cat-happy commented 9 months ago

yes please add support, plus ive ran into problem the app says "incorrect token" now.

Do you copy from your bark app of iphone right?And can you show your code?

LianLongBaGua commented 9 months ago

yes i copied exactly. the code is your sample code of your hello world. using aliyun ubuntu 22 in the .venv environment python 3.10 only problem might be that i also installed bark-cli?

funny-cat-happy commented 9 months ago

yes i copied exactly. the code is your sample code of your hello world. using aliyun ubuntu 22 in the .venv environment python 3.10 only problem might be that i also installed bark-cli?

The device id is a 64-letter string. Is it right? And can you send the detail of the error message?

LianLongBaGua commented 9 months ago

Traceback (most recent call last): File "/root/rqd_arcticdb/barktest.py", line 4, in <module> bark.send(title="welcome", content="hello world") File "/root/rqd_arcticdb/.another_venv/lib/python3.10/site-packages/BarkNotificator/barknotificator.py", line 95, in send raise BarkNotificatorException(response.text) BarkNotificator.exception.BarkNotificatorException: {"reason":"InvalidProviderToken"}

funny-cat-happy commented 9 months ago

Traceback (most recent call last): File "/root/rqd_arcticdb/barktest.py", line 4, in <module> bark.send(title="welcome", content="hello world") File "/root/rqd_arcticdb/.another_venv/lib/python3.10/site-packages/BarkNotificator/barknotificator.py", line 95, in send raise BarkNotificatorException(response.text) BarkNotificator.exception.BarkNotificatorException: {"reason":"InvalidProviderToken"}

I test in my ubuntu 3.10 python server.It works normally.Maybe you installed another package that caused a conflict. Maybe your device id is wrong.

LianLongBaGua commented 9 months ago

OK thanks I’ll check.

获取 Outlook for iOShttps://aka.ms/o0ukef


发件人: PieCat @.> 发送时间: Tuesday, November 7, 2023 11:33:32 PM 收件人: funny-cat-happy/barknotificator @.> 抄送: LianLongBaGua @.>; Comment @.> 主题: Re: [funny-cat-happy/barknotificator] plans for 0.2.0 (Issue #4)

Traceback (most recent call last): File "/root/rqd_arcticdb/barktest.py", line 4, in bark.send(title="welcome", content="hello world") File "/root/rqd_arcticdb/.another_venv/lib/python3.10/site-packages/BarkNotificator/barknotificator.py", line 95, in send raise BarkNotificatorException(response.text) BarkNotificator.exception.BarkNotificatorException: {"reason":"InvalidProviderToken"}

I test in my ubuntu 3.10 python server.It works normally.Maybe you installed another package that caused a conflict. Maybe your device id is wrong.

― Reply to this email directly, view it on GitHubhttps://github.com/funny-cat-happy/barknotificator/issues/4#issuecomment-1798885578, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6IPNN4GIARN3S7FQWXK5SLYDJIEZAVCNFSM6AAAAAA323DWTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJYHA4DKNJXHA. You are receiving this because you commented.Message ID: @.***>

LianLongBaGua commented 9 months ago

Traceback (most recent call last): File "/root/rqd_arcticdb/barktest.py", line 4, in <module> bark.send(title="welcome", content="hello world") File "/root/rqd_arcticdb/.another_venv/lib/python3.10/site-packages/BarkNotificator/barknotificator.py", line 95, in send raise BarkNotificatorException(response.text) BarkNotificator.exception.BarkNotificatorException: {"reason":"InvalidProviderToken"}

I test in my ubuntu 3.10 python server.It works normally.Maybe you installed another package that caused a conflict. Maybe your device id is wrong.

OK after some testing i found what something very strange. given my coding ability i'm unable to solve that puzzle.

  1. When i ran in my local environment (windows plus python 3.10 with venv) with vpn on, in a jupyter notebook in vscode, the push notification works fine.
  2. when i ran it as a standalone script on cloud server it produces the abovementioned error message.
  3. when i ran in my local without vpn in jupyter notebook, it still works.
  4. when i ran in my local as a script with or without vpn, it fails and produces the following message: File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpcore_exceptions.py", line 10, in map_exceptions yield File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpcore_backends\sync.py", line 168, in start_tls raise exc File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpcore_backends\sync.py", line 163, in start_tls sock = ssl_context.wrap_socket( File "e:\veighna_elite_simulation\lib\ssl.py", line 513, in wrap_socket return self.sslsocket_class._create( File "e:\veighna_elite_simulation\lib\ssl.py", line 1071, in _create self.do_handshake() File "e:\veighna_elite_simulation\lib\ssl.py", line 1342, in do_handshake self._sslobj.do_handshake() TimeoutError: _ssl.c:980: The handshake operation timed out

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

Traceback (most recent call last): File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_transports\default.py", line 66, in map_httpcore_exceptions yield File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_transports\default.py", line 228, in handle_request resp = self._pool.handle_request(req) File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpcore_sync\connection_pool.py", line 268, in handle_request raise exc File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpcore_sync\connection_pool.py", line 251, in handle_request response = connection.handle_request(request) File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpcore_sync\http_proxy.py", line 317, in handle_request stream = stream.start_tls(**kwargs) File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpcore_backends\sync.py", line 152, in start_tls with map_exceptions(exc_map): File "e:\veighna_elite_simulation\lib\contextlib.py", line 153, in exit self.gen.throw(typ, value, traceback) File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpcore_exceptions.py", line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ConnectTimeout: _ssl.c:980: The handshake operation timed out

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

Traceback (most recent call last): File "e:\GitHub\vectorbt_learning\tutorio.py", line 5, in bark.send(title="welcome", content="hello world") File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\BarkNotificator\barknotificator.py", line 89, in send response = client.post( File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_client.py", line 1132, in post return self.request( File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_client.py", line 814, in request return self.send(request, auth=auth, follow_redirects=follow_redirects) File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_client.py", line 901, in send response = self._send_handling_auth( File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_client.py", line 929, in _send_handling_auth response = self._send_handling_redirects( File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_client.py", line 966, in _send_handling_redirects response = self._send_single_request(request) File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_client.py", line 1002, in _send_single_request response = transport.handle_request(request) File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_transports\default.py", line 227, in handle_request with map_httpcore_exceptions(): File "e:\veighna_elite_simulation\lib\contextlib.py", line 153, in exit self.gen.throw(typ, value, traceback) File "E:\GitHub\vectorbt_learning.venv\lib\site-packages\httpx_transports\default.py", line 83, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectTimeout: _ssl.c:980: The handshake operation timed out This is indeed very strange. would appreciate if you could tell me what went wrong.

LianLongBaGua commented 9 months ago

specifically the only variable here seems to be whether its running inside a jupyter kernel or not. but the kernel and the interpreter i used to run the script are identical: i.e. the python.exe from .venv/bin

LianLongBaGua commented 9 months ago

OK i got it. 命名空间的问题

allinu commented 2 months ago

@funny-cat-happy Hello, you have update code with new options but not publish it pipy, when use pip to install it, there no new options

funny-cat-happy commented 2 months ago

@funny-cat-happy Hello, you have update code with new options but not publish it pipy, when use pip to install it, there no new options

It has updated now