mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +00:00
docs: update examples and changelog to reflect CookieResult usage and Python version changes
This commit is contained in:
+6
-2
@@ -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)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user