This repository contains two independent, automatic synchronization tools powered by GitHub Actions. They allow you to sync your Douban movie, TV show, and animation watch history ("看过" and "想看") to two major platforms: Simkl and NeoDB.
- Script:
sync_simkl.py - Workflow: Runs hourly and manually (
douban_simkl_sync.yml) - Season-Level Accuracy: Solves the common Douban problem where a TV show page only maps to the IMDb ID of a single episode. The script uses the TMDB API to resolve the parent show and season number, allowing Simkl to mark the correct season as watched.
- Fallbacks: Searches TMDB by original/Chinese titles if Douban is missing the IMDb ID.
- Status History: Saved in
sync_history.json.
- Script:
sync_neodb.py - Workflow: Runs hourly and manually (
douban_neodb_sync.yml) - Native Douban Mapping: Directly queries NeoDB's catalog fetch API (
/api/catalog/fetch) using the Douban URL to locate the exact item, avoiding metadata mismatch issues. - Unlimited Comment Length: NeoDB has no character limits on comments. The script uploads your full, untruncated Douban reviews and notes to your NeoDB timeline/shelf.
- Precise Ratings: Extracts half-star ratings (e.g.
3.5stars becomes7out of 10) directly from Douban notes. - Status History: Saved in
sync_history_neodb.json.
- Fork this repository to your own GitHub account.
- Edit
config.jsonin your repository:douban_id: Change this to your Douban username/ID (found in your Douban homepage URLhttps://www.douban.com/people/YOUR_ID/).sync_delay_seconds: The delay (in seconds) between requests to avoid rate limits.
If you want to sync to Simkl, complete these steps:
- Create a Simkl Developer App:
- Go to Simkl Developer Settings.
- Set Redirect URI to
http://localhost. - Save to get your Client ID and Client Secret.
- Obtain your Simkl Access Token (Choose one):
- Method A (Web Console):
- Open in browser:
https://simkl.com/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=http://localhost - Authorize, then copy the code from the redirected URL
http://localhost/?code=YOUR_CODE. - Open any webpage, press
F12to open the Developer Console, and run:fetch('https://api.simkl.com/oauth/token', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ code: "YOUR_COPIED_CODE", client_id: "YOUR_CLIENT_ID", client_secret: "YOUR_CLIENT_SECRET", redirect_uri: "http://localhost", grant_type: "authorization_code" }) }).then(res => res.json()).then(console.log);
- Copy the resulting
"access_token".
- Open in browser:
- Method B (Python Script):
- Run
python get_token.pylocally and follow the interactive prompts.
- Run
- Method A (Web Console):
- Save Simkl Secrets:
Go to your GitHub repo ->
Settings > Secrets and variables > Actions > New repository secretand add:TMDB_API_KEY: Your TMDB API Key (Free at TMDB).SIMKL_CLIENT_ID: Your Simkl Client ID.SIMKL_ACCESS_TOKEN: The Simkl Access Token you generated.
If you want to sync to NeoDB, complete these steps:
- Obtain your NeoDB Access Token:
- Go to the developer console page of your NeoDB instance (e.g.
https://neodb.social/developer/orhttps://neodb.net/developer/). - Log in, expand the Test Access Token section, click Generate, and copy the token.
- Go to the developer console page of your NeoDB instance (e.g.
- Save NeoDB Secrets:
Go to your GitHub repo ->
Settings > Secrets and variables > Actions > New repository secretand add:NEODB_ACCESS_TOKEN: The token you just copied.NEODB_INSTANCE_DOMAIN(Optional): The domain of your NeoDB instance (defaults toneodb.social). If you use a different instance (likeneodb.net), set this secret to your instance's domain name.
- Go to the Actions tab in your GitHub repository.
- Select either Douban to Simkl Sync or Douban to NeoDB Sync from the left sidebar.
- Enable the workflow and click Run workflow to trigger the initial sync manually.
- After the first run, the workflows will run automatically every hour.
Note
Why Hourly Execution? Douban's public RSS feed only keeps the 10 most recent actions (watched/wished items). Running the workflows hourly ensures that any new actions you mark are captured before they are pushed out of the RSS cache. The scripts only commit changes back to the repository if new records are actually added, so hourly execution is quiet and won't create empty commits.