feat: Update CI workflows, add changelog extraction, and enhance README with cookie retrieval methods

This commit is contained in:
bohd4nx
2026-04-14 01:13:45 +03:00
parent ebd45d2991
commit 269551da2f
6 changed files with 41 additions and 7 deletions
+1 -3
View File
@@ -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
+9 -1
View File
@@ -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<<EOF" >> $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
+1 -1
View File
@@ -31,7 +31,7 @@ Thumbs.db
.ruff_cache/
.coverage
htmlcov/
demo.run.py
systests/
# Build & distribution
dist/
+18
View File
@@ -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
+10 -1
View File
@@ -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).
+2 -1
View File
@@ -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"]