diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04ee292..e7615c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,9 +20,7 @@ jobs: with: python-version: "3.12" - - uses: astral-sh/setup-uv@v8.0.0 - - - run: uv pip install --system ".[dev]" + - run: pip install ".[dev]" - run: ruff check . && black --check . --target-version py312 && mypy pyfragment diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5497f05..bc0ece5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -100,10 +100,18 @@ jobs: name: dist path: dist + - name: Extract latest changelog entry + id: changelog + run: | + body=$(awk '/^## \[/{if(found) exit; found=1; next} found{print}' CHANGELOG.md) + echo "body<> $GITHUB_OUTPUT + echo "$body" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - uses: softprops/action-gh-release@v2.6.1 with: tag_name: v${{ needs.version-check.outputs.version }} name: v${{ needs.version-check.outputs.version }} files: dist/* - generate_release_notes: true + body: ${{ steps.changelog.outputs.body }} make_latest: true diff --git a/.gitignore b/.gitignore index cda7104..7e968df 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,7 @@ Thumbs.db .ruff_cache/ .coverage htmlcov/ -demo.run.py +systests/ # Build & distribution dist/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 84e7598..4f85d7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,23 @@ and this project uses [Calendar Versioning](https://calver.org/) (`YYYY.MINOR.MI --- +## [2026.2.0] — 2026-04-14 + +### Added + +- `get_cookies_from_browser(browser)` — extract Fragment session cookies directly from an installed browser (Chrome, Firefox, Edge, Brave, Arc, Opera, Safari, and more); no browser extension or manual copy-paste required + ```python + from pyfragment.utils import get_cookies_from_browser + cookies = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... + client = FragmentClient(seed="...", api_key="...", cookies=cookies) + ``` + +### Changed + +- `tonutils` upgraded to **2.1.0** + +--- + ## [2026.1.0] — 2026-03-25 ### Added @@ -83,6 +100,7 @@ and this project uses [Calendar Versioning](https://calver.org/) (`YYYY.MINOR.MI - `py.typed` marker — full PEP 561 typing support for type-checkers - `__repr__` on all result types for readable debug output +[2026.2.0]: https://github.com/bohd4nx/pyfragment/releases/tag/v2026.2.0 [2026.1.0]: https://github.com/bohd4nx/pyfragment/releases/tag/v2026.1.0 [2026.0.2]: https://github.com/bohd4nx/pyfragment/releases/tag/v2026.0.2 [2026.0.1]: https://github.com/bohd4nx/pyfragment/releases/tag/v2026.0.1 diff --git a/README.md b/README.md index 7ab264c..3d31da0 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,16 @@ Requires Python 3.12+. ## Credentials -**Fragment cookies** — log in to [fragment.com](https://fragment.com), install [Cookie Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm), and export these four keys: `stel_ssid`, `stel_dt`, `stel_token`, `stel_ton_token`. Pass them as a `dict` or as a JSON string. Refresh when you get authentication errors. +**Fragment cookies** — log in to [fragment.com](https://fragment.com) and connect your TON wallet. You can get cookies in two ways: + +- **Automatically** (recommended) — use `get_cookies_from_browser()`, which reads them directly from your browser's on-disk store. No extension needed: + ```python + from pyfragment.utils import get_cookies_from_browser + cookies = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... + ``` +- **Manually** — install [Cookie Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) and export these four keys: `stel_ssid`, `stel_dt`, `stel_token`, `stel_ton_token`. Pass them as a `dict` or JSON string. + +Refresh when you get authentication errors. **Tonapi key** — generate at [tonconsole.com](https://tonconsole.com). diff --git a/pyproject.toml b/pyproject.toml index 18204a9..f0218c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "pyfragment" -version = "2026.1.0" +version = "2026.2.0" description = "Async Python client for the Fragment API — a unified toolkit to manage Telegram assets: purchase Stars and Premium, top up TON and Ads balances, run giveaways, manage anonymous numbers, and explore the marketplace for usernames, numbers, and gifts." readme = "README.md" license = { text = "MIT" } @@ -71,3 +71,4 @@ ignore = ["E501"] [tool.ruff.lint.per-file-ignores] "tests/*" = ["E402"] +"systests/*" = ["E402"]