What's Changed
- Merge pull request #108 from Cloxl/feat/xrap-param (5f45309)
- remove unused import package
hashlib. (bcc67c7) - Update the algorithm of
POSTrequests. (aa8e8c5) - Cancel the import of extract_api_path. (83d04d2)
- Cancel the import of extract_api_path. (befb5a2)
- update test cases of session. (33feb61)
- Update sdk version to 4.3.3, solve the 406 error of
user/otherinfo,user_posted. (6e00116) - fix: replace assert guard with RuntimeError, reject None cookies (b3ea151)
- fix(ci): remove unused RequestSignatureValidator import (F401) (751d221)
- style: align sign_xyw with sign_xs API conventions (e70ab2a)
- fix: address review — use validated_method, remove unused constants, simplify AES-128 interface (d2f50af)
- feat(xyw): replace XYS wrapper with proper AES-128-CBC signing (6734eba)
- fix: add sign_format validation per review feedback (956ea79)
- style: fix ruff formatting (4662301)
- feat: add XYW_ signature format to bypass HTTP 406 on data APIs (b8064f6)
Full Changelog: v0.1.9...v0.2.0
Installation
pip install xhshow==0.2.0Or upgrade from previous version:
pip install --upgrade xhshowQuick Start
from xhshow import Xhshow, SessionManager
# Basic usage
client = Xhshow()
# GET request signature
signature = client.sign_xs_get(
uri="/api/sns/web/v1/user_posted",
a1_value="your_a1_cookie_value",
params={"num": "30", "user_id": "123"}
)
# POST request signature
signature = client.sign_xs_post(
uri="/api/sns/web/v1/comment/post",
a1_value="your_a1_cookie_value",
payload={"note_id": "123", "content": "Great!"}
)
# Generate complete headers with session management
session = SessionManager()
headers = client.sign_headers_get(
uri="/api/sns/web/v1/homefeed",
cookies={"a1": "your_a1_value", "web_session": "..."},
params={"page": "1"},
session=session
)Documentation
Supported Python Versions
- Python 3.10+
- Python 3.11
- Python 3.12
What's Changed
- Update sdk version to 4.3.3, solve the 406 error of
user/otherinfo,user_posted. by @ljc545w in #106 - feat: add XYW_ signature format to bypass HTTP 406 on data APIs by @SeaL773 in #105
- Feat/xrap param by @Cloxl in #108
New Contributors
Full Changelog: v0.1.9...v0.2.0