File tree Expand file tree Collapse file tree 4 files changed +26
-17
lines changed
Expand file tree Collapse file tree 4 files changed +26
-17
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ module.exports = {
1111 await publishXiaohongshu ( data ) ;
1212 } else if ( data . channel === "bilibili" ) {
1313 await publishBilibili ( data ) ;
14+ } else if ( data . channel === "youtube" ) {
15+ await publishYoutube ( data ) ;
1416 }
1517 } catch ( error ) {
1618 console . error ( "Error in publish post:" , error ) ;
@@ -257,6 +259,19 @@ async function publishBilibili(data) {
257259 }
258260}
259261
262+ async function publishYoutube ( data ) {
263+ if ( ! browser ) {
264+ browser = await launchBrowser ( ) ;
265+ }
266+ const page = await browser . newPage ( ) ;
267+ try {
268+ await page . goto ( "https://www.youtube.com/upload" ) ;
269+ await page . waitForTimeout ( 3000 ) ; // Let Vue UI settle
270+ } catch ( err ) {
271+ console . error ( "Upload error:" , err ) ;
272+ throw err ;
273+ }
274+ }
260275/**
261276 * @param {string } content - The content of the post
262277 * @returns {{tags: string[], content: string} } - The tags of the post and the content without tags
Original file line number Diff line number Diff line change @@ -130,17 +130,6 @@ function FileList({
130130} ) {
131131 const [ files , setFiles ] = useState < FileNode [ ] > ( [ ] ) ;
132132
133- // const handleRevealInExplorer = async (filePath: string) => {
134- // try {
135- // const result = await ipcRenderer.invoke("reveal-in-explorer", filePath);
136- // if (result.error) {
137- // toast.error(result.error);
138- // }
139- // } catch (error) {
140- // toast.error("Failed to reveal file in explorer");
141- // }
142- // };
143-
144133 const handleRevealInExplorer = async ( filePath : string ) => {
145134 try {
146135 const response = await fetch ( "/api/reveal_in_explorer" , {
Original file line number Diff line number Diff line change @@ -171,7 +171,6 @@ export default function PostEditor({
171171 const setEditorContentWrapper = ( content : string ) => {
172172 setEditorContent ( content ) ;
173173 debouncedUpdateFile ( content ) ;
174- console . log ( "content" , content ) ;
175174 } ;
176175
177176 useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -5,21 +5,27 @@ export const PLATFORMS_CONFIG = [
55 icon : "https://www.bilibili.com/favicon.ico" ,
66 checked : true ,
77 } ,
8+ {
9+ id : "xiaohongshu" ,
10+ name : "小红书" ,
11+ icon : "https://www.xiaohongshu.com/favicon.ico" ,
12+ checked : true ,
13+ } ,
814 {
915 id : "douyin" ,
1016 name : "抖音" ,
1117 icon : "https://www.tiktok.com/favicon.ico" ,
1218 checked : true ,
1319 } ,
1420 {
15- id : "xiaohongshu " ,
16- name : "小红书 " ,
17- icon : "https://www.xiaohongshu. com/favicon.ico" ,
21+ id : "weixin_channels " ,
22+ name : "微信视频号 " ,
23+ icon : "https://res.wx.qq. com/t/wx_fed/finder/helper/finder-helper-web/res/ favicon-v2 .ico" ,
1824 checked : true ,
1925 } ,
2026 {
21- id : "twitter " ,
22- name : "推特 " ,
27+ id : "x " ,
28+ name : "X " ,
2329 icon : "https://www.x.com/favicon.ico" ,
2430 checked : true ,
2531 } ,
You can’t perform that action at this time.
0 commit comments