$ account caolvchong-top
This repository provides a set of Python CLI tools for downloading media (images, videos, GIFs) and text from Twitter/X. It uses Twitter's internal GraphQL API (not the official API) and requires a valid user cookie for authentication. The primary entry point is `main.py`, which downloads media from a specified user's timeline, with options to include retweets, highlights, likes, and time range filtering. Additional scripts handle downloading by hashtag or advanced search (`tag_down.py`), downloading replies to a specific tweet or user (`reply_down.py`), downloading only text tweets (`text_down.py`), and downloading profile information (`profile_down.py`). The tool generates CSV logs and optional Markdown files, supports concurrent async downloads, and includes a caching mechanism to avoid re-downloading. It is a monolithic application with shared utility modules for CSV generation, Markdown generation, caching, and URL handling. The code is functional and well-documented in Chinese, but exhibits some code duplication and tight coupling to Twitter's API structure. It is actively maintained and adapted to Twitter's API changes.