Skip to content

Scweet 5.9.0

Latest

Choose a tag to compare

@Altimis Altimis released this 02 Dec 16:02

A run now delivers what X has, or an error that names the cause, and every large method can yield its rows one at a time. Two defaults change behaviour, each to treat a defect: a search waits for the rate-limit window of X (run_wait_max_s, set 0 for the earlier stop), and a method raises where it returned [] for a refusal.

Added

  • Streaming twins of the large methods. iter_search, iter_profile_tweets, iter_profile_media, iter_followers, iter_following and iter_verified_followers yield each row as its page arrives, and the async twins aiter_* do the same with async for. The run holds no list of its rows, so the memory stays flat for any limit. A break stops the run and releases its accounts before the loop ends, and the run never reads more than stream_buffer_pages pages ahead of the consumer. With save=True, each page goes to the file as it arrives, so a crash keeps every page before it. The plain generator also works in Jupyter. The CLI commands of these six methods use them, with the same output.

Added (opt-in)

  • show_sensitive_content=True turns off "Hide sensitive content" in the search settings of each account before its first search, so a search and the replies of a tweet include the posts that X hides. It changes a setting of your account, so it is off by default.
  • young_account_ramp=True ramps the search of an account that Scweet uses for the first time, over 14 days. The stages are starting values, not a measurement.

Changed

  • Version ranges for the dependencies. curl_cffi>=0.10,<1: 0.10 is the first version where the library can remove a header of a page load (measured on 0.7.4 to 0.17). Upper bounds for sqlmodel, SQLAlchemy, pydantic and XClientTransaction, and lower bounds for python-dotenv and beautifulsoup4.
  • The documents say that every user row carries raw. Follower, following and user-info rows always held the full payload under raw, and the CSV held it too, while the documents said "only with raw_json=True". The rows do not change; raw_json stays accepted.

Fixed

  • A search no longer ends at the first rate-limit window. X allows 50 searches in 15 minutes for each account. A run leased its accounts once, and a worker left its account at the margin of the window, so one account and limit=5000 returned 960 tweets and no error. Now the run leases a replacement while work remains, and when every account rests for the rate limit it waits for the first one to return, up to run_wait_max_s (20 minutes), and logs when. It does not wait for an account that rests after a network or an auth failure.
  • A refused search no longer reads as "no more tweets". X refuses the search of an account with HTTP 200, an error on the timeline, and no timeline. That answer counted as an empty page. Now it rests the account search_refused_cooldown_s (6 hours), and the interval moves to another account.
  • A signed 404 and a lock no longer lose the interval. Both failed the interval at once, also when another account was free. Now the interval moves to another account, as after a 401 or a 403.
  • A locked account returns after its rest. The status of a lock was not reusable, so the account never returned to the pool, also after the user unlocked it.
  • A suspended account rests and says why. X still shows a suspended user its own profile, so the self-lookup said "alive" and the account came back after each short cooldown. After a refusal, a 404, a 401 or a 403, Scweet now asks verify_credentials (a live check of 2026-12-02 saw X answer the search of a suspended account with 404 and an empty body); a suspended account rests suspended_cooldown_s (7 days), and the log names the suspension.
  • No method turns a refusal into an empty list. get_followers, get_following, get_verified_followers, get_profile_tweets, get_profile_media, get_user_info, get_tweet_replies, get_reposters and search_users returned [] when X refused or no account was usable. Now they raise EngineError with the status, or AccountPoolExhausted, as search does. An answer of X with no row and status 200 stays [].
  • A profile continues on another account when X stops the first one. In a profile timeline or a follower list, a 429, an auth error or a lock ended that profile with the rows it had, and no error, while another account was free. Now the cursor moves to another account, up to max_account_switches times.
  • A resume continues every open interval. A search runs several intervals in parallel, but its checkpoint held one cursor that each interval wrote over: a resume continued the last writer, lost the progress of the others, and never planned the first intervals again. The checkpoint was also written only when the first run had resume=True, its key ignored the filters (from_users=["alice"] and ["bob"] shared one), and the default dates of the day entered the key. Now every search keeps one checkpoint with each open interval and its cursor, keyed on the whole request, and resume=True continues exactly those intervals. A checkpoint of an earlier version still starts a resume.
  • get_profile_tweets, get_profile_media and the follower methods resume. They accepted resume=True and ignored it. Now each unfinished profile keeps its cursor, and resume=True continues it.
  • The daily cap holds inside a run. The cap of an account was checked only when a run took the account, so a long follower list kept one account past it. Now the run hands the work to another account when one reaches its cap.
  • An ad is never a row. The replies of a tweet held the promoted tweets that X puts in a module of replies: 5 of 42 rows in one real page.
  • A search sends the switches of the web client of X. It sent the switches of every operation, with the values of the bundled manifest: compared with a request of the web client, 9 of its 42 switches were missing, 3 were extra and 5 had another value. Now a live read of X gives SearchTimeline its own list, with the values of the logged-in user, in the order of X, and the search sends withQuickPromoteEligibilityTweetFields as the web client does. The live read now refreshes itself once a day (manifest_auto_refresh_s).
  • A save name keeps its dots. save_name="elon.musk" and "elon.dev" both wrote to elon.csv, and the default name of a query with a dot lost its end. Only .csv and .json count as an extension now.
  • One slow answer of the proxy check does not end a run. With proxy_check_on_lease (on by default), one timeout of the exit ended the run with 0 tweets, and the next requests through that exit answered. The check now tries twice. A failed check also rests the account as a network failure does: a 407 left the account with no rest, and the run leased it again at once.
  • A split interval counts as open work. When X ends a chain while tweets remain, the run splits the interval. A child that never ran left the run "completed", and the run deleted its resume checkpoint.
  • since: and until: inside the query split the run. Every interval sent the same window, so the run read the same pages several times. The operators now become the bounds of the run.
  • The user-info and timeline paths respect the window of X. They had no limiter. After a 429, the user-info path sent every later handle from the same account, and both paths released the account with no cooldown. Now they pace to profile_window_request_limit, stop an account at a 429, a refusal or a lock, rest it, and continue on another account.
  • An account sends its API calls as the web client does. The calls carried the headers of a page load of Chrome (sec-fetch-mode: navigate, an HTML accept, upgrade-insecure-requests), the language en for every account, and the home page as the referer of a search. Now they carry the headers of a fetch, the language of the lang cookie of the account, and the search page as the referer. The page load of x.com for the request signature no longer sends the headers of an API call.
  • An account keeps one exit IP. A proxy URL with {session} gave an account a new random token at each session build, and the page load of x.com for the request signature left through the global proxy with another token. One session at several IPs is the pattern of a stolen cookie. Now each account keeps one token for its API calls and its page loads, and moves to a new one only after a network failure of its exit.
  • The sync methods work in Jupyter. They called asyncio.run, which refuses to start where an event loop already runs.
  • A pool with no usable account fails at once. It waited pool_wait_max_s (120 s) for a cooldown that could not end.
  • Two processes on one state file never lease one account. The lease is now a conditional update.
  • A refreshed manifest outlives its TTL. One hour after refresh_manifest(), the engine used the bundled query ids again, and X answered 404.
  • Workers that start together build the request signature once. Each built it, and each build loaded x.com with the cookies of an account.