Skip to content

Let's use AI to Earn!

feat: 抖音代码整合

牛文政0b15c5bd1e79
diff --git a/electron/main/plat/platforms/douyin/index.ts b/electron/main/plat/platforms/douyin/index.ts
index 41a088c3..dc6a93e0 100644
--- a/electron/main/plat/platforms/douyin/index.ts
+++ b/electron/main/plat/platforms/douyin/index.ts
@@ -186,7 +186,7 @@ export class Douyin extends PlatformBase {
console.log('===== res ===', res.data.comment_info_list[0]);
- const list: CommentData[] = res.data.comment_info_list.map((v) => {
+ const list: CommentData[] = res.data.comment_info_list.map((v: any) => {
return {
dataId: dataId,
commentId: v.comment_id,
@@ -209,6 +209,15 @@ export class Douyin extends PlatformBase {
dataId: string, // 作品ID
content: string,
) {
+ const cookie: CookiesType = JSON.parse(account.loginCookie);
+ const res = await douyinService.creatorCommentReply(cookie, {
+ comment_Id: '',
+ item_id: dataId,
+ text: content,
+ });
+
+ console.log('------ res', res);
+
return false;
}
@@ -221,6 +230,15 @@ export class Douyin extends PlatformBase {
data: any; // 辅助数据,原数据
},
) {
+ const cookie: CookiesType = JSON.parse(account.loginCookie);
+ const res = await douyinService.creatorCommentReply(cookie, {
+ comment_Id: commentId,
+ item_id: option.data.dataId,
+ text: content,
+ });
+
+ console.log('------ res', res);
+
return false;
}
diff --git a/electron/plat/douyin/douyin.type.ts b/electron/plat/douyin/douyin.type.ts
index df81c712..2fd98395 100644
--- a/electron/plat/douyin/douyin.type.ts
+++ b/electron/plat/douyin/douyin.type.ts
@@ -453,3 +453,29 @@ export interface DouyinCreatorCommentListResponse {
status_msg: string; // '';
total_count: number; // 3;
}
+
+export interface DouyinNewCommentResponse {
+ comment_info: {
+ comment_id: string; // '@j/Jr6bdET0rxssxd57/to896qi+WZSz3LqQlN6Nuja9BugWjRo0mWYw1IBd39et4ggwDVwRptqsgeUQSJiFcAg==';
+ create_time: string; // '1741955069';
+ digg_count: string; // '0';
+ followed: boolean; // false;
+ following: boolean; // false;
+ is_author: boolean; // true;
+ level: number; // 1 | 2; // 第几层
+ reply_count: string; // '0';
+ status: number; // 7;
+ text: string; // '天真蓝';
+ user_digg: boolean; // false;
+ user_info: {
+ avatar_url: string; // 'https://p11.douyinpic.com/aweme/720x720/aweme-avatar/tos-cn-i-0813c001_oUDEAA5qhfAx5dAgIewzNvptBoNAuByobAvNC1.jpeg?from=4010531038';
+ screen_name: string; // '海宝💃';
+ user_id: string; // '@j/Jr6bdET0rxssxd57/to8l7oSuRbyDzJ64tOaxtjpj2c9bt4zgRjBU4l2s/OnM0';
+ };
+ };
+ extra: {
+ now: number; // 1741955069000;
+ };
+ status_code: number; // 0;
+ status_msg: string; // '';
+}
diff --git a/electron/plat/douyin/index.ts b/electron/plat/douyin/index.ts
index e30ad704..fab95309 100644
--- a/electron/plat/douyin/index.ts
+++ b/electron/plat/douyin/index.ts
@@ -16,6 +16,7 @@ import {
DouyinCreatorListResponse,
DouyinHotDataResponse,
DouyinLocationDataResponse,
+ DouyinNewCommentResponse,
DouyinTopicsSugResponse,
DouyinUserListResponse,
} from './douyin.type';
@@ -2310,7 +2311,7 @@ export class DouyinService {
}
// 作品的评论回复
- async getCreatorCommentReply(
+ async creatorCommentReply(
cookie: Electron.Cookie[],
data: {
comment_Id: string; // 空字符串, 直接回复
@@ -2318,7 +2319,7 @@ export class DouyinService {
text: string; //'哈哈哈';
},
) {
- return await requestNet<DouyinCreatorCommentListResponse>({
+ return await requestNet<DouyinNewCommentResponse>({
url: `https://creator.douyin.com/aweme/v1/creator/comment/reply/`,
headers: {
cookie: CookieToString(cookie),