leogomezz4t / PyTextNow_API

Python texting API utilizing TextNow API
MIT License
69 stars 42 forks source link

Trouble logging in #69

Open ctrlvee opened 1 year ago

ctrlvee commented 1 year ago

I'm trying the first step with logging in but having issues with my csrf cookie not getting used correctly?

Traceback (most recent call last): File "/Users/v/Python/instagram_post/main/texts.py", line 12, in <module> client = pytextnow.Client(username) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/v/Python/instagram_post/.venv/lib/python3.11/site-packages/pytextnow/TNAPI.py", line 79, in __init__ 'x-csrf-token': self.get_initial_csrf_token() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/v/Python/instagram_post/.venv/lib/python3.11/site-packages/pytextnow/TNAPI.py", line 100, in get_initial_csrf_token req = requests.get('https://www.textnow.com/messaging', cookies=self.cookies) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/v/Python/instagram_post/.venv/lib/python3.11/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/v/Python/instagram_post/.venv/lib/python3.11/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/v/Python/instagram_post/.venv/lib/python3.11/site-packages/requests/sessions.py", line 528, in request prep = self.prepare_request(req) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/v/Python/instagram_post/.venv/lib/python3.11/site-packages/requests/sessions.py", line 456, in prepare_request p.prepare( File "/Users/v/Python/instagram_post/.venv/lib/python3.11/site-packages/requests/models.py", line 318, in prepare self.prepare_cookies(cookies) File "/Users/v/Python/instagram_post/.venv/lib/python3.11/site-packages/requests/models.py", line 575, in prepare_cookies cookie_header = get_cookie_header(self._cookies, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/v/Python/instagram_post/.venv/lib/python3.11/site-packages/requests/cookies.py", line 142, in get_cookie_header jar.add_cookie_header(r) File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/cookiejar.py", line 1370, in add_cookie_header attrs = self._cookie_attrs(cookies) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/cookiejar.py", line 1329, in _cookie_attrs self.non_word_re.search(cookie.value) and version > 0): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'list' (.venv) v@V instagram_post %

Kasherpete commented 1 year ago

The current version of PyTextNow, as far as I am aware IS BROKEN due to TextNow breaking it - as of a couple weeks ago. The error message is 403-forbidden, however it seems like you are getting a different error message. I am almost 100% sure it still does not work as this project is no longer being maintained, but if you share a code sample I may be able to point something out in case it does work again.

TommasShelbyOBE commented 1 year ago

have the same questions