@ikenxuan/amagi 6.3.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/default/index.cjs +96 -61
- package/dist/default/index.d.ts +74 -12
- package/dist/default/index.mjs +96 -61
- package/package.json +1 -1
package/dist/default/index.cjs
CHANGED
|
@@ -2577,6 +2577,37 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2577
2577
|
});
|
|
2578
2578
|
}
|
|
2579
2579
|
//#endregion
|
|
2580
|
+
//#region src/model/fetchers/shared/request-config.ts
|
|
2581
|
+
/**
|
|
2582
|
+
* 合并 Fetcher 的实例级请求配置与单次请求配置。
|
|
2583
|
+
*
|
|
2584
|
+
* 单次配置优先,请求头单独合并。函数不会修改任一入参,因此同一绑定
|
|
2585
|
+
* Fetcher 可以安全地在并发任务中为不同请求使用不同配置。
|
|
2586
|
+
*/
|
|
2587
|
+
const mergeRequestConfig = (base, override) => {
|
|
2588
|
+
if (!override) return base;
|
|
2589
|
+
return {
|
|
2590
|
+
...base ?? {},
|
|
2591
|
+
...override,
|
|
2592
|
+
headers: {
|
|
2593
|
+
...base?.headers ?? {},
|
|
2594
|
+
...override.headers ?? {}
|
|
2595
|
+
}
|
|
2596
|
+
};
|
|
2597
|
+
};
|
|
2598
|
+
/**
|
|
2599
|
+
* 解析绑定 Fetcher 当前调用实际使用的 cookie 与请求配置。
|
|
2600
|
+
*
|
|
2601
|
+
* 实例级或单次配置显式提供大写 `headers.Cookie` 时,合并后的值同时替换
|
|
2602
|
+
* 底层 Fetcher 的 cookie 参数,确保平台签名、前置请求和最终请求处于同一身份状态。
|
|
2603
|
+
*/
|
|
2604
|
+
const resolveBoundRequest = (boundCookie, base, override) => {
|
|
2605
|
+
const requestConfig = mergeRequestConfig(base, override);
|
|
2606
|
+
const headers = requestConfig?.headers;
|
|
2607
|
+
const cookieOverride = Boolean(headers && Object.prototype.hasOwnProperty.call(headers, "Cookie")) ? headers.Cookie : void 0;
|
|
2608
|
+
return [typeof cookieOverride === "string" ? cookieOverride : boundCookie, requestConfig];
|
|
2609
|
+
};
|
|
2610
|
+
//#endregion
|
|
2580
2611
|
//#region src/model/fetchers/bilibili/bound.ts
|
|
2581
2612
|
/**
|
|
2582
2613
|
* 创建绑定了 Cookie 和请求配置的 B站 Fetcher
|
|
@@ -2592,36 +2623,37 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2592
2623
|
* ```
|
|
2593
2624
|
*/
|
|
2594
2625
|
function createBoundBilibiliFetcher(cookie, requestConfig) {
|
|
2626
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
2595
2627
|
return {
|
|
2596
|
-
fetchVideoInfo: (options) => fetchVideoInfo(options,
|
|
2597
|
-
fetchVideoStreamUrl: (options) => fetchVideoStreamUrl(options,
|
|
2598
|
-
fetchVideoDanmaku: (options) => fetchVideoDanmaku(options,
|
|
2599
|
-
fetchComments: (options) => fetchComments(options,
|
|
2600
|
-
fetchCommentReplies: (options) => fetchCommentReplies$1(options,
|
|
2601
|
-
fetchUserCard: (options) => fetchUserCard(options,
|
|
2602
|
-
fetchUserDynamicList: (options) => fetchUserDynamicList(options,
|
|
2603
|
-
fetchUserLiveStatus: (options) => fetchUserLiveStatus(options,
|
|
2604
|
-
fetchUserSpaceInfo: (options) => fetchUserSpaceInfo(options,
|
|
2605
|
-
fetchUploaderTotalViews: (options) => fetchUploaderTotalViews(options,
|
|
2606
|
-
fetchDynamicDetail: (options) => fetchDynamicDetail(options,
|
|
2628
|
+
fetchVideoInfo: (options, override) => fetchVideoInfo(options, ...resolveRequest(override)),
|
|
2629
|
+
fetchVideoStreamUrl: (options, override) => fetchVideoStreamUrl(options, ...resolveRequest(override)),
|
|
2630
|
+
fetchVideoDanmaku: (options, override) => fetchVideoDanmaku(options, ...resolveRequest(override)),
|
|
2631
|
+
fetchComments: (options, override) => fetchComments(options, ...resolveRequest(override)),
|
|
2632
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies$1(options, ...resolveRequest(override)),
|
|
2633
|
+
fetchUserCard: (options, override) => fetchUserCard(options, ...resolveRequest(override)),
|
|
2634
|
+
fetchUserDynamicList: (options, override) => fetchUserDynamicList(options, ...resolveRequest(override)),
|
|
2635
|
+
fetchUserLiveStatus: (options, override) => fetchUserLiveStatus(options, ...resolveRequest(override)),
|
|
2636
|
+
fetchUserSpaceInfo: (options, override) => fetchUserSpaceInfo(options, ...resolveRequest(override)),
|
|
2637
|
+
fetchUploaderTotalViews: (options, override) => fetchUploaderTotalViews(options, ...resolveRequest(override)),
|
|
2638
|
+
fetchDynamicDetail: (options, override) => fetchDynamicDetail(options, ...resolveRequest(override)),
|
|
2607
2639
|
/** @deprecated v6.1.3 已废弃,调用将返回错误信息 */
|
|
2608
|
-
fetchDynamicCard: (options) => fetchDynamicCard(options,
|
|
2609
|
-
fetchBangumiInfo: (options) => fetchBangumiInfo(options,
|
|
2610
|
-
fetchBangumiStreamUrl: (options) => fetchBangumiStreamUrl(options,
|
|
2611
|
-
fetchLiveRoomInfo: (options) => fetchLiveRoomInfo$2(options,
|
|
2612
|
-
fetchLiveRoomInitInfo: (options) => fetchLiveRoomInitInfo(options,
|
|
2613
|
-
fetchArticleContent: (options) => fetchArticleContent(options,
|
|
2614
|
-
fetchArticleCards: (options) => fetchArticleCards(options,
|
|
2615
|
-
fetchArticleInfo: (options) => fetchArticleInfo(options,
|
|
2616
|
-
fetchArticleListInfo: (options) => fetchArticleListInfo(options,
|
|
2617
|
-
fetchLoginStatus: (options) => fetchLoginStatus(options,
|
|
2618
|
-
requestLoginQrcode: (options) => requestLoginQrcode$1(options,
|
|
2619
|
-
checkQrcodeStatus: (options) => checkQrcodeStatus(options,
|
|
2620
|
-
requestCaptchaFromVoucher: (options) => requestCaptchaFromVoucher(options,
|
|
2621
|
-
validateCaptchaResult: (options) => validateCaptchaResult(options,
|
|
2622
|
-
convertAvToBv: (options) => convertAvToBv(options,
|
|
2623
|
-
convertBvToAv: (options) => convertBvToAv(options,
|
|
2624
|
-
fetchEmojiList: (options) => fetchEmojiList$3(options,
|
|
2640
|
+
fetchDynamicCard: (options, override) => fetchDynamicCard(options, ...resolveRequest(override)),
|
|
2641
|
+
fetchBangumiInfo: (options, override) => fetchBangumiInfo(options, ...resolveRequest(override)),
|
|
2642
|
+
fetchBangumiStreamUrl: (options, override) => fetchBangumiStreamUrl(options, ...resolveRequest(override)),
|
|
2643
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$2(options, ...resolveRequest(override)),
|
|
2644
|
+
fetchLiveRoomInitInfo: (options, override) => fetchLiveRoomInitInfo(options, ...resolveRequest(override)),
|
|
2645
|
+
fetchArticleContent: (options, override) => fetchArticleContent(options, ...resolveRequest(override)),
|
|
2646
|
+
fetchArticleCards: (options, override) => fetchArticleCards(options, ...resolveRequest(override)),
|
|
2647
|
+
fetchArticleInfo: (options, override) => fetchArticleInfo(options, ...resolveRequest(override)),
|
|
2648
|
+
fetchArticleListInfo: (options, override) => fetchArticleListInfo(options, ...resolveRequest(override)),
|
|
2649
|
+
fetchLoginStatus: (options, override) => fetchLoginStatus(options, ...resolveRequest(override)),
|
|
2650
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode$1(options, ...resolveRequest(override)),
|
|
2651
|
+
checkQrcodeStatus: (options, override) => checkQrcodeStatus(options, ...resolveRequest(override)),
|
|
2652
|
+
requestCaptchaFromVoucher: (options, override) => requestCaptchaFromVoucher(options, ...resolveRequest(override)),
|
|
2653
|
+
validateCaptchaResult: (options, override) => validateCaptchaResult(options, ...resolveRequest(override)),
|
|
2654
|
+
convertAvToBv: (options, override) => convertAvToBv(options, ...resolveRequest(override)),
|
|
2655
|
+
convertBvToAv: (options, override) => convertBvToAv(options, ...resolveRequest(override)),
|
|
2656
|
+
fetchEmojiList: (options, override) => fetchEmojiList$3(options, ...resolveRequest(override))
|
|
2625
2657
|
};
|
|
2626
2658
|
}
|
|
2627
2659
|
//#endregion
|
|
@@ -5079,26 +5111,27 @@ async function fetchDanmakuList(options, cookie, requestConfig) {
|
|
|
5079
5111
|
* ```
|
|
5080
5112
|
*/
|
|
5081
5113
|
function createBoundDouyinFetcher(cookie, requestConfig) {
|
|
5114
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
5082
5115
|
return {
|
|
5083
|
-
fetchVideoWork: (options,
|
|
5084
|
-
fetchImageAlbumWork: (options,
|
|
5085
|
-
fetchSlidesWork: (options,
|
|
5086
|
-
fetchTextWork: (options,
|
|
5087
|
-
parseWork: (options,
|
|
5088
|
-
fetchDanmakuList: (options,
|
|
5089
|
-
fetchWorkComments: (options,
|
|
5090
|
-
fetchCommentReplies: (options,
|
|
5091
|
-
fetchUserProfile: (options,
|
|
5092
|
-
fetchUserVideoList: (options,
|
|
5093
|
-
fetchUserFavoriteList: (options,
|
|
5094
|
-
fetchUserRecommendList: (options,
|
|
5095
|
-
searchContent: (options,
|
|
5096
|
-
fetchSuggestWords: (options,
|
|
5097
|
-
fetchMusicInfo: (options,
|
|
5098
|
-
fetchLiveRoomInfo: (options,
|
|
5099
|
-
requestLoginQrcode: (options,
|
|
5100
|
-
fetchEmojiList: (options,
|
|
5101
|
-
fetchDynamicEmojiList: (options,
|
|
5116
|
+
fetchVideoWork: (options, override) => fetchVideoWork$1(options, ...resolveRequest(override)),
|
|
5117
|
+
fetchImageAlbumWork: (options, override) => fetchImageAlbumWork(options, ...resolveRequest(override)),
|
|
5118
|
+
fetchSlidesWork: (options, override) => fetchSlidesWork(options, ...resolveRequest(override)),
|
|
5119
|
+
fetchTextWork: (options, override) => fetchTextWork(options, ...resolveRequest(override)),
|
|
5120
|
+
parseWork: (options, override) => parseWork(options, ...resolveRequest(override)),
|
|
5121
|
+
fetchDanmakuList: (options, override) => fetchDanmakuList(options, ...resolveRequest(override)),
|
|
5122
|
+
fetchWorkComments: (options, override) => fetchWorkComments$1(options, ...resolveRequest(override)),
|
|
5123
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies(options, ...resolveRequest(override)),
|
|
5124
|
+
fetchUserProfile: (options, override) => fetchUserProfile$2(options, ...resolveRequest(override)),
|
|
5125
|
+
fetchUserVideoList: (options, override) => fetchUserVideoList(options, ...resolveRequest(override)),
|
|
5126
|
+
fetchUserFavoriteList: (options, override) => fetchUserFavoriteList(options, ...resolveRequest(override)),
|
|
5127
|
+
fetchUserRecommendList: (options, override) => fetchUserRecommendList(options, ...resolveRequest(override)),
|
|
5128
|
+
searchContent: (options, override) => searchContent(options, ...resolveRequest(override)),
|
|
5129
|
+
fetchSuggestWords: (options, override) => fetchSuggestWords(options, ...resolveRequest(override)),
|
|
5130
|
+
fetchMusicInfo: (options, override) => fetchMusicInfo(options, ...resolveRequest(override)),
|
|
5131
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$1(options, ...resolveRequest(override)),
|
|
5132
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode(options, ...resolveRequest(override)),
|
|
5133
|
+
fetchEmojiList: (options, override) => fetchEmojiList$2(options, ...resolveRequest(override)),
|
|
5134
|
+
fetchDynamicEmojiList: (options, override) => fetchDynamicEmojiList(options, ...resolveRequest(override))
|
|
5102
5135
|
};
|
|
5103
5136
|
}
|
|
5104
5137
|
//#endregion
|
|
@@ -7491,13 +7524,14 @@ const kuaishouFetcher = {
|
|
|
7491
7524
|
* ```
|
|
7492
7525
|
*/
|
|
7493
7526
|
function createBoundKuaishouFetcher(cookie, requestConfig) {
|
|
7527
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
7494
7528
|
return {
|
|
7495
|
-
fetchVideoWork: (options,
|
|
7496
|
-
fetchWorkComments: (options,
|
|
7497
|
-
fetchUserProfile: (options,
|
|
7498
|
-
fetchUserWorkList: (options,
|
|
7499
|
-
fetchLiveRoomInfo: (options,
|
|
7500
|
-
fetchEmojiList: (options,
|
|
7529
|
+
fetchVideoWork: (options, override) => fetchVideoWork(options, ...resolveRequest(override)),
|
|
7530
|
+
fetchWorkComments: (options, override) => fetchWorkComments(options, ...resolveRequest(override)),
|
|
7531
|
+
fetchUserProfile: (options, override) => fetchUserProfile$1(options, ...resolveRequest(override)),
|
|
7532
|
+
fetchUserWorkList: (options, override) => fetchUserWorkList(options, ...resolveRequest(override)),
|
|
7533
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo(options, ...resolveRequest(override)),
|
|
7534
|
+
fetchEmojiList: (options, override) => fetchEmojiList$1(options, ...resolveRequest(override))
|
|
7501
7535
|
};
|
|
7502
7536
|
}
|
|
7503
7537
|
//#endregion
|
|
@@ -7936,14 +7970,15 @@ const xiaohongshuFetcher = {
|
|
|
7936
7970
|
* ```
|
|
7937
7971
|
*/
|
|
7938
7972
|
function createBoundXiaohongshuFetcher(cookie, requestConfig) {
|
|
7973
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
7939
7974
|
return {
|
|
7940
|
-
fetchHomeFeed: (options = {},
|
|
7941
|
-
fetchNoteDetail: (options,
|
|
7942
|
-
fetchNoteComments: (options,
|
|
7943
|
-
fetchUserProfile: (options,
|
|
7944
|
-
fetchUserNoteList: (options,
|
|
7945
|
-
searchNotes: (options,
|
|
7946
|
-
fetchEmojiList: (options,
|
|
7975
|
+
fetchHomeFeed: (options = {}, override) => fetchHomeFeed(options, ...resolveRequest(override)),
|
|
7976
|
+
fetchNoteDetail: (options, override) => fetchNoteDetail(options, ...resolveRequest(override)),
|
|
7977
|
+
fetchNoteComments: (options, override) => fetchNoteComments(options, ...resolveRequest(override)),
|
|
7978
|
+
fetchUserProfile: (options, override) => fetchUserProfile(options, ...resolveRequest(override)),
|
|
7979
|
+
fetchUserNoteList: (options, override) => fetchUserNoteList(options, ...resolveRequest(override)),
|
|
7980
|
+
searchNotes: (options, override) => searchNotes(options, ...resolveRequest(override)),
|
|
7981
|
+
fetchEmojiList: (options, override) => fetchEmojiList(options, ...resolveRequest(override))
|
|
7947
7982
|
};
|
|
7948
7983
|
}
|
|
7949
7984
|
//#endregion
|
|
@@ -10223,7 +10258,7 @@ function getApiRoute(platform, methodType) {
|
|
|
10223
10258
|
* 构建后使用 __VERSION__,开发环境从 package.json 读取
|
|
10224
10259
|
*/
|
|
10225
10260
|
const getVersion = () => {
|
|
10226
|
-
return "6.
|
|
10261
|
+
return "6.4.0";
|
|
10227
10262
|
};
|
|
10228
10263
|
const VERSION = getVersion();
|
|
10229
10264
|
/**
|
package/dist/default/index.d.ts
CHANGED
|
@@ -27130,22 +27130,70 @@ interface FetcherConfig {
|
|
|
27130
27130
|
requestConfig?: RequestConfig;
|
|
27131
27131
|
}
|
|
27132
27132
|
//#endregion
|
|
27133
|
+
//#region src/model/fetchers/shared/request-types.d.ts
|
|
27134
|
+
type RequestHeaders = NonNullable<RequestConfig['headers']>;
|
|
27135
|
+
/**
|
|
27136
|
+
* 未显式覆盖 Cookie 的单次请求配置。
|
|
27137
|
+
*
|
|
27138
|
+
* Cookie 请求头必须使用大写 `Cookie`。小写 `cookie` 会被类型系统拒绝,
|
|
27139
|
+
* 避免 Axios 请求头与平台签名逻辑读取到不同字段。
|
|
27140
|
+
*/
|
|
27141
|
+
type FetcherRequestConfigWithoutCookie = Omit<RequestConfig, 'headers'> & {
|
|
27142
|
+
headers?: RequestHeaders & {
|
|
27143
|
+
Cookie?: never;
|
|
27144
|
+
cookie?: never;
|
|
27145
|
+
};
|
|
27146
|
+
};
|
|
27147
|
+
/**
|
|
27148
|
+
* 显式覆盖 Cookie 的单次请求配置。
|
|
27149
|
+
*
|
|
27150
|
+
* 裸 Fetcher 会把 `Cookie` 的字符串字面量与 cookie 参数关联起来:
|
|
27151
|
+
* 两处必须传入相同的值。
|
|
27152
|
+
*/
|
|
27153
|
+
type FetcherRequestConfigWithCookie<TCookie extends string> = Omit<RequestConfig, 'headers'> & {
|
|
27154
|
+
headers: RequestHeaders & {
|
|
27155
|
+
Cookie: TCookie;
|
|
27156
|
+
cookie?: never;
|
|
27157
|
+
};
|
|
27158
|
+
};
|
|
27159
|
+
/** 裸 Fetcher 匿名请求使用的严格配置。 */
|
|
27160
|
+
type AnonymousFetcherRequestConfig = FetcherRequestConfigWithCookie<''>;
|
|
27161
|
+
/**
|
|
27162
|
+
* 根据裸 Fetcher 的单次请求配置推导 cookie 参数类型。
|
|
27163
|
+
*
|
|
27164
|
+
* - 大写 `Cookie`:cookie 参数必须与请求头字符串字面量一致。
|
|
27165
|
+
* - 小写 `cookie`:返回 `never`,拒绝大小写错误。
|
|
27166
|
+
* - 未显式声明 Cookie:保持原有的可选字符串参数。
|
|
27167
|
+
*/
|
|
27168
|
+
type FetcherCookieForRequestConfig<TRequestConfig extends RequestConfig> = TRequestConfig extends {
|
|
27169
|
+
headers: infer THeaders;
|
|
27170
|
+
} ? THeaders extends {
|
|
27171
|
+
cookie: unknown;
|
|
27172
|
+
} ? never : THeaders extends {
|
|
27173
|
+
Cookie: infer TCookie;
|
|
27174
|
+
} ? TCookie extends string ? TCookie : never : string | undefined : string | undefined;
|
|
27175
|
+
//#endregion
|
|
27133
27176
|
//#region src/model/fetchers/shared/overload-types.d.ts
|
|
27134
27177
|
/**
|
|
27135
27178
|
* 为单个方法生成函数重载类型
|
|
27136
27179
|
* @template TOptions - 方法的选项参数类型
|
|
27137
27180
|
* @template TStrictReturn - typeMode='strict' 时的返回类型
|
|
27138
|
-
* @template TCookie - Cookie 参数类型(可选)
|
|
27139
|
-
* @template TRequestConfig - 请求配置参数类型(可选)
|
|
27140
27181
|
*/
|
|
27141
|
-
type MethodOverload<TOptions, TStrictReturn
|
|
27182
|
+
type MethodOverload<TOptions, TStrictReturn> = {
|
|
27142
27183
|
(options: TOptions & {
|
|
27143
27184
|
typeMode: 'strict';
|
|
27144
|
-
},
|
|
27145
|
-
|
|
27185
|
+
}, cookie?: string): Promise<Result<TStrictReturn>>;
|
|
27186
|
+
<const TRequestConfig extends RequestConfig>(options: TOptions & {
|
|
27187
|
+
typeMode: 'strict';
|
|
27188
|
+
}, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<TStrictReturn>>;
|
|
27189
|
+
(options: TOptions, cookie?: string): Promise<Result<any>>;
|
|
27190
|
+
<const TRequestConfig extends RequestConfig>(options: TOptions, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<any>>;
|
|
27146
27191
|
};
|
|
27147
27192
|
/**
|
|
27148
27193
|
* 为绑定 Cookie 的方法生成函数重载类型(少了 cookie 参数)
|
|
27194
|
+
*
|
|
27195
|
+
* 第二个参数用于覆盖当前调用的请求配置。绑定 Fetcher 的实现会将它与
|
|
27196
|
+
* 实例级配置合并,不会修改实例本身。
|
|
27149
27197
|
*/
|
|
27150
27198
|
type BoundMethodOverload<TOptions, TStrictReturn, TRequestConfig extends RequestConfig | undefined = RequestConfig | undefined> = {
|
|
27151
27199
|
(options: TOptions & {
|
|
@@ -27156,16 +27204,24 @@ type BoundMethodOverload<TOptions, TStrictReturn, TRequestConfig extends Request
|
|
|
27156
27204
|
/**
|
|
27157
27205
|
* 为无参数方法生成函数重载类型
|
|
27158
27206
|
*/
|
|
27159
|
-
type NoParamMethodOverload<TStrictReturn
|
|
27207
|
+
type NoParamMethodOverload<TStrictReturn> = {
|
|
27160
27208
|
(options: {
|
|
27161
27209
|
typeMode: 'strict';
|
|
27162
|
-
},
|
|
27210
|
+
}, cookie?: string): Promise<Result<TStrictReturn>>;
|
|
27211
|
+
<const TRequestConfig extends RequestConfig>(options: {
|
|
27212
|
+
typeMode: 'strict';
|
|
27213
|
+
}, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<TStrictReturn>>;
|
|
27163
27214
|
(options?: {
|
|
27164
27215
|
typeMode?: TypeMode;
|
|
27165
|
-
},
|
|
27216
|
+
}, cookie?: string): Promise<Result<any>>;
|
|
27217
|
+
<const TRequestConfig extends RequestConfig>(options: {
|
|
27218
|
+
typeMode?: TypeMode;
|
|
27219
|
+
} | undefined, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<any>>;
|
|
27166
27220
|
};
|
|
27167
27221
|
/**
|
|
27168
27222
|
* 为绑定 Cookie 的无参数方法生成函数重载类型
|
|
27223
|
+
*
|
|
27224
|
+
* `requestConfig` 只影响当前调用,并由绑定 Fetcher 与实例级配置合并。
|
|
27169
27225
|
*/
|
|
27170
27226
|
type BoundNoParamMethodOverload<TStrictReturn, TRequestConfig extends RequestConfig | undefined = RequestConfig | undefined> = {
|
|
27171
27227
|
(options: {
|
|
@@ -27178,14 +27234,20 @@ type BoundNoParamMethodOverload<TStrictReturn, TRequestConfig extends RequestCon
|
|
|
27178
27234
|
/**
|
|
27179
27235
|
* 为带可选参数的方法生成函数重载类型(参数可选但可能包含额外字段)
|
|
27180
27236
|
*/
|
|
27181
|
-
type OptionalParamMethodOverload<TOptions, TStrictReturn
|
|
27237
|
+
type OptionalParamMethodOverload<TOptions, TStrictReturn> = {
|
|
27182
27238
|
(options: TOptions & {
|
|
27183
27239
|
typeMode: 'strict';
|
|
27184
|
-
},
|
|
27185
|
-
|
|
27240
|
+
}, cookie?: string): Promise<Result<TStrictReturn>>;
|
|
27241
|
+
<const TRequestConfig extends RequestConfig>(options: TOptions & {
|
|
27242
|
+
typeMode: 'strict';
|
|
27243
|
+
}, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<TStrictReturn>>;
|
|
27244
|
+
(options?: TOptions, cookie?: string): Promise<Result<any>>;
|
|
27245
|
+
<const TRequestConfig extends RequestConfig>(options: TOptions | undefined, cookie: NoInfer<FetcherCookieForRequestConfig<TRequestConfig>>, requestConfig: TRequestConfig): Promise<Result<any>>;
|
|
27186
27246
|
};
|
|
27187
27247
|
/**
|
|
27188
27248
|
* 为绑定 Cookie 的带可选参数方法生成函数重载类型
|
|
27249
|
+
*
|
|
27250
|
+
* `requestConfig` 只影响当前调用,并由绑定 Fetcher 与实例级配置合并。
|
|
27189
27251
|
*/
|
|
27190
27252
|
type BoundOptionalParamMethodOverload<TOptions, TStrictReturn, TRequestConfig extends RequestConfig | undefined = RequestConfig | undefined> = {
|
|
27191
27253
|
(options: TOptions & {
|
|
@@ -29190,5 +29252,5 @@ declare const amagi: typeof Client;
|
|
|
29190
29252
|
* GPL-3.0 Licensed
|
|
29191
29253
|
*/
|
|
29192
29254
|
//#endregion
|
|
29193
|
-
export { APIErrorType, AdditionalType, AmagiEventMap, AmagiEventType, type ApiEndpoint, ApiError, ApiErrorEventData, ApiResponse, ApiSuccessEventData, ArticleCard, ArticleContent, ArticleInfo, ArticleWork, BaseRequestOptions, BaseResponse, BiliAv2Bv, BiliBangumiVideoInfo, BiliBangumiVideoPlayurlIsLogin, BiliBangumiVideoPlayurlNoLogin, BiliBiliVideoPlayurlNoLogin, BiliBv2AV, BiliCheckQrcode, BiliCommentReply, BiliDynamicCard, BiliDynamicInfo, BiliDynamicInfoUnion, BiliEmojiList, BiliLiveRoomDef, BiliLiveRoomDetail, BiliNewLoginQrcode, BiliOneWork, BiliProtobufDanmaku, BiliUserDynamic, BiliUserFullView, BiliUserLiveStatus, BiliUserProfile, BiliVideoPlayurlIsLogin, BiliWorkComments, BilibiliApiRoutes, type BilibiliApplyCaptchaOptions, BilibiliApplyCaptchaParamsSchema, type BilibiliArticleCardOptions, BilibiliArticleCardParamsSchema, BilibiliArticleInfoParamsSchema, type BilibiliArticleOptions, BilibiliArticleParamsSchema, type BilibiliAv2BvOptions, BilibiliAv2BvParamsSchema, type BilibiliBangumiInfoOptions, BilibiliBangumiInfoParamsSchema, type BilibiliBangumiStreamOptions, BilibiliBangumiStreamParamsSchema, type BilibiliBv2AvOptions, BilibiliBv2AvParamsSchema, BilibiliColumnInfoParamsSchema, BilibiliCommentParamsSchema, type BilibiliCommentRepliesOptions, BilibiliCommentReplyParamsSchema, type BilibiliCommentsOptions, type BilibiliDanmakuOptions, BilibiliDanmakuParamsSchema, BilibiliDataOptions, BilibiliDataOptionsMap, type BilibiliDynamicOptions, BilibiliDynamicParamsSchema, BilibiliEmojiParamsSchema, type BilibiliFetcher, BilibiliFetcherMethodKey, BilibiliFetcherMethods, BilibiliInternalMethodKey, BilibiliInternalMethods, BilibiliLiveParamsSchema, type BilibiliLiveRoomOptions, BilibiliLoginParamsSchema, type BilibiliMethodKey, BilibiliMethodMapping, BilibiliMethodOptMap, BilibiliMethodOptionsMap, BilibiliMethodRoutes, BilibiliMethodToFetcher, BilibiliMethodType, type BilibiliMethodValue, BilibiliQrcodeParamsSchema, type BilibiliQrcodeStatusOptions, BilibiliQrcodeStatusParamsSchema, BilibiliReturnTypeMap, type BilibiliUserOptions, BilibiliUserParamsSchema, type BilibiliValidateCaptchaOptions, BilibiliValidateCaptchaParamsSchema, BilibiliValidationSchemas, BilibiliVideoDownloadParamsSchema, type BilibiliVideoInfoOptions, BilibiliVideoParamsSchema, type BilibiliVideoStreamOptions, BoundBilibiliApi, type BoundBilibiliFetcher, BoundDouyinApi, type BoundDouyinFetcher, BoundKuaishouApi, type BoundKuaishouFetcher, BoundXiaohongshuApi, type BoundXiaohongshuFetcher, ColumnInfo, CommentReply, CommentType, ConditionalReturnType, CookieConfig, CreateApp, DouyinApiRoutes, DouyinCommentParamsSchema, type DouyinCommentRepliesOptions, DouyinCommentReplyParamsSchema, type DouyinCommentsOptions, type DouyinDanmakuOptions, DouyinDanmakuParamsSchema, DouyinDataOptions, DouyinDataOptionsMap, DouyinEmojiListParamsSchema, DouyinEmojiProParamsSchema, type DouyinFetcher, DouyinFetcherMethodKey, DouyinFetcherMethods, DouyinHotWordsParamsSchema, DouyinInternalMethodKey, DouyinInternalMethods, type DouyinLiveRoomOptions, DouyinLiveRoomParamsSchema, type DouyinMethodKey, DouyinMethodMapping, DouyinMethodOptMap, DouyinMethodOptionsMap, DouyinMethodRoutes, DouyinMethodToFetcher, DouyinMethodType, type DouyinMethodValue, type DouyinMusicOptions, DouyinMusicParamsSchema, type DouyinQrcodeOptions, DouyinQrcodeParamsSchema, DouyinReturnTypeMap, type DouyinSearchOptions, DouyinSearchParamsSchema, type DouyinSuggestWordsOptions, type DouyinUserListOptions, DouyinUserListParamsSchema, type DouyinUserOptions, DouyinUserParamsSchema, DouyinValidationSchemas, type DouyinWorkOptions, DouyinWorkParamsSchema, DyDanmakuList, DyEmojiList, DyEmojiProList, DyImageAlbumWork, DyMusicWork, DySearchInfo, DySlidesWork, DySuggestWords, DyUserInfo, DyUserLiveVideos, DyUserPostVideos, DyVideoWork, DyWorkComments, DynamicType, DynamicTypeAV, DynamicTypeArticle, DynamicTypeDraw, DynamicTypeForward, DynamicTypeForwardUnion, DynamicTypeLiveRcmd, DynamicTypeWord, ErrorResult, ExtractTypeMode, FetcherConfig, HomeFeed, type HttpMethod, HttpRequestEventData, HttpResponseEventData, type IBilibiliFetcher, type IBoundBilibiliFetcher, type IBoundDouyinFetcher, type IBoundKuaishouFetcher, type IBoundXiaohongshuFetcher, type IDouyinFetcher, type IKuaishouFetcher, type IXiaohongshuFetcher, type KsBannedStatus, KsEmojiList, KsLiveRoomInfo, KsOneWork, type KsUserHomeWork, KsUserProfile, type KsUserProfileCounts, type KsUserProfileGameInfo, type KsUserProfileLiveInfo, type KsUserProfileSensitiveInfo, type KsUserProfileUserInfo, KsUserWorkList, type KsVerifiedStatus, KsWorkComments, KuaishouApiRoutes, KuaishouCommentParamsSchema, type KuaishouCommentsOptions, KuaishouDataOptions, KuaishouDataOptionsMap, KuaishouEmojiParamsSchema, type KuaishouFetcher, KuaishouFetcherMethodKey, KuaishouFetcherMethods, type KuaishouGraphqlRequest, KuaishouInternalMethodKey, KuaishouInternalMethods, type KuaishouLiveApiRequest, type KuaishouLiveRoomInfoOptions, KuaishouLiveRoomInfoParamsSchema, type KuaishouMethodKey, KuaishouMethodMapping, KuaishouMethodOptMap, KuaishouMethodOptionsMap, KuaishouMethodRoutes, KuaishouMethodToFetcher, KuaishouMethodType, type KuaishouMethodValue, KuaishouReturnTypeMap, type KuaishouUserProfileOptions, KuaishouUserProfileParamsSchema, type KuaishouUserWorkListOptions, KuaishouUserWorkListParamsSchema, KuaishouValidationSchemas, KuaishouVideoParamsSchema, type KuaishouVideoWorkOptions, LogEventData, MajorType, MethodMaps, NetworkErrorEventData, NetworkRetryEventData, type NetworksConfigType, NoteComments, OmitMethodType, OneNote, Options, type Platform, RequestConfig, Result, SearchInfoGeneralData, SearchInfoUser, SearchInfoVideo, SearchNotes, SuccessResult, TypeControl, TypeMode, ValidationError, XiaohongshuApiRoutes, type XiaohongshuCommentsOptions, XiaohongshuDataOptions, XiaohongshuDataOptionsMap, XiaohongshuEmojiList, type XiaohongshuFetcher, XiaohongshuFetcherMethodKey, XiaohongshuFetcherMethods, type XiaohongshuHomeFeedOptions, XiaohongshuInternalMethodKey, XiaohongshuInternalMethods, type XiaohongshuMethodKey, XiaohongshuMethodMapping, XiaohongshuMethodOptMap, XiaohongshuMethodOptionsMap, XiaohongshuMethodRoutes, XiaohongshuMethodToFetcher, XiaohongshuMethodType, type XiaohongshuMethodValue, type XiaohongshuNoteDetailOptions, XiaohongshuReturnTypeMap, type XiaohongshuSearchNotesOptions, type XiaohongshuUserNotesOptions, XiaohongshuUserProfile, type XiaohongshuUserProfileOptions, XiaohongshuValidationSchemas, amagi, amagiClient, amagiEvents, av2bv, bilibili, bilibiliApiUrls, bilibiliErrorCodeMap, bilibiliFetcher, bilibiliUtils, bv2av, createAmagiClient, createBilibiliRoutes, createBilibiliRoutes as registerBilibiliRoutes, createBoundBilibiliApi, createBoundBilibiliFetcher, createBoundDouyinApi, createBoundDouyinFetcher, createBoundKuaishouApi, createBoundKuaishouFetcher, createBoundXiaohongshuApi, createBoundXiaohongshuFetcher, createDouyinRoutes, createDouyinRoutes as registerDouyinRoutes, createErrorResponse, createKuaishouRoutes, createKuaishouRoutes as registerKuaishouRoutes, createSuccessResponse, createXiaohongshuRoutes, createXiaohongshuRoutes as registerXiaohongshuRoutes, Client as default, douyin, douyinApiUrls, douyinFetcher, douyinSign, douyinUtils, emitApiError, emitApiSuccess, emitHttpRequest, emitHttpResponse, emitLog, emitLogDebug, emitLogError, emitLogInfo, emitLogMark, emitLogWarn, emitNetworkError, emitNetworkRetry, fetchData, fetchResponse, getApiRoute, getBilibiliData, getDouyinData, getEnglishMethodName, getHeadersAndData, getKuaishouData, handleError, httpLogger, initLogger, isNetworkErrorResult, kuaishou, kuaishouApiUrls, kuaishouFetcher, kuaishouSign, kuaishouUtils, logMiddleware, logger, parseDmSegMobileReply, qtparam, toFetcherMethod, validateBilibiliParams, validateDouyinParams, validateKuaishouParams, validateXiaohongshuParams, wbi_sign, xiaohongshu, xiaohongshuApiUrls, xiaohongshuFetcher, xiaohongshuSign, xiaohongshuUtils };
|
|
29255
|
+
export { APIErrorType, AdditionalType, AmagiEventMap, AmagiEventType, type AnonymousFetcherRequestConfig, type ApiEndpoint, ApiError, ApiErrorEventData, ApiResponse, ApiSuccessEventData, ArticleCard, ArticleContent, ArticleInfo, ArticleWork, BaseRequestOptions, BaseResponse, BiliAv2Bv, BiliBangumiVideoInfo, BiliBangumiVideoPlayurlIsLogin, BiliBangumiVideoPlayurlNoLogin, BiliBiliVideoPlayurlNoLogin, BiliBv2AV, BiliCheckQrcode, BiliCommentReply, BiliDynamicCard, BiliDynamicInfo, BiliDynamicInfoUnion, BiliEmojiList, BiliLiveRoomDef, BiliLiveRoomDetail, BiliNewLoginQrcode, BiliOneWork, BiliProtobufDanmaku, BiliUserDynamic, BiliUserFullView, BiliUserLiveStatus, BiliUserProfile, BiliVideoPlayurlIsLogin, BiliWorkComments, BilibiliApiRoutes, type BilibiliApplyCaptchaOptions, BilibiliApplyCaptchaParamsSchema, type BilibiliArticleCardOptions, BilibiliArticleCardParamsSchema, BilibiliArticleInfoParamsSchema, type BilibiliArticleOptions, BilibiliArticleParamsSchema, type BilibiliAv2BvOptions, BilibiliAv2BvParamsSchema, type BilibiliBangumiInfoOptions, BilibiliBangumiInfoParamsSchema, type BilibiliBangumiStreamOptions, BilibiliBangumiStreamParamsSchema, type BilibiliBv2AvOptions, BilibiliBv2AvParamsSchema, BilibiliColumnInfoParamsSchema, BilibiliCommentParamsSchema, type BilibiliCommentRepliesOptions, BilibiliCommentReplyParamsSchema, type BilibiliCommentsOptions, type BilibiliDanmakuOptions, BilibiliDanmakuParamsSchema, BilibiliDataOptions, BilibiliDataOptionsMap, type BilibiliDynamicOptions, BilibiliDynamicParamsSchema, BilibiliEmojiParamsSchema, type BilibiliFetcher, BilibiliFetcherMethodKey, BilibiliFetcherMethods, BilibiliInternalMethodKey, BilibiliInternalMethods, BilibiliLiveParamsSchema, type BilibiliLiveRoomOptions, BilibiliLoginParamsSchema, type BilibiliMethodKey, BilibiliMethodMapping, BilibiliMethodOptMap, BilibiliMethodOptionsMap, BilibiliMethodRoutes, BilibiliMethodToFetcher, BilibiliMethodType, type BilibiliMethodValue, BilibiliQrcodeParamsSchema, type BilibiliQrcodeStatusOptions, BilibiliQrcodeStatusParamsSchema, BilibiliReturnTypeMap, type BilibiliUserOptions, BilibiliUserParamsSchema, type BilibiliValidateCaptchaOptions, BilibiliValidateCaptchaParamsSchema, BilibiliValidationSchemas, BilibiliVideoDownloadParamsSchema, type BilibiliVideoInfoOptions, BilibiliVideoParamsSchema, type BilibiliVideoStreamOptions, BoundBilibiliApi, type BoundBilibiliFetcher, BoundDouyinApi, type BoundDouyinFetcher, BoundKuaishouApi, type BoundKuaishouFetcher, BoundXiaohongshuApi, type BoundXiaohongshuFetcher, ColumnInfo, CommentReply, CommentType, ConditionalReturnType, CookieConfig, CreateApp, DouyinApiRoutes, DouyinCommentParamsSchema, type DouyinCommentRepliesOptions, DouyinCommentReplyParamsSchema, type DouyinCommentsOptions, type DouyinDanmakuOptions, DouyinDanmakuParamsSchema, DouyinDataOptions, DouyinDataOptionsMap, DouyinEmojiListParamsSchema, DouyinEmojiProParamsSchema, type DouyinFetcher, DouyinFetcherMethodKey, DouyinFetcherMethods, DouyinHotWordsParamsSchema, DouyinInternalMethodKey, DouyinInternalMethods, type DouyinLiveRoomOptions, DouyinLiveRoomParamsSchema, type DouyinMethodKey, DouyinMethodMapping, DouyinMethodOptMap, DouyinMethodOptionsMap, DouyinMethodRoutes, DouyinMethodToFetcher, DouyinMethodType, type DouyinMethodValue, type DouyinMusicOptions, DouyinMusicParamsSchema, type DouyinQrcodeOptions, DouyinQrcodeParamsSchema, DouyinReturnTypeMap, type DouyinSearchOptions, DouyinSearchParamsSchema, type DouyinSuggestWordsOptions, type DouyinUserListOptions, DouyinUserListParamsSchema, type DouyinUserOptions, DouyinUserParamsSchema, DouyinValidationSchemas, type DouyinWorkOptions, DouyinWorkParamsSchema, DyDanmakuList, DyEmojiList, DyEmojiProList, DyImageAlbumWork, DyMusicWork, DySearchInfo, DySlidesWork, DySuggestWords, DyUserInfo, DyUserLiveVideos, DyUserPostVideos, DyVideoWork, DyWorkComments, DynamicType, DynamicTypeAV, DynamicTypeArticle, DynamicTypeDraw, DynamicTypeForward, DynamicTypeForwardUnion, DynamicTypeLiveRcmd, DynamicTypeWord, ErrorResult, ExtractTypeMode, FetcherConfig, type FetcherCookieForRequestConfig, type FetcherRequestConfigWithCookie, type FetcherRequestConfigWithoutCookie, HomeFeed, type HttpMethod, HttpRequestEventData, HttpResponseEventData, type IBilibiliFetcher, type IBoundBilibiliFetcher, type IBoundDouyinFetcher, type IBoundKuaishouFetcher, type IBoundXiaohongshuFetcher, type IDouyinFetcher, type IKuaishouFetcher, type IXiaohongshuFetcher, type KsBannedStatus, KsEmojiList, KsLiveRoomInfo, KsOneWork, type KsUserHomeWork, KsUserProfile, type KsUserProfileCounts, type KsUserProfileGameInfo, type KsUserProfileLiveInfo, type KsUserProfileSensitiveInfo, type KsUserProfileUserInfo, KsUserWorkList, type KsVerifiedStatus, KsWorkComments, KuaishouApiRoutes, KuaishouCommentParamsSchema, type KuaishouCommentsOptions, KuaishouDataOptions, KuaishouDataOptionsMap, KuaishouEmojiParamsSchema, type KuaishouFetcher, KuaishouFetcherMethodKey, KuaishouFetcherMethods, type KuaishouGraphqlRequest, KuaishouInternalMethodKey, KuaishouInternalMethods, type KuaishouLiveApiRequest, type KuaishouLiveRoomInfoOptions, KuaishouLiveRoomInfoParamsSchema, type KuaishouMethodKey, KuaishouMethodMapping, KuaishouMethodOptMap, KuaishouMethodOptionsMap, KuaishouMethodRoutes, KuaishouMethodToFetcher, KuaishouMethodType, type KuaishouMethodValue, KuaishouReturnTypeMap, type KuaishouUserProfileOptions, KuaishouUserProfileParamsSchema, type KuaishouUserWorkListOptions, KuaishouUserWorkListParamsSchema, KuaishouValidationSchemas, KuaishouVideoParamsSchema, type KuaishouVideoWorkOptions, LogEventData, MajorType, MethodMaps, NetworkErrorEventData, NetworkRetryEventData, type NetworksConfigType, NoteComments, OmitMethodType, OneNote, Options, type Platform, RequestConfig, Result, SearchInfoGeneralData, SearchInfoUser, SearchInfoVideo, SearchNotes, SuccessResult, TypeControl, TypeMode, ValidationError, XiaohongshuApiRoutes, type XiaohongshuCommentsOptions, XiaohongshuDataOptions, XiaohongshuDataOptionsMap, XiaohongshuEmojiList, type XiaohongshuFetcher, XiaohongshuFetcherMethodKey, XiaohongshuFetcherMethods, type XiaohongshuHomeFeedOptions, XiaohongshuInternalMethodKey, XiaohongshuInternalMethods, type XiaohongshuMethodKey, XiaohongshuMethodMapping, XiaohongshuMethodOptMap, XiaohongshuMethodOptionsMap, XiaohongshuMethodRoutes, XiaohongshuMethodToFetcher, XiaohongshuMethodType, type XiaohongshuMethodValue, type XiaohongshuNoteDetailOptions, XiaohongshuReturnTypeMap, type XiaohongshuSearchNotesOptions, type XiaohongshuUserNotesOptions, XiaohongshuUserProfile, type XiaohongshuUserProfileOptions, XiaohongshuValidationSchemas, amagi, amagiClient, amagiEvents, av2bv, bilibili, bilibiliApiUrls, bilibiliErrorCodeMap, bilibiliFetcher, bilibiliUtils, bv2av, createAmagiClient, createBilibiliRoutes, createBilibiliRoutes as registerBilibiliRoutes, createBoundBilibiliApi, createBoundBilibiliFetcher, createBoundDouyinApi, createBoundDouyinFetcher, createBoundKuaishouApi, createBoundKuaishouFetcher, createBoundXiaohongshuApi, createBoundXiaohongshuFetcher, createDouyinRoutes, createDouyinRoutes as registerDouyinRoutes, createErrorResponse, createKuaishouRoutes, createKuaishouRoutes as registerKuaishouRoutes, createSuccessResponse, createXiaohongshuRoutes, createXiaohongshuRoutes as registerXiaohongshuRoutes, Client as default, douyin, douyinApiUrls, douyinFetcher, douyinSign, douyinUtils, emitApiError, emitApiSuccess, emitHttpRequest, emitHttpResponse, emitLog, emitLogDebug, emitLogError, emitLogInfo, emitLogMark, emitLogWarn, emitNetworkError, emitNetworkRetry, fetchData, fetchResponse, getApiRoute, getBilibiliData, getDouyinData, getEnglishMethodName, getHeadersAndData, getKuaishouData, handleError, httpLogger, initLogger, isNetworkErrorResult, kuaishou, kuaishouApiUrls, kuaishouFetcher, kuaishouSign, kuaishouUtils, logMiddleware, logger, parseDmSegMobileReply, qtparam, toFetcherMethod, validateBilibiliParams, validateDouyinParams, validateKuaishouParams, validateXiaohongshuParams, wbi_sign, xiaohongshu, xiaohongshuApiUrls, xiaohongshuFetcher, xiaohongshuSign, xiaohongshuUtils };
|
|
29194
29256
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/default/index.mjs
CHANGED
|
@@ -2566,6 +2566,37 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2566
2566
|
});
|
|
2567
2567
|
}
|
|
2568
2568
|
//#endregion
|
|
2569
|
+
//#region src/model/fetchers/shared/request-config.ts
|
|
2570
|
+
/**
|
|
2571
|
+
* 合并 Fetcher 的实例级请求配置与单次请求配置。
|
|
2572
|
+
*
|
|
2573
|
+
* 单次配置优先,请求头单独合并。函数不会修改任一入参,因此同一绑定
|
|
2574
|
+
* Fetcher 可以安全地在并发任务中为不同请求使用不同配置。
|
|
2575
|
+
*/
|
|
2576
|
+
const mergeRequestConfig = (base, override) => {
|
|
2577
|
+
if (!override) return base;
|
|
2578
|
+
return {
|
|
2579
|
+
...base ?? {},
|
|
2580
|
+
...override,
|
|
2581
|
+
headers: {
|
|
2582
|
+
...base?.headers ?? {},
|
|
2583
|
+
...override.headers ?? {}
|
|
2584
|
+
}
|
|
2585
|
+
};
|
|
2586
|
+
};
|
|
2587
|
+
/**
|
|
2588
|
+
* 解析绑定 Fetcher 当前调用实际使用的 cookie 与请求配置。
|
|
2589
|
+
*
|
|
2590
|
+
* 实例级或单次配置显式提供大写 `headers.Cookie` 时,合并后的值同时替换
|
|
2591
|
+
* 底层 Fetcher 的 cookie 参数,确保平台签名、前置请求和最终请求处于同一身份状态。
|
|
2592
|
+
*/
|
|
2593
|
+
const resolveBoundRequest = (boundCookie, base, override) => {
|
|
2594
|
+
const requestConfig = mergeRequestConfig(base, override);
|
|
2595
|
+
const headers = requestConfig?.headers;
|
|
2596
|
+
const cookieOverride = Boolean(headers && Object.prototype.hasOwnProperty.call(headers, "Cookie")) ? headers.Cookie : void 0;
|
|
2597
|
+
return [typeof cookieOverride === "string" ? cookieOverride : boundCookie, requestConfig];
|
|
2598
|
+
};
|
|
2599
|
+
//#endregion
|
|
2569
2600
|
//#region src/model/fetchers/bilibili/bound.ts
|
|
2570
2601
|
/**
|
|
2571
2602
|
* 创建绑定了 Cookie 和请求配置的 B站 Fetcher
|
|
@@ -2581,36 +2612,37 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2581
2612
|
* ```
|
|
2582
2613
|
*/
|
|
2583
2614
|
function createBoundBilibiliFetcher(cookie, requestConfig) {
|
|
2615
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
2584
2616
|
return {
|
|
2585
|
-
fetchVideoInfo: (options) => fetchVideoInfo(options,
|
|
2586
|
-
fetchVideoStreamUrl: (options) => fetchVideoStreamUrl(options,
|
|
2587
|
-
fetchVideoDanmaku: (options) => fetchVideoDanmaku(options,
|
|
2588
|
-
fetchComments: (options) => fetchComments(options,
|
|
2589
|
-
fetchCommentReplies: (options) => fetchCommentReplies$1(options,
|
|
2590
|
-
fetchUserCard: (options) => fetchUserCard(options,
|
|
2591
|
-
fetchUserDynamicList: (options) => fetchUserDynamicList(options,
|
|
2592
|
-
fetchUserLiveStatus: (options) => fetchUserLiveStatus(options,
|
|
2593
|
-
fetchUserSpaceInfo: (options) => fetchUserSpaceInfo(options,
|
|
2594
|
-
fetchUploaderTotalViews: (options) => fetchUploaderTotalViews(options,
|
|
2595
|
-
fetchDynamicDetail: (options) => fetchDynamicDetail(options,
|
|
2617
|
+
fetchVideoInfo: (options, override) => fetchVideoInfo(options, ...resolveRequest(override)),
|
|
2618
|
+
fetchVideoStreamUrl: (options, override) => fetchVideoStreamUrl(options, ...resolveRequest(override)),
|
|
2619
|
+
fetchVideoDanmaku: (options, override) => fetchVideoDanmaku(options, ...resolveRequest(override)),
|
|
2620
|
+
fetchComments: (options, override) => fetchComments(options, ...resolveRequest(override)),
|
|
2621
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies$1(options, ...resolveRequest(override)),
|
|
2622
|
+
fetchUserCard: (options, override) => fetchUserCard(options, ...resolveRequest(override)),
|
|
2623
|
+
fetchUserDynamicList: (options, override) => fetchUserDynamicList(options, ...resolveRequest(override)),
|
|
2624
|
+
fetchUserLiveStatus: (options, override) => fetchUserLiveStatus(options, ...resolveRequest(override)),
|
|
2625
|
+
fetchUserSpaceInfo: (options, override) => fetchUserSpaceInfo(options, ...resolveRequest(override)),
|
|
2626
|
+
fetchUploaderTotalViews: (options, override) => fetchUploaderTotalViews(options, ...resolveRequest(override)),
|
|
2627
|
+
fetchDynamicDetail: (options, override) => fetchDynamicDetail(options, ...resolveRequest(override)),
|
|
2596
2628
|
/** @deprecated v6.1.3 已废弃,调用将返回错误信息 */
|
|
2597
|
-
fetchDynamicCard: (options) => fetchDynamicCard(options,
|
|
2598
|
-
fetchBangumiInfo: (options) => fetchBangumiInfo(options,
|
|
2599
|
-
fetchBangumiStreamUrl: (options) => fetchBangumiStreamUrl(options,
|
|
2600
|
-
fetchLiveRoomInfo: (options) => fetchLiveRoomInfo$2(options,
|
|
2601
|
-
fetchLiveRoomInitInfo: (options) => fetchLiveRoomInitInfo(options,
|
|
2602
|
-
fetchArticleContent: (options) => fetchArticleContent(options,
|
|
2603
|
-
fetchArticleCards: (options) => fetchArticleCards(options,
|
|
2604
|
-
fetchArticleInfo: (options) => fetchArticleInfo(options,
|
|
2605
|
-
fetchArticleListInfo: (options) => fetchArticleListInfo(options,
|
|
2606
|
-
fetchLoginStatus: (options) => fetchLoginStatus(options,
|
|
2607
|
-
requestLoginQrcode: (options) => requestLoginQrcode$1(options,
|
|
2608
|
-
checkQrcodeStatus: (options) => checkQrcodeStatus(options,
|
|
2609
|
-
requestCaptchaFromVoucher: (options) => requestCaptchaFromVoucher(options,
|
|
2610
|
-
validateCaptchaResult: (options) => validateCaptchaResult(options,
|
|
2611
|
-
convertAvToBv: (options) => convertAvToBv(options,
|
|
2612
|
-
convertBvToAv: (options) => convertBvToAv(options,
|
|
2613
|
-
fetchEmojiList: (options) => fetchEmojiList$3(options,
|
|
2629
|
+
fetchDynamicCard: (options, override) => fetchDynamicCard(options, ...resolveRequest(override)),
|
|
2630
|
+
fetchBangumiInfo: (options, override) => fetchBangumiInfo(options, ...resolveRequest(override)),
|
|
2631
|
+
fetchBangumiStreamUrl: (options, override) => fetchBangumiStreamUrl(options, ...resolveRequest(override)),
|
|
2632
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$2(options, ...resolveRequest(override)),
|
|
2633
|
+
fetchLiveRoomInitInfo: (options, override) => fetchLiveRoomInitInfo(options, ...resolveRequest(override)),
|
|
2634
|
+
fetchArticleContent: (options, override) => fetchArticleContent(options, ...resolveRequest(override)),
|
|
2635
|
+
fetchArticleCards: (options, override) => fetchArticleCards(options, ...resolveRequest(override)),
|
|
2636
|
+
fetchArticleInfo: (options, override) => fetchArticleInfo(options, ...resolveRequest(override)),
|
|
2637
|
+
fetchArticleListInfo: (options, override) => fetchArticleListInfo(options, ...resolveRequest(override)),
|
|
2638
|
+
fetchLoginStatus: (options, override) => fetchLoginStatus(options, ...resolveRequest(override)),
|
|
2639
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode$1(options, ...resolveRequest(override)),
|
|
2640
|
+
checkQrcodeStatus: (options, override) => checkQrcodeStatus(options, ...resolveRequest(override)),
|
|
2641
|
+
requestCaptchaFromVoucher: (options, override) => requestCaptchaFromVoucher(options, ...resolveRequest(override)),
|
|
2642
|
+
validateCaptchaResult: (options, override) => validateCaptchaResult(options, ...resolveRequest(override)),
|
|
2643
|
+
convertAvToBv: (options, override) => convertAvToBv(options, ...resolveRequest(override)),
|
|
2644
|
+
convertBvToAv: (options, override) => convertBvToAv(options, ...resolveRequest(override)),
|
|
2645
|
+
fetchEmojiList: (options, override) => fetchEmojiList$3(options, ...resolveRequest(override))
|
|
2614
2646
|
};
|
|
2615
2647
|
}
|
|
2616
2648
|
//#endregion
|
|
@@ -5068,26 +5100,27 @@ async function fetchDanmakuList(options, cookie, requestConfig) {
|
|
|
5068
5100
|
* ```
|
|
5069
5101
|
*/
|
|
5070
5102
|
function createBoundDouyinFetcher(cookie, requestConfig) {
|
|
5103
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
5071
5104
|
return {
|
|
5072
|
-
fetchVideoWork: (options,
|
|
5073
|
-
fetchImageAlbumWork: (options,
|
|
5074
|
-
fetchSlidesWork: (options,
|
|
5075
|
-
fetchTextWork: (options,
|
|
5076
|
-
parseWork: (options,
|
|
5077
|
-
fetchDanmakuList: (options,
|
|
5078
|
-
fetchWorkComments: (options,
|
|
5079
|
-
fetchCommentReplies: (options,
|
|
5080
|
-
fetchUserProfile: (options,
|
|
5081
|
-
fetchUserVideoList: (options,
|
|
5082
|
-
fetchUserFavoriteList: (options,
|
|
5083
|
-
fetchUserRecommendList: (options,
|
|
5084
|
-
searchContent: (options,
|
|
5085
|
-
fetchSuggestWords: (options,
|
|
5086
|
-
fetchMusicInfo: (options,
|
|
5087
|
-
fetchLiveRoomInfo: (options,
|
|
5088
|
-
requestLoginQrcode: (options,
|
|
5089
|
-
fetchEmojiList: (options,
|
|
5090
|
-
fetchDynamicEmojiList: (options,
|
|
5105
|
+
fetchVideoWork: (options, override) => fetchVideoWork$1(options, ...resolveRequest(override)),
|
|
5106
|
+
fetchImageAlbumWork: (options, override) => fetchImageAlbumWork(options, ...resolveRequest(override)),
|
|
5107
|
+
fetchSlidesWork: (options, override) => fetchSlidesWork(options, ...resolveRequest(override)),
|
|
5108
|
+
fetchTextWork: (options, override) => fetchTextWork(options, ...resolveRequest(override)),
|
|
5109
|
+
parseWork: (options, override) => parseWork(options, ...resolveRequest(override)),
|
|
5110
|
+
fetchDanmakuList: (options, override) => fetchDanmakuList(options, ...resolveRequest(override)),
|
|
5111
|
+
fetchWorkComments: (options, override) => fetchWorkComments$1(options, ...resolveRequest(override)),
|
|
5112
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies(options, ...resolveRequest(override)),
|
|
5113
|
+
fetchUserProfile: (options, override) => fetchUserProfile$2(options, ...resolveRequest(override)),
|
|
5114
|
+
fetchUserVideoList: (options, override) => fetchUserVideoList(options, ...resolveRequest(override)),
|
|
5115
|
+
fetchUserFavoriteList: (options, override) => fetchUserFavoriteList(options, ...resolveRequest(override)),
|
|
5116
|
+
fetchUserRecommendList: (options, override) => fetchUserRecommendList(options, ...resolveRequest(override)),
|
|
5117
|
+
searchContent: (options, override) => searchContent(options, ...resolveRequest(override)),
|
|
5118
|
+
fetchSuggestWords: (options, override) => fetchSuggestWords(options, ...resolveRequest(override)),
|
|
5119
|
+
fetchMusicInfo: (options, override) => fetchMusicInfo(options, ...resolveRequest(override)),
|
|
5120
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$1(options, ...resolveRequest(override)),
|
|
5121
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode(options, ...resolveRequest(override)),
|
|
5122
|
+
fetchEmojiList: (options, override) => fetchEmojiList$2(options, ...resolveRequest(override)),
|
|
5123
|
+
fetchDynamicEmojiList: (options, override) => fetchDynamicEmojiList(options, ...resolveRequest(override))
|
|
5091
5124
|
};
|
|
5092
5125
|
}
|
|
5093
5126
|
//#endregion
|
|
@@ -7480,13 +7513,14 @@ const kuaishouFetcher = {
|
|
|
7480
7513
|
* ```
|
|
7481
7514
|
*/
|
|
7482
7515
|
function createBoundKuaishouFetcher(cookie, requestConfig) {
|
|
7516
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
7483
7517
|
return {
|
|
7484
|
-
fetchVideoWork: (options,
|
|
7485
|
-
fetchWorkComments: (options,
|
|
7486
|
-
fetchUserProfile: (options,
|
|
7487
|
-
fetchUserWorkList: (options,
|
|
7488
|
-
fetchLiveRoomInfo: (options,
|
|
7489
|
-
fetchEmojiList: (options,
|
|
7518
|
+
fetchVideoWork: (options, override) => fetchVideoWork(options, ...resolveRequest(override)),
|
|
7519
|
+
fetchWorkComments: (options, override) => fetchWorkComments(options, ...resolveRequest(override)),
|
|
7520
|
+
fetchUserProfile: (options, override) => fetchUserProfile$1(options, ...resolveRequest(override)),
|
|
7521
|
+
fetchUserWorkList: (options, override) => fetchUserWorkList(options, ...resolveRequest(override)),
|
|
7522
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo(options, ...resolveRequest(override)),
|
|
7523
|
+
fetchEmojiList: (options, override) => fetchEmojiList$1(options, ...resolveRequest(override))
|
|
7490
7524
|
};
|
|
7491
7525
|
}
|
|
7492
7526
|
//#endregion
|
|
@@ -7925,14 +7959,15 @@ const xiaohongshuFetcher = {
|
|
|
7925
7959
|
* ```
|
|
7926
7960
|
*/
|
|
7927
7961
|
function createBoundXiaohongshuFetcher(cookie, requestConfig) {
|
|
7962
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
7928
7963
|
return {
|
|
7929
|
-
fetchHomeFeed: (options = {},
|
|
7930
|
-
fetchNoteDetail: (options,
|
|
7931
|
-
fetchNoteComments: (options,
|
|
7932
|
-
fetchUserProfile: (options,
|
|
7933
|
-
fetchUserNoteList: (options,
|
|
7934
|
-
searchNotes: (options,
|
|
7935
|
-
fetchEmojiList: (options,
|
|
7964
|
+
fetchHomeFeed: (options = {}, override) => fetchHomeFeed(options, ...resolveRequest(override)),
|
|
7965
|
+
fetchNoteDetail: (options, override) => fetchNoteDetail(options, ...resolveRequest(override)),
|
|
7966
|
+
fetchNoteComments: (options, override) => fetchNoteComments(options, ...resolveRequest(override)),
|
|
7967
|
+
fetchUserProfile: (options, override) => fetchUserProfile(options, ...resolveRequest(override)),
|
|
7968
|
+
fetchUserNoteList: (options, override) => fetchUserNoteList(options, ...resolveRequest(override)),
|
|
7969
|
+
searchNotes: (options, override) => searchNotes(options, ...resolveRequest(override)),
|
|
7970
|
+
fetchEmojiList: (options, override) => fetchEmojiList(options, ...resolveRequest(override))
|
|
7936
7971
|
};
|
|
7937
7972
|
}
|
|
7938
7973
|
//#endregion
|
|
@@ -10212,7 +10247,7 @@ function getApiRoute(platform, methodType) {
|
|
|
10212
10247
|
* 构建后使用 __VERSION__,开发环境从 package.json 读取
|
|
10213
10248
|
*/
|
|
10214
10249
|
const getVersion = () => {
|
|
10215
|
-
return "6.
|
|
10250
|
+
return "6.4.0";
|
|
10216
10251
|
};
|
|
10217
10252
|
const VERSION = getVersion();
|
|
10218
10253
|
/**
|