gitmyhub

bookmark-eXport

Python ★ 0 updated 26d ago

Back up your X (Twitter) bookmarks to enriched JSONL — full tweets, threads, and article bodies. Real browser + your own cookies. No API, no LLM, $0.

A free local Python tool that backs up your X (Twitter) bookmarks, including full tweet text, threads, and articles, by driving a real browser with your own login cookies.

PythonPlaywrightChromiumsetup: easycomplexity 2/5

This is a Python tool that backs up a person's bookmarked posts from X, the platform formerly known as Twitter, since X does not offer any official way to export them. It saves each bookmark as one line in a text file, including the full post text, the full text of any linked article, the author's own follow up replies as a thread, and details about quoted posts, links, and attached media.

X protects its bookmarks behind an internal system that only accepts requests generated by X's own website code running in a real browser, which blocks simple scripts that try to fake those requests directly. To get around this without breaking any rules, the tool opens an invisible, automated version of the Chrome browser using your own login cookies, visits the bookmarks page as you normally would, and simply reads the data that the page itself requests from X's servers while scrolling. Because the browser is the one asking, the request looks completely normal to X.

It works in two passes. First it scrolls through the bookmarks list collecting every post. Then, for each new bookmark it has not seen before, it opens that specific post once to gather the extra details the main list leaves out, such as the full article text or thread replies. Every time it runs, it only does this deeper lookup on brand new bookmarks, while just refreshing like and view counts on ones it already saved.

Setup requires Python 3.9 or newer, plus copying two authentication values out of a logged in browser session, called auth_token and ct0. These act like a temporary password and are stored only in a local file that never gets uploaded anywhere. If the tool suddenly stops finding any bookmarks, the most common cause is that those two values expired and need to be copied again.

This project is aimed at individual X users who want a free, local, and private backup of their own bookmarks, and it is released under the MIT license.

Where it fits