Sync Learned to TickTick [Support Thread]

Support thread for all questions related to the “Sync Learned to TickTick” Addon.

“Sync Learned to TickTick” syncs your daily “studied today” stat to a habit on the TickTick platform.
This can be useful for visualising your daily learning process but also to simply keep yourself motivated.

Feel free to ask any questions regarding this Addon right here!
Please check the documentation below if your are unsure that you have everything set up correctly.

Required
Fill these in before use! The Addon won’t work with these left blank.

  • username: Your TickTick Mail

  • password: Your TickTick Password.

Info: TickTick sends your password via. HTTPS which is secure, but you should still be careful because adding it here adds it to a file on your computer! If you are uncertain about adding your password here you can check the complete source code of this Addon by clicking “View Files” on the right side of the Addon-Window.

Usage
This addon syncs only by the habit name, so feel free to change the habit in TickTick as you please. The only thing that this addon changes is the card count of the current date.
Automatically syncs when the “sync” button is pressed or activated in any other way.

Configuration
These fields configure the plugin for your personal use. Keep in mind that you can also sync the plugin to a already existing habit by entering its name as the habit_name here.

  • habit_name: The name of the habit in TickTick. Warning, this has to match the case-sensitive name of the habit. If you change the name in TickTick, change it here as well!

  • target: Daily target for cards. Only affects the habit if it is newly created

  • unit_name: Name of the units. Only affects the habit if it is newly created

Known Restriction
This Addon will not work if you are at your habit-limit! (5 for free accounts). There is nothing I can do about that.

-btw04

2 Likes

Version 1.1 (March 25th 2023):

Major Changes/Additions:

  • Added a synchronization to the new “Timer” feature in TickTick
    • Automatically creates a new Timer linked to the habit
    • Syncs all learned times >5 minutes to this Timer

Minor Changes/Fixes

  • Signs in on application start-up, reducing the “freeze” time of each sync caused by this addon.

  • Signs out when closing, reducing the token-spam

  • Fixed multiple small bugs/issues

  • Upped the supported versions to 2.1.60+

I tested these changes as best as I could, but especially the addition of the sync to the timer is a big new feature that might introduce errors. Please contact me if you encounter any new unwanted behaviour

Hi, first of all just wanted to say I love your addon. Used it March-May no problem.

Unfortunately, lately it is not working, and giving this error on startup:

No longer works on 2.1.65

Error
An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading '<U+2068>Sync Learned to TickTick<U+2069>':
<U+2068>Traceback (most recent call last):
File "requests.adapters", line 486, in send
File "urllib3.connectionpool", line 878, in urlopen
File "urllib3.connectionpool", line 878, in urlopen
File "urllib3.connectionpool", line 878, in urlopen
File "urllib3.connectionpool", line 868, in urlopen
File "urllib3.util.retry", line 592, in increment
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 500 error responses'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "aqt.addons", line 246, in loadAddons
File "C:\Users\Name\AppData\Roaming\Anki2\addons21\240836168\__init__.py", line 31, in <module>
client = TickTickClient(username, password=password)
File "C:\Users\Name\AppData\Roaming\Anki2\addons21\240836168/ticktick-py\ticktick\api.py", line 45, in __init__
self._prepare_session(username, password)
File "C:\Users\Name\AppData\Roaming\Anki2\addons21\240836168/ticktick-py\ticktick\api.py", line 51, in _prepare_session
self._login(username, password)
File "C:\Users\Name\AppData\Roaming\Anki2\addons21\240836168/ticktick-py\ticktick\api.py", line 91, in _login
response = self.http_post(url, json=user_info, params=parameters, headers=self.HEADERS)
File "C:\Users\Name\AppData\Roaming\Anki2\addons21\240836168/ticktick-py\ticktick\api.py", line 175, in http_post
response = self._session.post(url, **kwargs)
File "requests.sessions", line 637, in post
File "requests.sessions", line 589, in request
File "requests.sessions", line 703, in send
File "requests.adapters", line 510, in send
requests.exceptions.RetryError: HTTPSConnectionPool(host='ticktickapisite', port=443): Max retries exceeded with url: /api/v2/user/signin?wc=True&remember=True (Caused by ResponseError('too many 500 error responses'))

