diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee3a7a8..31934ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: - name: Extract changelog entry run: | VERSION="${{ github.ref_name }}" - NOTES=$(awk "/^## ${VERSION}/{found=1; next} /^## /{found=0} found" changelog.md) + NOTES=$(awk "/^## ${VERSION}/{found=1; next} /^## /{found=0} found && !/^---$/" changelog.md) if [ -z "$NOTES" ]; then echo "Error: no changelog entry found for ${VERSION}" exit 1 diff --git a/changelog.md b/changelog.md index 23d0ca0..ac053c6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,20 @@ +## v0.19.2 – 2026-07-21 + +### Features +- Added `wait_timeout` and `wait_interval` options to bound and tune account wait polling (#317, by @Flaburgan) + +### Fixes +- Fixed X client transaction ID generation to use each account's effective proxy (#319, by @kn1l) +- Fixed X client transaction ID asset requests to use account cookies (#321, by @jonsuh) +- Fixed X client transaction ID failures incorrectly disabling valid accounts + +### Maintenance +- Updated GraphQL operation IDs for current X API compatibility + +**Full Changelog**: https://github.com/vladkens/twscrape/compare/v0.19.1...v0.19.2 + +--- + ## v0.19.1 – 2026-06-26 ### Maintenance diff --git a/pyproject.toml b/pyproject.toml index 622fc9d..fbbf3b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "twscrape" -version = "0.19.1" +version = "0.19.2" authors = [{ name = "vladkens", email = "v.pronsky@gmail.com" }] description = "Twitter GraphQL and Search API implementation with SNScrape data models" readme = "readme.md" @@ -63,7 +63,7 @@ filterwarnings = ["ignore::DeprecationWarning"] exclude-newer = "7 days" [tool.ruff] -line-length = 99 +line-length = 100 target-version = "py310" [tool.ruff.lint] diff --git a/scripts/update_mocked_data.py b/scripts/update_mocked_data.py index 3f603a3..b72980f 100644 --- a/scripts/update_mocked_data.py +++ b/scripts/update_mocked_data.py @@ -166,9 +166,7 @@ def print_table(meta: dict[str, MetaEntry], ops: dict[str, str], ttl_days: int): stale_reasons = {"op": "op changed", "hash": "file changed"} if state in stale_reasons: - updated_at = ( - datetime.fromtimestamp(item[0]).strftime("%Y-%m-%d %H:%M") if item else "—" - ) + updated_at = datetime.fromtimestamp(item[0]).strftime("%Y-%m-%d %H:%M") if item else "—" print(f"{name:<28} {updated_at:>16} {stale_reasons[state]:>12} stale") continue diff --git a/tests/test_pool.py b/tests/test_pool.py index a48c4ec..3a48434 100644 --- a/tests/test_pool.py +++ b/tests/test_pool.py @@ -255,9 +255,7 @@ async def test_get_for_queue_or_wait_raises_via_env(pool_mock: AccountsPool, mon await pool_mock.get_for_queue_or_wait("TestQueue") -async def test_get_for_queue_or_wait_waits_for_locked_account( - pool_mock: AccountsPool, monkeypatch -): +async def test_get_for_queue_or_wait_waits_for_locked_account(pool_mock: AccountsPool, monkeypatch): queue = "TestQueue" pool = AccountsPool(pool_mock._db_file, wait_timeout=1, wait_interval=0.1) await pool.add_account("user1", "pass1", "email1", "ep1") diff --git a/twscrape/api.py b/twscrape/api.py index 70fe7e5..4861f5b 100644 --- a/twscrape/api.py +++ b/twscrape/api.py @@ -672,9 +672,7 @@ class API: yield x async def community_moderators(self, community_id: int, limit=-1, kv: KV = None): - async with aclosing( - self.community_moderators_raw(community_id, limit=limit, kv=kv) - ) as gen: + async with aclosing(self.community_moderators_raw(community_id, limit=limit, kv=kv)) as gen: async for rep in gen: for x in parse_users(rep, limit): yield x diff --git a/twscrape/xclid.py b/twscrape/xclid.py index 1d29350..9d1b30e 100644 --- a/twscrape/xclid.py +++ b/twscrape/xclid.py @@ -346,9 +346,7 @@ async def load_keys(soup: bs4.BeautifulSoup, clt: HttpClient) -> tuple[list[int] class XClIdGen: @staticmethod - async def create( - proxy: str | None = None, cookies: dict[str, str] | None = None - ) -> "XClIdGen": + async def create(proxy: str | None = None, cookies: dict[str, str] | None = None) -> "XClIdGen": # X serves a different/legacy web build to authenticated vs anonymous # sessions. Only authenticated sessions reliably contain the indices # this parser depends on (see INDICES_FILE_RE). diff --git a/uv.lock b/uv.lock index b385357..133de93 100644 --- a/uv.lock +++ b/uv.lock @@ -644,7 +644,7 @@ wheels = [ [[package]] name = "twscrape" -version = "0.19.1" +version = "0.19.2" source = { editable = "." } dependencies = [ { name = "aiosqlite" },