@ikenxuan/amagi 5.0.0 → 5.0.2

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.
@@ -14291,8 +14291,6 @@ type Options = {
14291
14291
  declare const createAmagiClient: (options?: Options) => {
14292
14292
  /** 启动本地HTTP服务 */
14293
14293
  startServer: (port?: number) => express__default.Application;
14294
- /** @deprecated 此方法已废弃,请使用 startServer 方法代替 */
14295
- startClient: (port?: number) => express__default.Application;
14296
14294
  getDouyinData: <T extends DouyinMethodType, M extends TypeMode>(methodType: T, options?: ExtendedDouyinOptions<T> & {
14297
14295
  typeMode?: M;
14298
14296
  }) => Promise<ApiResponse<ConditionalReturnType<DouyinDataOptionsMap[T]["data"], M>>>;
@@ -15827,21 +15825,96 @@ type DouyinMethodOptionsWithoutMethodType = {
15827
15825
  [K in keyof DouyinMethodOptionsMap]: OmitMethodType<DouyinMethodOptionsMap[K]>;
15828
15826
  };
15829
15827
  declare class DouyinAPI {
15828
+ private browserVersion;
15829
+ /**
15830
+ * 构造函数
15831
+ * @param userAgent - 用户代理字符串,用于提取浏览器版本信息
15832
+ */
15833
+ constructor(userAgent?: string);
15834
+ /**
15835
+ * 获取通用的基础参数
15836
+ * @returns 通用基础参数对象
15837
+ */
15838
+ private getBaseParams;
15839
+ /**
15840
+ * 获取视频或图集数据的接口地址
15841
+ * @param data - 请求参数,包含aweme_id
15842
+ * @returns 完整的接口URL
15843
+ */
15830
15844
  视频或图集(data: DouyinMethodOptionsWithoutMethodType['WorkParams']): string;
15845
+ /**
15846
+ * 获取评论数据的接口地址
15847
+ * @param data - 请求参数,包含aweme_id、cursor、number等
15848
+ * @returns 完整的接口URL
15849
+ */
15831
15850
  评论(data: DouyinMethodOptionsWithoutMethodType['CommentParams']): string;
15851
+ /**
15852
+ * 获取二级评论数据的接口地址
15853
+ * @param data - 请求参数,包含aweme_id、comment_id等
15854
+ * @returns 完整的接口URL
15855
+ */
15832
15856
  二级评论(data: DouyinMethodOptionsWithoutMethodType['CommentReplyParams']): string;
15857
+ /**
15858
+ * 获取动图数据的接口地址
15859
+ * @param data - 请求参数,包含aweme_id
15860
+ * @returns 完整的接口URL
15861
+ */
15833
15862
  动图(data: DouyinMethodOptionsWithoutMethodType['WorkParams']): string;
15863
+ /**
15864
+ * 获取表情数据的接口地址
15865
+ * @returns 完整的接口URL
15866
+ */
15834
15867
  表情(): string;
15868
+ /**
15869
+ * 获取用户主页视频数据的接口地址
15870
+ * @param data - 请求参数,包含sec_uid
15871
+ * @returns 完整的接口URL
15872
+ */
15835
15873
  用户主页视频(data: DouyinMethodOptionsWithoutMethodType['UserParams']): string;
15874
+ /**
15875
+ * 获取用户主页信息的接口地址
15876
+ * @param data - 请求参数,包含sec_uid
15877
+ * @returns 完整的接口URL
15878
+ */
15836
15879
  用户主页信息(data: DouyinMethodOptionsWithoutMethodType['UserParams']): string;
15880
+ /**
15881
+ * 获取热点词数据的接口地址
15882
+ * @param data - 请求参数,包含query
15883
+ * @returns 完整的接口URL
15884
+ */
15837
15885
  热点词(data: DouyinMethodOptionsWithoutMethodType['SearchParams']): string;
15886
+ /**
15887
+ * 获取搜索数据的接口地址
15888
+ * @param data - 请求参数,包含query、number、search_id等
15889
+ * @returns 完整的接口URL
15890
+ */
15838
15891
  搜索(data: DouyinMethodOptionsWithoutMethodType['SearchParams']): string;
15892
+ /**
15893
+ * 获取互动表情数据的接口地址
15894
+ * @returns 完整的接口URL
15895
+ */
15839
15896
  互动表情(): string;
15897
+ /**
15898
+ * 获取背景音乐数据的接口地址
15899
+ * @param data - 请求参数,包含music_id
15900
+ * @returns 完整的接口URL
15901
+ */
15840
15902
  背景音乐(data: DouyinMethodOptionsWithoutMethodType['MusicParams']): string;
15903
+ /**
15904
+ * 获取直播间信息的接口地址
15905
+ * @param data - 请求参数,包含web_rid、room_id
15906
+ * @returns 完整的接口URL
15907
+ */
15841
15908
  直播间信息(data: DouyinMethodOptionsWithoutMethodType['LiveRoomParams']): string;
15909
+ /**
15910
+ * 获取申请二维码的接口地址
15911
+ * @param data - 请求参数,包含verify_fp
15912
+ * @returns 完整的接口URL
15913
+ */
15842
15914
  申请二维码(data: DouyinMethodOptionsWithoutMethodType['QrcodeParams']): string;
15843
15915
  }
15844
15916
  /**
15917
+ * 默认的DouyinAPI实例(使用默认浏览器版本125.0.0.0)
15845
15918
  * 该类下的所有方法只会返回拼接好参数后的 Url 地址,需要手动请求该地址以获取数据
15846
15919
  *
15847
15920
  * 缺少 `a_bougs` 参数,请自行生成拼接
@@ -15860,7 +15933,7 @@ declare class douyinSign {
15860
15933
  * @param url 需要签名的地址
15861
15934
  * @returns 对此地址签名后的URL查询参数
15862
15935
  */
15863
- static AB(url: string): string;
15936
+ static AB(url: string, userAgent?: string): string;
15864
15937
  /** 生成一个唯一的验证字符串 */
15865
15938
  static VerifyFpManager(): string;
15866
15939
  }
@@ -16173,7 +16246,6 @@ declare const handleError: (error: unknown, requestPath?: string) => {
16173
16246
  */
16174
16247
  declare const amagiClient: (options?: Options) => {
16175
16248
  startServer: (port?: number) => express.Application;
16176
- startClient: (port?: number) => express.Application;
16177
16249
  getDouyinData: <T extends DouyinMethodType, M extends TypeMode>(methodType: T, options?: ExtendedDouyinOptions<T> & {
16178
16250
  typeMode?: M;
16179
16251
  }) => Promise<ApiResponse<ConditionalReturnType<DouyinDataOptionsMap[T]["data"], M>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikenxuan/amagi",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "description": "抖音、B站的 web 端相关数据接口基于 Node.js 的实现",
5
5
  "keywords": [
6
6
  "douyin",