Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复:coolapk api 错误 #66

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion worker/src/providers/afdian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function afdianProvider(
return commonProviderHandler<AfdianResponse>({
providerName: 'afdian',
queryKey: key,
fetchUrl: `https://afdian.net/api/user/get-profile-by-slug?url_slug=${key}`,
fetchUrl: `https://afdian.com/api/user/get-profile-by-slug?url_slug=${key}`,
countObjPath: 'data.user.creator.monthly_fans',
errorMessageObjPath: 'em',
isResponseValid: d => d.ec === 200 && 'user' in d.data,
Expand Down
51 changes: 45 additions & 6 deletions worker/src/providers/coolapk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,55 @@ export default async function coolapkProvider(
key: string,
): Promise<SubstatsResponse> {
const headers = {
'User-Agent':
'Dalvik/2.1.0 (Linux; U; Android 9; MI 8 SE MIUI/9.5.9) (#Build; Xiaomi; MI 8 SE; PKQ1.181121.001; 9) +CoolMarket/9.2.2-1905301',
'X-App-Id': 'com.coolapk.market',
'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 14)',
/**
* {
* "status": 1000,
* "error": null,
* "message": "请求方式错误"
* }
*/
'X-Requested-With': 'XMLHttpRequest',
'X-Sdk-Locale': 'zh-CN',
/**
* {
* "status": 1001,
* "error": null,
* "message": "应用未授权"
* }
*/
'X-App-Id': 'com.coolapk.market',
/**
* {
* "status": 1004,
* "error": null,
* "message": "请求验证错误"
* }
*/
'X-App-Device':
'AyOzEjLG9VMx8FMx00QHBFI7ATMNN0RQByOPBFUPByOPBFUPByOgsDI7AyOzcjMBlmZYtWLshncvNmM3ZFdwMkMZFWMXlHWGRDTalTLoVFR',
'YTZlhTNxUGNiV2NmVGM4EGI7cDMw4SNwATMzIjLBFDUVByODFUMxITM0AjMyAyOp1GZlJFI7kWbvFWaYByOgsDI7AyOxcGd5NkYwhHRQRDcqVTc0FXW3tGRJVneRhEZuV1XIpHOKVFR',
/**
* {
* "status": 1004,
* "error": null,
* "message": "请求验证错误"
* }
*/
'X-App-Code': 2408121,
// 'X-App-Token': getAppToken(),
/**
* {
* "status": 1001,
* "error": null,
* "message": "请求方式错误(1)"
* }
*/
'X-App-Token':
'v3JDJ5JDEwJE5qYzRZMkkzWkdNdlpqSTFPV1UzWWVYeDBOZGtKLkVFYXBhZ0R1RFlPRGVrWVlBMTVjVUNt',
'X-App-Version': '14.4.0',
'X-Api-Version': 14,
'X-Sdk-Locale': 'zh-CN',
Host: 'api.coolapk.com',
'X-Dark-Mode': '0',
'X-App-Token': getAppToken(),
}
return commonProviderHandler<CoolapkResponse>({
providerName: 'coolapk',
Expand Down