Hi there.

Really sorry for answering this late! Unfortunately it turns out that my notifications for this forum aren’t properly set-up…

The issue you described has been fixed about a month ago, so simply updating should resolve everything. I also just now added a small fix that might have affected your use.

As always if you have any suggestions, feel free to share!

btw04

Hi! Thanks for making this add-on and keeping it updated thus far. I LOVE Ticktick, and I love Anki, so this was a wonderful integration of both!

I first installed the Add-on in Jan 2024. It had been working for great for me until 3/5/2024 when it stopped syncing to my Ticktick. I can’t figure out why not, and Anki said there’s been no other recent updates to the Add-on. Please see the Debug Info below. Thanks in advance!

Anki 23.12.1 (1a1d4d54)  (ao)
Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: macOS-14.2.1-arm64-arm-64bit

When loading Sync Learned to TickTick:
Traceback (most recent call last):
  File "aqt.addons", line 245, in loadAddons
  File "/Users/vivian/Library/Application Support/Anki2/addons21/240836168/__init__.py", line 35, in <module>
    client = TickTickClient(username, password=password)
  File "/Users/vivian/Library/Application Support/Anki2/addons21/240836168/ticktick-py/ticktick/api.py", line 51, in __init__
    self._prepare_session(username, password)
  File "/Users/vivian/Library/Application Support/Anki2/addons21/240836168/ticktick-py/ticktick/api.py", line 57, in _prepare_session
    self._login(username, password)
  File "/Users/vivian/Library/Application Support/Anki2/addons21/240836168/ticktick-py/ticktick/api.py", line 97, in _login
    response = self.http_post(url, json=user_info, params=parameters, headers=self.HEADERS)
  File "/Users/vivian/Library/Application Support/Anki2/addons21/240836168/ticktick-py/ticktick/api.py", line 182, in http_post
    self.check_status_code(response, 'Could Not Complete Request')
  File "/Users/vivian/Library/Application Support/Anki2/addons21/240836168/ticktick-py/ticktick/api.py", line 115, in check_status_code
    raise RuntimeError(error_message)
RuntimeError: Could Not Complete Request

Hi, thank you for the bug report!
I just implemented a fix that works on my end, please update your plugin and test if it also works for you.

The issue was caused because the login-request was send pretending to be a rather old firefox version which is no longer supported by TickTick which I just increased to a newer version, so hopefully we won’t be having that issue for a long time now.

btw04

1 Like

Amazing – I updated the Add-on, and it works perfectly again! Thank you so much for your prompt addressing of the problem!!

1 Like

Hi,

I am interested in your add-on, but I haven’t been able to get it to work… I saw that the add-on uses the python lib ticktick-py, and I tried to connect it to ticktick habits in a simple python script using the ticktick-py lib. It seems that ticktick prevents unofficial APIs from interacting with its habits, but their official API doesn’t offer this either…

So my question was whether this project is still being maintained and used, and whether this problem is unique to me…

Have a nice day

gpx4

Hello,

this project is prone to sometimes breaking because, as you mentioned, it uses the “unofficial” backend API which at this point is pretty outdated in most parts. The official API has improved a bit since I last checked it, but offers nowhere near enough functionality to support this plugin.

However, after some quick testing, the plugin seems to currently still work for me. If you want, you could provide some additional information with which I might be able to help you.

  1. Please double-check that you have the config file filled out correctly. In Anki, go to ToolsAdd-ons → Click on Sync Learned to TickTickConfig (bottom right) → Fill in your data. It should look something like this:

{
“habit_name”: “Cards learned today”,
“password”: “abc123”,
“target“: 30,
“unit_name”: “Cards”,
“username”: “testEmail@gmail.com”
}

  1. Which version of Anki are you using?
  2. Run the Anki debug console by starting anki-console.batin the Anki installation folder if you are using Windows, equivalents on other OS. This plugin should pop up in the console and log what is failing.

Hopefully this helps,
btw04

Thanks for your answer! I use the 24.06.3 version of Anki.

The add-on is working today without me having to change anything… :thinking: But the function to sync the learning time spent on Anki on TickTick still isn’t working…

I have another question: does this add-on also work on AnkiDroid?

gpx4