返回 AiToEarn
kwai.type.ts
1 import { IRequestNetResult } from '../requestNet';
2
3 interface AbConfig {
4 cpPublishNewPage2024: boolean;
5 enableGaoXinLaHuiSwitch: boolean;
6 cpPublishSearch: boolean;
7 favorAbGroupWithGray: number;
8 enableNewGrowthTaskV2: boolean;
9 enableNewHomeVersionV4: boolean;
10 enablePhotoFavorV2Switch: boolean;
11 }
12
13 export interface IKwaiUserCommonResponse<T> {
14 result: number;
15 currentTime: number;
16 'host-name': string;
17 data: T;
18 message: string;
19 }
20
21 // video/pc/upload/pre
22 export type UploadPpreResponse = IKwaiUserCommonResponse<{
23 token: string;
24 fileId: number;
25 }>;
26
27 // video/pc/upload/finish
28 export type UploadFinishResponse = IKwaiUserCommonResponse<{
29 coverKey: string;
30 coverMediaId: string;
31 duration: number;
32 fileId: number;
33 height: number;
34 mediaId: string;
35 photoIdStr: string;
36 videoDuration: string;
37 videoFrameRate: string;
38 width: string;
39 }>;
40
41 // /v2/video/pc/submit
42 export type KwaiSubmitResponse = IKwaiUserCommonResponse<{
43 result: number;
44 message: string;
45 }>;
46
47 export interface IGetHomeOverviewItem {
48 name: string;
49 tab: string;
50 sumCount: number;
51 endDayCount: number;
52 interpretDesc: string | null;
53 trendData: {
54 date: string;
55 count: number;
56 }[];
57 diagnoseResultType: string;
58 }
59
60 export interface IGetHomeOverview {
61 result: number;
62 currentTime: number;
63 'host-name': string;
64 data: {
65 basicData: IGetHomeOverviewItem[];
66 dataUpdateTime: string;
67 };
68 message: string;
69 }
70
71 export interface IGetHomeInfoResponse {
72 data: {
73 desc: string;
74 fansCnt: number;
75 followCnt: number;
76 likeCnt: number;
77 userId: number;
78 userName: string;
79 userKwaiId?: number;
80 };
81 }
82
83 // 快手用户信息接口返回的数据
84 export type IKwaiUserInfoResponse = {
85 data: {
86 userInfo: {
87 avatar: string;
88 eid: string;
89 id: string;
90 name: string;
91 userId: number;
92 __typename: string;
93 };
94 };
95 };
96
97 interface TopicsTag {
98 id: number;
99 name: string;
100 data: any;
101 status: number;
102 karaoke: any;
103 }
104
105 // 获取快手话题接口返回的数据
106 export type IKwaiGetTopicsResponse = IKwaiUserCommonResponse<{
107 result: number;
108 ussid: string;
109 pcursor: string;
110 tags: {
111 tag: TopicsTag;
112 viewCount: number;
113 }[];
114 }>;
115
116 // 获取快手关注用户返回的数据
117 export type IKwaiGetUsersResponse = IKwaiUserCommonResponse<{
118 list: {
119 userName: string;
120 userId: number;
121 fansCount: number;
122 headUrl: string;
123 }[];
124 name: string;
125 type: number;
126 }>;
127
128 // 获取快手位置数据
129 export type IKwaiGetLocationsResponse = {
130 locations: {
131 id: number;
132 title: string;
133 address: string;
134 city: string;
135 category: number;
136 latitude: number;
137 longitude: number;
138 idString: string;
139 }[];
140 pcursor: string;
141 result: number;
142 };
143
144 // 快手视频发布入参
145 export interface IKwaiPubVideoParams {
146 // cookies
147 cookies: Electron.Cookie[];
148 // 话题
149 topics: string[];
150 // 发布视频的简介
151 desc: string;
152 // 视频的路径
153 videoPath: string;
154 // 封面路径
155 coverPath: string;
156 // 发布回调,可以用于获取发布进度
157 callback: (progress: number, msg?: string) => void;
158 // 位置
159 poiInfo?: {
160 poiId: string;
161 latitude: string;
162 longitude: string;
163 };
164 // 作品权限 1=所有人可见 2=仅自己可见 4=好友可见
165 photoStatus: 1 | 2 | 4;
166 // @的好友
167 mentions?: string[];
168 // 定时发布日期,时间戳,毫秒
169 publishTime?: number;
170 // 代理地址
171 proxy: string;
172 }
173
174 // 登录返回参数
175 export interface ILoginResponse {
176 cookies: Electron.Cookie[];
177 userInfo: IRequestNetResult<IKwaiUserInfoResponse>;
178 }
179
180 // 刷新作品
181 export type RefreshWorksResponse = IKwaiUserCommonResponse<{
182 list: {
183 id: number;
184 likeCount: number;
185 operations: number[];
186 playCount: number;
187 publishStatus: number;
188 // 如果已经发布这个值会存在
189 workId?: string;
190 }[];
191 }>;
192
193 export type KwaiWorkItem = {
194 publishId: number;
195 workId: string;
196 title: string;
197 publishCoverUrl: string;
198 unPublishCoverKey: string | null;
199 userId: number;
200 userIdStr: string;
201 userName: string;
202 userHead: string;
203 playCount: number;
204 likeCount: number;
205 commentCount: number;
206 uploadTime: number;
207 durationSecond: number;
208 judgementTitle: string;
209 judgementStatus: number;
210 publishStatus: number;
211 operations: string[];
212 publishType: number;
213 photoStatus: number;
214 photoTop: boolean;
215 collectionTitle: string;
216 collectionId: number;
217 awdId: number;
218 hotspotActivity: null;
219 hotspot: null;
220 showAtlasIcon: boolean;
221 showDuration: boolean;
222 };
223
224 // 获取作品,开发者后台
225 export type GetWorksListResponse = IKwaiUserCommonResponse<{
226 list: KwaiWorkItem[];
227 }>;
228
229 // 获取作品列表
230 export interface GetPhotoListResponse {
231 result: number; // 1;
232 currentTime: number; // 1741842574582;
233 'host-name': string; // 'public-bjxy-rs9-kce-node961.idcyz.hb1.kwaidc.com';
234 data: {
235 photoList: {
236 photoId: string; // '3xsq95w5uxvjx7q';
237 title: string; // '';
238 cover: string; // 'https://p2.a.yximgs.com/upic/2025/02/24/21/BMjAyNTAyMjQyMTQ4NDFfNzk4MzE5MzUxXzE1Nzc4MzY4MTM2MV8wXzM=_B05f8067d6793fd47dcbb196af577f7ae.jpg?tag=1-1741842574-nil-0-uacnaa9n5n-f19cc27a1c6378c5&clientCacheKey=3xsq95w5uxvjx7q.jpg&di=b7c6874b&bp=10000';
239 playCount: number; // 6;
240 likeCount: number; // 0;
241 commentCount: number; // 2;
242 uploadTime: number; // 1740404944454;
243 duration: number; // 13300;
244 isVideo: true;
245 isSettingSelectedComment: boolean; // false;
246 photoSelectedTips: any; // null;
247 }[];
248 pcursor: number; // 1515253882683; // 下一页页码
249 totalCount: number; // 2;
250 visionSearchPhoto: {
251 feeds: any[];
252 };
253 result?: string;
254 };
255 message: string; // '成功';
256 }
257
258 // 获取评论列表
259 export interface GetCommentListResponse {
260 result: number; // 1;
261 currentTime: number; // 1741843263417;
262 'host-name': string; // 'public-bjxy-rs9-kce-node961.idcyz.hb1.kwaidc.com';
263 data: {
264 pcursor?: number; // 971109198576;
265 list: [
266 {
267 photoId: number; // 157783681361;
268 authorId: number; // 798319351;
269 headurl: string; // 'https://p66-pro.a.yximgs.com/uhead/AB/2018/01/06/23/BMjAxODAxMDYyMzQ4MjRfNzk4MzE5MzUxXzJfaGQ4OTBfMTcz_s.jpg';
270 authorName: string; // '墨2668';
271 commentId: number; // 969549966791;
272 content: string; // '哈哈哈';
273 replyTo: number; // 0;
274 replyToUserName: any; // null;
275 replyToCommentId: number; // 0;
276 timestamp: number; // 1741695330721;
277 likedCount: number; // 0;
278 liked: boolean; // false;
279 subCommentCount: number; // 1;
280 emotionId: any; // null;
281 emotion: any; // null;
282 ip: number; // 0;
283 referer: any; // null;
284 toped: boolean; // false;
285 settingSelectedComment: boolean; // false;
286 isSettingSelectedComment: boolean; // false;
287 },
288 ];
289 };
290 message: string; // '成功';
291 }
292
293 // 获取子回复列表
294 export interface GetSubCommentListResponse {
295 result: number; // 1;
296 currentTime: number; // 1741843273188;
297 'host-name': string; // 'public-bjx-c26-kce-node710.idchb1az1.hb1.kwaidc.com';
298 data: {
299 list: {
300 photoId: number; // 157783681361;
301 authorId: number; // 798319351;
302 headurl: string; // 'https://p66-pro.a.yximgs.com/uhead/AB/2018/01/06/23/BMjAxODAxMDYyMzQ4MjRfNzk4MzE5MzUxXzJfaGQ4OTBfMTcz_s.jpg';
303 authorName: string; // '墨2668';
304 commentId: number; // 969618657810;
305 content: string; // '666';
306 replyTo: number; // 798319351;
307 replyToUserName: string; // '墨2668';
308 replyToCommentId: number; // 0;
309 timestamp: number; // 1741704937506;
310 likedCount: number; // 0;
311 liked: boolean; // false;
312 subCommentCount: number; // 0;
313 emotionId: any; // null;
314 emotion: any; // null;
315 ip: number; // 0;
316 referer: any; // null;
317 toped: boolean; // false;
318 settingSelectedComment: boolean; // false;
319 isSettingSelectedComment: boolean; // false;
320 }[];
321 };
322 message: string; // '成功';
323 }
324
325 // 创建评论返回参数
326 export interface CommentAddResponse {
327 result: number; // 1;
328 currentTime: number; // 1741704937529;
329 'host-name': string; // 'public-bjx-c26-kce-node717.idchb1az1.hb1.kwaidc.com';
330 data: {
331 commentId: number; // 969618657810;
332 };
333 message: string; // '成功';
334 }
335
335 lines TYPESCRIPT