Skip to content

Let's use AI to Earn!

小红书的算法设置

DESKTOP-ZTS2NQJNA65e42848c210
diff --git a/electron/plat/Kwai/index.ts b/electron/plat/Kwai/index.ts
index 297e4309..b6679d79 100644
--- a/electron/plat/Kwai/index.ts
+++ b/electron/plat/Kwai/index.ts
@@ -402,7 +402,7 @@ class KwaiPub {
bodys.variables.searchSessionId = pageInfo.postFirstId;
}
- console.log('----------- getsearchNodeList --- bodys: ', bodys);
+ // console.log('----------- getsearchNodeList --- bodys: ', bodys);
const res = await this.requestApi<any>({
cookie: cookies,
diff --git a/electron/plat/xiaohongshu/index.ts b/electron/plat/xiaohongshu/index.ts
index ca23c41b..2b1ceab4 100644
--- a/electron/plat/xiaohongshu/index.ts
+++ b/electron/plat/xiaohongshu/index.ts
@@ -1380,20 +1380,32 @@ export class XiaohongshuService {
async getSearchNodeList(cookie: string, qe: string, page: number = 0) {
const url = `/api/sns/web/v1/search/notes`;
- function L() {
- let t,
- e = 2147483646;
- let a = BigInt(Date.now()),
- u = BigInt(Math.ceil(Math.random() * e));
- return (a <<= BigInt(64)), (a += u).toString(36);
+ // 生成搜索ID的函数
+ function base36encode(number: number): string {
+ const digits = '0123456789abcdefghijklmnopqrstuvwxyz';
+ let base36 = "";
+ while (number > 0) {
+ const remainder = number % 36;
+ base36 = digits[remainder] + base36;
+ number = Math.floor(number / 36);
+ }
+ return base36;
+ }
+
+ function generateSearchId(): string {
+ const timestamp = BigInt(Date.now() * 1000) << BigInt(64);
+ const randomValue = BigInt(Math.floor(Math.random() * 2147483646));
+ return base36encode(Number(timestamp + randomValue));
}
+ console.log('------ getSearchNodeList --- generateSearchId::', generateSearchId());
+
console.log('------ getSearchNodeList --- asdadsda::', qe, page);
const body = {
keyword: qe,
page: page,
page_size: 20,
- search_id: '2em4bkby1dpddm5q64f97',
+ search_id: generateSearchId(),
sort: 'general',
note_type: 0,
ext_flags: [],
diff --git a/src/views/replyother/index.tsx b/src/views/replyother/index.tsx
index 70c0f90e..a56547f3 100644
--- a/src/views/replyother/index.tsx
+++ b/src/views/replyother/index.tsx
@@ -158,11 +158,13 @@ export default function Page() {
// 加载更多帖子
const loadMorePosts = async () => {
- console.log('------ loadMorePosts == 1');
+ // console.log('------ loadMorePosts == 1');
if (!pageInfo.hasMore || isLoadingMore || !searchKeyword || searchKeyword == '') return;
- console.log('------ loadMorePosts == 2');
- if(!postFirstId || postFirstId == '') return;
- console.log('------ loadMorePosts == 3');
+ // console.log('------ loadMorePosts == 2');
+ if(activeAccountType !== 'xhs'){
+ if(!postFirstId || postFirstId == '') return;
+ }
+ // console.log('------ loadMorePosts == 3');
setIsLoadingMore(true);
try {
setTimeout(async () => {
@@ -218,7 +220,7 @@ export default function Page() {
>({});
// 添加搜索关键词状态
- const [searchKeyword, setSearchKeyword] = useState('爱团团');
+ const [searchKeyword, setSearchKeyword] = useState('英雄杀道一');
async function getCreatorList(thisid: any) {
setWordList([]);
@@ -533,6 +535,9 @@ export default function Page() {
console.log('------ post.dataId', post.dataId);
url = `https://www.douyin.com/video/${post.dataId}`;
console.log('------ url 2:', url);
+ } else if(activeAccountType == 'KWAI'){
+ // 快手链接格式
+ url = `https://www.kuaishou.com/short-video/${post.dataId}`;
} else {
// 默认使用已有的url或者根据noteId构建通用链接
url = post.url || `https://www.xiaohongshu.com/explore/${post.dataId}`;
@@ -682,7 +687,7 @@ export default function Page() {
onClick={() => showCommentModal(item)}
>
<UnorderedListOutlined />
- <span>{item.commentCount || 0}</span>
+ <span>{item.commentCount || ''}</span>
</Space>,
<Space key="reply" onClick={() => openReplyWorks(item)}>
<CommentOutlined />
@@ -699,7 +704,7 @@ export default function Page() {
: undefined,
}}
/>
- <span>{item.collectCount || 0}</span>
+ <span>{item.collectCount || ''}</span>
</Space>,
]}
>