MCPcopy Create free account
hub / github.com/Loping151/RoverSign / get_base_header

Function get_base_header

RoverSign/utils/api/request_util.py:31–47  ·  view source on GitHub ↗
(devCode: Optional[str] = None)

Source from the content-addressed store, hash-verified

29
30
31async def get_base_header(devCode: Optional[str] = None):
32 # platform_source = random.choice(["ios", "android"])
33 # user_agent = IOS_USER_AGENT if platform_source == "ios" else ANDROID_USER_AGENT
34 platform_source = "ios"
35 user_agent = IOS_USER_AGENT
36 header = {
37 "source": platform_source,
38 "Content-Type": CONTENT_TYPE,
39 "User-Agent": user_agent,
40 "version": KURO_VERSION, # getPostDetail 需要版本号
41 }
42 if devCode:
43 header["devCode"] = devCode
44 else:
45 ip = await get_public_ip()
46 header["devCode"] = f"{ip}, {user_agent}"
47 return header
48
49
50async def get_community_header() -> dict[str, str]:

Callers 15

get_community_headerFunction · 0.85
refresh_dataMethod · 0.85
login_logMethod · 0.85
get_request_tokenMethod · 0.85
get_daily_infoMethod · 0.85
sign_inMethod · 0.85
sign_in_task_listMethod · 0.85
find_role_listMethod · 0.85
get_taskMethod · 0.85
get_form_listMethod · 0.85
do_likeMethod · 0.85
do_sign_inMethod · 0.85

Calls 1

get_public_ipFunction · 0.85

Tested by

no test coverage detected