SignerPy
easy library to generate x-argus x-ladon x-gorgen x-khronos and params for tiktok
Install / Use
/learn @is-L7N/SignerPyREADME
Best Library To Signture Tiktok apis and more
New Update 8404 Gorgon and more
SignerPy is a Python library that provides various tools for encryption, signing, URL parsing, token generation, and more, mainly designed for interacting with TikTok APIs.
Table of Contents
Installation
pip install SignerPy==0.12.0
git clone https://github.com/is-L7N/SignerPy.git
cd SignerPy
Modules
SignerPy contains the following modules:
| Module | Description |
|--------|-------------|
| sign | Generates request headers signatures.|
| get | update params iid, device_id, cdid, etc...|
| encryption | Provides enc and dec functions for encryption/decryption. |
| hosts | Returns a list of TikTok API hosts using host(). |
| xor | Simple XOR encoding of strings. |
| url_to_params | Parses a URL query string into a dictionary using dicts(). |
| xtoken | Generates x-token values for API requests. |
| trace_id | Generates a trace ID for TikTok devices. |
| sign | Generates request signatures. |
| edata | edata Tiktok Encryption and Decryption easy |
| ttencrypt | Provides advanced encryption (Enc().encrypt()). |
| md5stub | Generates MD5 hash of a string or body. |
| * | Imports all functions for easy access. |
Usage Examples
Signture Headers
Sample Output:
{'x-ss-req-ticket': '1762387009792', 'x-khronos': '1762387009', 'x-gorgon': '0404b0d30000d4cec309eb57387ccee15dbc3694a62765ae25d4', 'x-ss-stub': 'D41D8CD98F00B204E9800998ECF8427E', 'x-ladon': 'cfyN2aMtfQ/hwsBzfpdfjK4HjO64+9+eAsAbXFoG7Fdsq5LE', 'x-argus': '8oGzD48Lx0I+DCXDwk+l2r542RIQVcGognB+CPA22nzh1Pn93HEBilqjiOSbjSPgqG0N9qYeHcveeZRXBg99oAMRTjLWjQ/YphKc/rfFnLFfAYGmPqG9WER/XDi3cTpgwihmg8f8PYCtoS6h+wdsMZd0UXf/wxbjaovR/31i1No+zBUDnInkI6FTGGOqopkbweiNmtUg2VeSmH92+RU0nM3azBwy+ROe3HNJRwcIK1yb/zlX8blEM46qE3vT6Xevz5g8lv4SLGlNgf6W08t4Ixeu'}
if You Need 8402 or 4404 or 8404 Gorgon
from SignerPy import sign
signature = sign(params=params, payload=None, version=8404) # version=4404 or version=8402
print(signature)
Sample Output:
{'x-ss-req-ticket': '1762259171000', 'x-khronos': '1762259171', 'x-gorgon': '840490e90000eb195e1a4e93f8ee4c6096ef9be9245477614426', 'content-length': '2', 'x-ss-stub': 'D2E4201A71AB14D92FD36DA8B4DC6E47', 'x-ladon': 'YVfzzrPh5G1mKlCPOwnRyTBLvSlCwcMoUJpynWn7LKq5IpjO', 'x-argus': '8oES6TTDk19XpiXVRoMY8sSm2PHDIlHeay5JCmPO6o+RltBIOc0BCDuZDMos550YipLLaqxeRkhXwqg+r6keWsdL5eeIWHPB7906llEJi+4oUlXZHjQZUpgu8hhojjt6SluTr8zDWpDsP9eoSbrEX/sE6FLWogayQpDgfivNeEzjMI1qs/CKZi0KNC4Es1+LjBii6IHrWtwgPlv9fmiL+xlS8rc5+L9hrqK38Bm49QsmmA=='}
Get Modern Params
from SignerPy import get
params.update(SignerPy.get(params=params))
Encryption & Decryption
from SignerPy.encryption import enc, dec
data = {
"aid": "1988",
"app_name": "tiktok_web",
"device_platform": "web_pc"
}
encrypted = enc(data)
print(encrypted)
decrypted = dec(encrypted)
print(decrypted)
Sample Output:
{
"aid": "1988",
"app_name": "tiktok_web",
"device_platform": "web_pc"
}
Hosts
from SignerPy.hosts import host
print(host())
Sample Output:
['api16-normal-no1a.tiktokv.eu', 'api16-normal-c-alisg.tiktokv.com', ...]
XOR Encoding
from SignerPy import xor
encoded = xor("email or username")
print(encoded)
Sample Output:
6068646c69256a7725707660776b646860
URL to Dictionary
from SignerPy.url_to_params import dicts
url = "https://api16-normal-c-alisg.tiktokv.com/lite/v2/public/item/list/?source=0&sec_user_id=XXXXX"
params = dicts(url=url)
print(params)
Sample Output:
{
"source": "0",
"sec_user_id": "XXXXX",
"count": "9",
"app_name": "musically_go"
}
XToken
from SignerPy import xtoken
x_token = xtoken(params="", sessionid="")
print(x_token)
Sample Output:
7a3465ad525ddf8ba13bc005d45c99a0f480a503b4c3b2a3f5aa184cdb332102--...
Trace ID
from SignerPy import trace_id
trace = trace_id(device_id="1234567890")
print(trace)
Sample Output:
00-4eee0edf08499602d2277ea43fe8-4eee0edf08499602-01
MD5 Hash
from SignerPy import md5stub
hash_value = md5stub(body="username=L7N")
print(hash_value)
Sample Output:
866F9F9C270106B1AF8063FFD0A80A22
edata decrypt
from SignerPy.edata import decrypt
print(decrypt(edata="ARMZiZCPPJD5AodPZbiXUFiNZYY/zPssCFJJmuLj6yeVRqG3NZ+ryYE0xAr/OVIbQemdMonPYUUzSyWcFHS5bwxmB9s="))
Sample Output:
''' {"need_captcha":false"} '''
edata encrypt
from SignerPy.edata import encrypt
print(encrypt(edata=b'{"need_captcha":false"}'))
Sample Output:
''' ATgiwD0XRkbaBpYdr1oTAs2PvSg6d5ExfzfmZanrGWShoooGLLhPIa1nImegxqCo0OOjpG6Uz2Vzndu6uxRPRfd72VA= '''
TTEncrypt
from SignerPy import ttencrypt
encrypted = ttencrypt.Enc().encrypt(data="username=L7N")
print(encrypted)
Sample Output:
b'tc\x05\x10\x00\x00\x1c^\xe4\xa6...'
✍️ Author
</h1> <p align="center"> <img src="https://img.shields.io/badge/Author-L7N-blue?style=flat-square" alt="author"> <img src="https://img.shields.io/badge/Language-Python-blue?style=flat-square"> <img src="https://img.shields.io/badge/Status-Working-success?style=flat-square"> </p>
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
