返回 douyin-downloader
test_xbogus.py
根目录 / tests / test_xbogus.py
1 from utils.xbogus import generate_x_bogus
2
3
4 def test_generate_x_bogus_appends_parameter():
5 base_url = "https://www.douyin.com/aweme/v1/web/aweme/detail/?aweme_id=123"
6 signed_url, token, ua = generate_x_bogus(base_url)
7
8 assert signed_url.startswith(base_url)
9 assert "X-Bogus=" in signed_url
10 assert isinstance(token, str) and len(token) > 10
11 assert isinstance(ua, str) and "Mozilla" in ua
12
12 lines PYTHON