From 415d9d9a9c987d182f0936df72c8ef12a5c31ad9 Mon Sep 17 00:00:00 2001 From: bohd4nx Date: Tue, 14 Apr 2026 01:57:12 +0300 Subject: [PATCH] docs: update examples and changelog to reflect CookieResult usage and Python version changes --- CHANGELOG.md | 8 ++++++-- README.md | 4 +++- examples/auctions/search_gifts.py | 2 +- examples/auctions/search_numbers.py | 2 +- examples/auctions/search_usernames.py | 2 +- examples/client/raw_api_call.py | 2 +- examples/client/wallet_info.py | 2 +- examples/numbers/manage_number.py | 2 +- examples/purchase/recharge_ads_balance.py | 2 +- examples/purchase/run_premium_giveaway.py | 2 +- examples/purchase/run_stars_giveaway.py | 2 +- examples/purchase/send_premium.py | 2 +- examples/purchase/send_stars.py | 2 +- examples/purchase/topup_ton_balance.py | 2 +- 14 files changed, 21 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f85d7f..ab4d62d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,13 +14,17 @@ and this project uses [Calendar Versioning](https://calver.org/) (`YYYY.MINOR.MI - `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) + result = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... + client = FragmentClient(seed="...", api_key="...", cookies=result.cookies) + print(result.expires) # ISO 8601 expiry of stel_ssid, or None for session cookies ``` +- `CookieResult` — return type of `get_cookies_from_browser()`; exposes `.cookies` (`dict[str, str]`) and `.expires` (ISO 8601 string or `None`) ### Changed +- `DEVICE` Tonkeeper fingerprint updated: `appVersion` → `26.04.0` - `tonutils` upgraded to **2.1.0** +- Minimum Python version lowered to **3.10** (previously 3.12) --- diff --git a/README.md b/README.md index eb16129..bb94671 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,9 @@ Requires Python 3.10+. - **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", ... + result = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... + # result.cookies — dict[str, str] to pass to FragmentClient + # result.expires — ISO 8601 expiry of stel_ssid, or None for session cookies ``` - **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. diff --git a/examples/auctions/search_gifts.py b/examples/auctions/search_gifts.py index 4eb31ac..dafcaac 100644 --- a/examples/auctions/search_gifts.py +++ b/examples/auctions/search_gifts.py @@ -17,7 +17,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/auctions/search_numbers.py b/examples/auctions/search_numbers.py index f8d55ba..f3f5a36 100644 --- a/examples/auctions/search_numbers.py +++ b/examples/auctions/search_numbers.py @@ -16,7 +16,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/auctions/search_usernames.py b/examples/auctions/search_usernames.py index f478b03..5fc3e13 100644 --- a/examples/auctions/search_usernames.py +++ b/examples/auctions/search_usernames.py @@ -16,7 +16,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/client/raw_api_call.py b/examples/client/raw_api_call.py index 070ee7a..4996d90 100644 --- a/examples/client/raw_api_call.py +++ b/examples/client/raw_api_call.py @@ -18,7 +18,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/client/wallet_info.py b/examples/client/wallet_info.py index 4b4f14f..5ac628f 100644 --- a/examples/client/wallet_info.py +++ b/examples/client/wallet_info.py @@ -14,7 +14,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/numbers/manage_number.py b/examples/numbers/manage_number.py index 8251c2e..80f1a3b 100644 --- a/examples/numbers/manage_number.py +++ b/examples/numbers/manage_number.py @@ -15,7 +15,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/purchase/recharge_ads_balance.py b/examples/purchase/recharge_ads_balance.py index 56dde7a..d0084bc 100644 --- a/examples/purchase/recharge_ads_balance.py +++ b/examples/purchase/recharge_ads_balance.py @@ -19,7 +19,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/purchase/run_premium_giveaway.py b/examples/purchase/run_premium_giveaway.py index c152af9..d0a39b8 100644 --- a/examples/purchase/run_premium_giveaway.py +++ b/examples/purchase/run_premium_giveaway.py @@ -14,7 +14,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/purchase/run_stars_giveaway.py b/examples/purchase/run_stars_giveaway.py index a9188ba..5a73310 100644 --- a/examples/purchase/run_stars_giveaway.py +++ b/examples/purchase/run_stars_giveaway.py @@ -14,7 +14,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/purchase/send_premium.py b/examples/purchase/send_premium.py index cd12734..f82f1ed 100644 --- a/examples/purchase/send_premium.py +++ b/examples/purchase/send_premium.py @@ -14,7 +14,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/purchase/send_stars.py b/examples/purchase/send_stars.py index 73d77eb..76b616a 100644 --- a/examples/purchase/send_stars.py +++ b/examples/purchase/send_stars.py @@ -14,7 +14,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = { diff --git a/examples/purchase/topup_ton_balance.py b/examples/purchase/topup_ton_balance.py index 49900b7..f09d0f3 100644 --- a/examples/purchase/topup_ton_balance.py +++ b/examples/purchase/topup_ton_balance.py @@ -21,7 +21,7 @@ SEED = "word1 word2 ... word24" API_KEY = "YOUR_TONAPI_KEY" # Option A: extract cookies directly from your browser (no manual copy-paste needed) -# COOKIES = get_cookies_from_browser("chrome") # or "firefox", "edge", "brave", ... +# COOKIES = get_cookies_from_browser("chrome").cookies # or "firefox", "edge", "brave", ... # Option B: provide cookies manually COOKIES = {