mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-20 05:28:13 +02:00
feat: add mobile Remotion video generator with image, text, audio, and Facebook publishing features.
This commit is contained in:
1 parent
3d51fdc90b
commit
e1a6d1e06c
4 files changed
+19
-4
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { storage } from '../storage';
|
||||
import type { Post, SocialPage, Media } from '@shared/schema';
|
||||
import { imageProcessor } from './imageProcessor';
|
||||
@@ -71,7 +73,13 @@ export class FacebookService {
|
||||
throw new Error('Reels require a video media');
|
||||
}
|
||||
|
||||
return await this.publishReel(page, resolvePublicUrl(videoMedia.originalUrl), post.content);
|
||||
// Upload video bytes directly — Facebook cannot fetch local/Docker URLs
|
||||
const localPath = videoMedia.originalUrl.startsWith('/')
|
||||
? path.join(process.cwd(), videoMedia.originalUrl)
|
||||
: videoMedia.originalUrl;
|
||||
const nodeBuffer = await fs.promises.readFile(localPath);
|
||||
const arrayBuffer = nodeBuffer.buffer.slice(nodeBuffer.byteOffset, nodeBuffer.byteOffset + nodeBuffer.byteLength) as ArrayBuffer;
|
||||
return await this.publishReelFromBuffer(page, arrayBuffer, post.content);
|
||||
} else {
|
||||
// Default to feed
|
||||
const imageMedia = mediaList.filter(m => m.type === 'image');
|
||||
|
||||
Reference in new issue
Block a user