vibalcam / ticktick-gcalendar-py

2-way sync between TickTick and Google Calendar
MIT License
35 stars 2 forks source link

Cannot make it work #4

Closed qir3k closed 5 months ago

qir3k commented 5 months ago

### After first run i get this error: C:\Users\kamil\Desktop\ticktick-gcalendar-py-main>python ticktick-gcalendar.py -r Cache could not be read at: .token-oauth Enter the URL you were redirected to: http://127.0.0.1:8080/?code=r2bDDq&state=None Traceback (most recent call last): File "C:\Users\kamil\Desktop\ticktick-gcalendar-py-main\ticktick-gcalendar.py", line 631, in main(arguments) File "C:\Users\kamil\Desktop\ticktick-gcalendar-py-main\ticktick-gcalendar.py", line 566, in main tick = TickTickApi(renew=args.renew) File "C:\Users\kamil\Desktop\ticktick-gcalendar-py-main\ticktick-gcalendar.py", line 299, in init auth_client = OAuth2(client_id=credentials['CLIENT_ID'], File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ticktick\oauth2.py", line 136, in init self.get_access_token(check_cache=check_cache, check_env=env_key) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ticktick\oauth2.py", line 311, in get_access_token token_info = self._request_access_token() File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ticktick\oauth2.py", line 225, in _request_access_token token_info = self._post(self.OBTAIN_TOKEN_URL, params=payload) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ticktick\oauth2.py", line 249, in _post raise RuntimeError("POST request could not be completed") RuntimeError: POST request could not be completed

### And i not get any .token-oauth file but after second i get it but with this error.

C:\Users\kamil\Desktop\ticktick-gcalendar-py-main>python ticktick-gcalendar.py -r Traceback (most recent call last): File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\urllib3\connectionpool.py", line 846, in urlopen return self.urlopen( File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\urllib3\connectionpool.py", line 846, in urlopen return self.urlopen( File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\urllib3\connectionpool.py", line 846, in urlopen return self.urlopen( File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\urllib3\connectionpool.py", line 836, in urlopen retries = retries.increment(method, url, response=response, _pool=self) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\urllib3\util\retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.ticktick.com', port=443): Max retries exceeded with url: /api/v2/user/signin?wc=True&remember=True (Caused by ResponseError('too many 405 error responses'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\kamil\Desktop\ticktick-gcalendar-py-main\ticktick-gcalendar.py", line 631, in main(arguments) File "C:\Users\kamil\Desktop\ticktick-gcalendar-py-main\ticktick-gcalendar.py", line 566, in main tick = TickTickApi(renew=args.renew) File "C:\Users\kamil\Desktop\ticktick-gcalendar-py-main\ticktick-gcalendar.py", line 302, in init self.client = TickTickClient(credentials['USERNAME'], credentials['PWD'], auth_client) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ticktick\api.py", line 52, in init self._prepare_session(username, password) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ticktick\api.py", line 67, in _prepare_session self._login(username, password) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ticktick\api.py", line 104, in _login response = self.http_post(url, json=user_info, params=parameters, headers=self.HEADERS) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ticktick\api.py", line 184, in http_post response = self._session.post(url, kwargs) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\sessions.py", line 590, in post return self.request('POST', url, data=data, json=json, kwargs) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, kwargs) File "C:\Users\kamil\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\adapters.py", line 507, in send raise RetryError(e, request=request) requests.exceptions.RetryError: HTTPSConnectionPool(host='api.ticktick.com', port=443): Max retries exceeded with url: /api/v2/user/signin?wc=True&remember=True (Caused by ResponseError('too many 405 error responses'))

Could you tell me what is wrong and also how to setup google calendar integration because I only managed how to connect to ticktick.

vibalcam commented 5 months ago

Please check the installation section of the updated README.md. The main change is that you should use the forked version of the ticktick_py library.

This should now be fixed. The issue was that the underlying library ticktick-py, which makes the API calls to TickTick, was no longer working.