Vidiflow Backend V2.0.0
Real video extraction, real-time progress tracking, and complete API documentation.
New Features ✨
Video Extraction
- Real yt-dlp Integration: Extract actual video metadata and download URLs from YouTube
- Multi-Provider Support: YouTube and TikTok providers now use real extraction
- Format/Quality Detection: Dynamic available formats and qualities per video
- Direct Download URLs: Return actual platform URLs instead of mocking data
Real-Time Progress
- WebSocket Support: Real-time download status updates instead of polling
- Download Rooms: Clients subscribe to specific download updates
- Event Emitters: PROCESSING, COMPLETED, FAILED status events
- Better UX: Frontend gets instant feedback on download progress
API Documentation
- Swagger/OpenAPI: Interactive API docs at
/api-docs - Complete Endpoint Docs: All endpoints documented with examples
- Request/Response Schemas: Clear input/output formats
- Authentication Docs: Bearer token requirements clearly marked
Architecture Improvements
- Unified Extraction Service: Single yt-dlp wrapper used by all providers
- Provider Pattern Proven: Easy to add new providers (same as YouTube/TikTok)
- Scalable Design: WebSocket doesn't block worker threads
- Production Ready: Real extraction, real-time updates, full documentation
What Works Now ✅
- Register/Login with JWT + refresh tokens
- Download videos from YouTube with real metadata
- TikTok support (extraction may vary due to platform restrictions)
- Real-time download status via WebSocket
- Download history and favorites
- Rate limiting on auth endpoints
- Comprehensive API documentation
- Background job processing with BullMQ
- Error handling and validation
Tech Stack Updates
socket.io: Real-time WebSocket communicationyt-dlp: Cross-platform video extractionswagger-jsdoc&swagger-ui-express: API documentationbullmq: Background job queue (from V1)redis: Queue storage (from V1)
API Endpoints
Auth:
POST /api/v1/auth/register- Register userPOST /api/v1/auth/login- LoginPOST /api/v1/auth/logout- Logout
Downloads:
POST /api/v1/downloads- Create downloadGET /api/v1/downloads/{id}- Get download detailsGET /api/v1/downloads/{id}/status- Poll status (optional, use WebSocket instead)GET /api/v1/downloads/info?url=...- Get video formats/qualitiesPOST/DELETE /api/v1/downloads/{id}/favorite- Manage favoritesGET /api/v1/downloads/favorites- Get favorites list
WebSocket Events
// Client subscribes to download
socket.emit('subscribe-download', downloadId);
// Server broadcasts status updates
socket.on('download-status', {
downloadId: string,
status: 'PROCESSING' | 'COMPLETED' | 'FAILED',
progress: 0-100,
error?: string
});Documentation
Interactive API docs available at: http://localhost:3000/api-docs
Known Limitations
- TikTok extraction is unreliable due to platform anti-bot measures
- File downloads go directly to user device (as designed)
- No persistent file storage on server (by design)
Next Steps (V3 Roadmap)
- Add more providers (Instagram, Facebook, Reddit, X/Twitter)
- Improve TikTok extraction (alternative methods)
- Browser extension for one-click downloads
- Mobile app (iOS/Android)
- Premium features (faster downloads, priority queue)
- Analytics dashboard
- User subscriptions and payments
- Admin panel
Breaking Changes from V1
- Removed file serving endpoints (no longer needed)
- Download metadata now includes error messages
- Provider contract changed: returns downloadUrl instead of filePath
Setup
# Install dependencies
npm install
# Set up environment
cp .env.example .env
# Run migrations
npx prisma migrate dev
# Start API
npm run dev
# In another terminal, start worker
npm run workerContributors
Built with focus on clean architecture, scalability, and production-grade practices.