Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 抖音加作品列表和评论列表接口
牛文政8cbd42e027b7
diff --git a/electron/plat/douyin/douyin.type.ts b/electron/plat/douyin/douyin.type.tsindex 13ddd90c..835fc3ed 100644--- a/electron/plat/douyin/douyin.type.ts+++ b/electron/plat/douyin/douyin.type.ts@@ -393,3 +393,28 @@ export interface DouyinUserListResponse {status_code: number;user_list: DouyinUser[];}++// 抖音作品列表+export interface DouyinCreatorListResponse {+ extra: Extra;+ status_code: number; // 0+ status_msg: string;+ has_more: boolean;+ item_info_list: {+ anchor_user_id: string;+ cursor: string;+ comment_count: number; // 回复数量+ cover_image_url: string; // 'https://p3-sign.douyinpic.com/c5d200033ae82940b280~tplv-dy-resize-walign-adapt-aq:540:q75.jpeg?lk3s=138a59ce&x-expires=1742889600&x-signature=jcYpgxENZDa38hHUHNFfpcAPUDs%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=false&sc=cover&biz_tag=aweme_video&l=20250311165957E85797DDC3B0DA04AEBA';+ create_time: string; // '发布于2018年09月23日 17:51';+ creator_item_setting: {+ charge_comment_audit: boolean; // 收费评论审计+ };+ duration: number;+ item_id: string; // '@j/do779EQE//uctS8r3tvsx9pyuRYyn/J6krPKNgjq9hkia+W5A7RJEoPQpq6PZlQedr6LX3XaKU0Yc8jcykog==';+ item_id_plain: string; // '6604355150884637966';+ item_link: string; // 'https://www.iesdouyin.com/share/video/6604355150884637966/?region=CN&mid=6568746752824380174&u_code=16b4ji55k&did=MS4wLjABAAAANwkJuWIRFOzg5uCpDRpMj4OX-QryoDgn-yYlXQnRwQQ&iid=MS4wLjABAAAANwkJuWIRFOzg5uCpDRpMj4OX-QryoDgn-yYlXQnRwQQ&with_sec_did=1&video_share_track_ver=&titleType=&share_sign=qwbHwbUn9.rqVOBIpmIak8F4W9CXvvE18GzpMaAUfyU-&share_version=210100&ts=1741683597&from_aid=1128&from_ssr=1';+ media_type: number; // 4;+ title: string; // '';+ }[];+ total_count: number;+}diff --git a/electron/plat/douyin/index.ts b/electron/plat/douyin/index.tsindex b39db109..93e99fe1 100644--- a/electron/plat/douyin/index.ts+++ b/electron/plat/douyin/index.ts@@ -12,6 +12,7 @@ import {DouyinActivityListResponse,DouyinActivityTagsResponse,DouyinAllHotDataResponse,+ DouyinCreatorListResponse,DouyinHotDataResponse,DouyinLocationDataResponse,DouyinTopicsSugResponse,@@ -2141,6 +2142,28 @@ export class DouyinService {method: 'GET',});}++ // 查询抖音的活动列表+ async getCreatorItems(cookie: Electron.Cookie[]) {+ return await requestNet<DouyinCreatorListResponse>({+ url: `https://creator.douyin.com/aweme/v1/creator/item/list/?cursor=1541234344000&msToken=Ebo-uQlPJr-ICq23I7VMTe0nwYlocnqE5RBduJUPnXAu4dBw4bcqAHYV8lMraGXmHY3Z4_wXGetYKGb9ag4N0qODk9BSHgoJ9BDcIkdCwulqmedq5hAXWUgfPjAmOa_9kk6FyQX517kYJJ5S_6ROqKtefK4r6-Cf7WRDWoKjVwCaGg%3D%3D&a_bogus=O60jDtUiOo8ca3KtYKd4H1elFldlNs8yZaTxRbUnH5nmTX0GVHe6Znb0cxKXpyld-YBnhCKHunT%2FPjdbK0siZ%2FHpKmZkSDzS4tAc9gvogqiDGei%2FLNRwCuDNtJtYUbTEOAKjJlf6WURO2dOUEN3wUB5yC%2FPq4QJpMNrbDdRaEoFv60s7FNFxuNSdPXMtU1IG`,+ headers: {+ cookie: CookieToString(cookie),+ },+ method: 'GET',+ });+ }++ // 查看作品的评论列表+ async getCreatorCommentList(cookie: Electron.Cookie[]) {+ return await requestNet<DouyinCreatorListResponse>({+ url: `https://creator.douyin.com/aweme/v1/creator/comment/list/?cursor=0&count=10&item_id=%40j%2Fdo779EQE%2F%2FuctS8rzvvch6oCaTZCH0JqwsPqxpgahhkia%2BW5A7RJEoPQpq6PZl7wq9uxSqSWCjcIdbPzF8fQ%3D%3D&sort=TIME&msToken=yQqn99oxgrHKzHmripWPpKZLis4fCjPI_D8XoI42Ok_zdaAUG4O-y2lf7AxR_qcJ_AIDPOHMyta2NpMghNfYVRHRiLXqxBHaPyZsYVyMfegq4lmivibvZRhap9vug6MwDfLmwNLomzE_QyhImaiQ1UdbYElA_GSOyIYCtmqLt2h6HIIwXDwZey4%3D&a_bogus=Dy45hFUjOZ5RKpFtuOcaCaclmtoMrPuyaMTdR9Sn9xE3GHUYoNebZxcEcou1smczaupVhH37bVzlYxVc%2FskwZ%2FrpwmkvuTwfGzAC9gsoMqqDatGmErRTCzDNtJtb054EKQoRJIf6UU5OIx5UgN3hUQA9S%2FPo4YJpFHaWDQUaPozv6FG7BNq2uNtdTwFb5Q94jD%3D%3D`,+ headers: {+ cookie: CookieToString(cookie),+ },+ method: 'GET',+ });+ }}// 导出服务实例diff --git a/src/views/reply/index.tsx b/src/views/reply/index.tsxnew file mode 100644index 00000000..7e32c088--- /dev/null+++ b/src/views/reply/index.tsx@@ -0,0 +1,13 @@+/*+ * @Author: nevin+ * @Date: 2025-02-10 22:20:15+ * @LastEditTime: 2025-02-28 21:36:53+ * @LastEditors: nevin+ * @Description: 评论页面+ */+import { useState } from 'react';+export default function Page() {+ const [activeTab, setActiveTab] = useState('car');++ return <div>111</div>;+}diff --git a/src/views/task/index.tsx b/src/views/task/index.tsxindex f4081cf4..c28472ca 100644--- a/src/views/task/index.tsx+++ b/src/views/task/index.tsx@@ -6,12 +6,12 @@* @Description: 任务页面*/import { useState } from 'react';-import {- ShoppingCartOutlined,- ShareAltOutlined,+import {+ ShoppingCartOutlined,+ ShareAltOutlined,VideoCameraOutlined,HistoryOutlined,- WalletOutlined+ WalletOutlined,} from '@ant-design/icons';import styles from './task.module.scss';@@ -37,7 +37,7 @@ interface Task {export default function Task() {// 当前选中的任务类型const [activeTab, setActiveTab] = useState('car');-+// 渲染对应的任务内容const renderTaskContent = () => {switch (activeTab) {@@ -59,28 +59,28 @@ export default function Task() {{/* 顶部导航栏 */}<div className={styles.taskHeader}><div className={styles.taskHeaderLeft}>- <div+ <divclassName={`${styles.taskButton} ${activeTab === 'car' ? styles.activeTaskButton : ''}`}onClick={() => setActiveTab('car')}><ShoppingCartOutlined /><span>挂车市场任务</span></div>- <div+ <divclassName={`${styles.taskButton} ${activeTab === 'pop' ? styles.activeTaskButton : ''}`}onClick={() => setActiveTab('pop')}><ShareAltOutlined /><span>推广任务</span></div>- <div+ <divclassName={`${styles.taskButton} ${activeTab === 'video' ? styles.activeTaskButton : ''}`}onClick={() => setActiveTab('video')}><VideoCameraOutlined /><span>视频任务</span></div>- <div+ <divclassName={`${styles.taskButton} ${activeTab === 'mine' ? styles.activeTaskButton : ''}`}onClick={() => setActiveTab('mine')}>@@ -97,9 +97,7 @@ export default function Task() {</div>{/* 任务内容 */}- <div className={styles.taskContent}>- {renderTaskContent()}- </div>+ <div className={styles.taskContent}>{renderTaskContent()}</div></div>);}