Skip to content

Let's use AI to Earn!

feat: 视频号评论

牛文政02c1f623cb06
diff --git a/electron/main/plat/platforms/wxSph/index.ts b/electron/main/plat/platforms/wxSph/index.ts
index 1624df3d..3cb389ae 100644
--- a/electron/main/plat/platforms/wxSph/index.ts
+++ b/electron/main/plat/platforms/wxSph/index.ts
@@ -211,8 +211,7 @@ export class WxSph extends PlatformBase {
) {
const cookie: CookiesType = JSON.parse(account.loginCookie);
const res = await shipinhaoService.createComment(cookie, dataId, content);
-
- return false;
+ return (res.status === 200 || res.status === 201) && res.data.errCode === 0;
}
async replyComment(
diff --git a/electron/plat/Kwai/index.ts b/electron/plat/Kwai/index.ts
index 7efeb218..a84daee0 100644
--- a/electron/plat/Kwai/index.ts
+++ b/electron/plat/Kwai/index.ts
@@ -412,17 +412,20 @@ class KwaiPub {
replyTo?: number; // 798319351;
},
) {
+ console.log('----------- photoId', photoId);
+ console.log('----------- content', content);
+
const res = await requestNet<CommentAddResponse>({
- url: 'https://cp.kuaishou.com/rest/cp/creator/comment/add?__NS_sig3=a9b9fecedad12b9d75f4f7f64ed9b1c62cc8608ce8e8eaeae5e4e7fd',
+ url: 'https://cp.kuaishou.com/rest/cp/creator/comment/add?__NS_sig3=09195e6e1b33893d26545756e88395048c68c02c48484a4a4544475d',
method: 'POST',
headers: {
cookie: CookieToString(cookie),
},
body: {
content,
- photoId,
- ...reply,
'kuaishou.web.cp.api_ph': '69799694cfd7e689847219cf678dec275266',
+ photoId,
+ // ...reply,
},
});
diff --git a/electron/plat/shipinhao/index.ts b/electron/plat/shipinhao/index.ts
index 4e823d3c..5a91b40c 100644
--- a/electron/plat/shipinhao/index.ts
+++ b/electron/plat/shipinhao/index.ts
@@ -12,7 +12,7 @@ import {
WeChatVideoApiResponse,
WeChatVideoUserData,
} from './wxShp.type';
-
+import { v4 as uuidv4 } from 'uuid';
interface UserInfo {
authorId: string;
nickname: string;
@@ -1407,31 +1407,33 @@ export class ShipinhaoService {
content: string,
comment: Partial<CommentInfo> = {},
) {
- return await requestNet<WeChatVideoUserData>({
+ const res = await requestNet<WeChatVideoUserData>({
url: `https://channels.weixin.qq.com/micro/interaction/cgi-bin/mmfinderassistant-bin/comment/create_comment?_rid=67d032a7-6c8f7126`,
headers: {
cookie: CookieToString(cookie),
},
method: 'POST',
body: {
- clientId: this.getUniqueTaskId(),
- body: {
- comment,
- content,
- exportId,
- pluginSessionId: null,
- rawKeyBuff: null,
- replyCommentId: '',
- reqScene: 7,
- rootCommentId: '',
- scene: 7,
- timestamp: Date.now() + '',
- _log_finder_id:
- 'v2_060000231003b20faec8c5e38b10cbd6cb06ef3cb077ad5b14a8587570bc414e95c4b7e034ea@finder',
- _log_finder_uin: '',
- },
+ clientId: uuidv4(),
+ comment, // 默认{}
+ content,
+ exportId,
+ pluginSessionId: null,
+ rawKeyBuff: null,
+ replyCommentId: comment?.commentId || '',
+ reqScene: 7,
+ rootCommentId: comment?.replyCommentId || '',
+ scene: 7,
+ timestamp: Date.now() + '',
+ _log_finder_id:
+ 'v2_060000231003b20faec8c5e38b10cbd6cb06ef3cb077ad5b14a8587570bc414e95c4b7e034ea@finder',
+ _log_finder_uin: '',
},
});
+
+ console.log('------ res', res);
+
+ return res;
}
}
diff --git a/electron/plat/shipinhao/wxShp.type.ts b/electron/plat/shipinhao/wxShp.type.ts
index 8bdaf8cc..7730aa49 100644
--- a/electron/plat/shipinhao/wxShp.type.ts
+++ b/electron/plat/shipinhao/wxShp.type.ts
@@ -183,6 +183,8 @@ export interface CommentInfo {
displayFlag: number; // 514;
blacklistFlag: number; // 0;
likeFlag: number; // 0;
+ replyCommentId?: string; // '14610404657143548189';
+ replyContent?: string; // '可爱吧';
}
export interface SphGetCommentListResponse {
diff --git a/electron/plat/xiaohongshu/index.ts b/electron/plat/xiaohongshu/index.ts
index a769cafa..b19ac465 100644
--- a/electron/plat/xiaohongshu/index.ts
+++ b/electron/plat/xiaohongshu/index.ts
@@ -1457,7 +1457,7 @@ export class XiaohongshuService {
a1: CookieToString(cookie),
});
- return await requestNet<XhsCommentPostResponse>({
+ const res = await requestNet<XhsCommentPostResponse>({
url: `https://edith.xiaohongshu.com${url}`,
headers: {
cookie: CookieToString(cookie),
@@ -1476,6 +1476,10 @@ export class XiaohongshuService {
at_users: [],
},
});
+
+ console.log('--- xhs commentPost --- res', res);
+
+ return res;
}
}