修复问题2
This commit is contained in:
16
server.js
16
server.js
@@ -803,6 +803,22 @@ app.post('/api/stop-transcode', (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/progress', (req, res) => {
|
||||
try {
|
||||
const key = typeof req.query.key === 'string' ? req.query.key.trim() : '';
|
||||
if (!key) {
|
||||
return res.status(400).json({ error: 'Video key is required' });
|
||||
}
|
||||
|
||||
const progressKey = getProgressKey(key);
|
||||
const progress = progressMap[progressKey] || null;
|
||||
res.json({ progress });
|
||||
} catch (error) {
|
||||
console.error('Error fetching progress:', error);
|
||||
res.status(500).json({ error: 'Failed to fetch progress', detail: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/stream', async (req, res) => {
|
||||
const bucket = req.query.bucket;
|
||||
const key = req.query.key;
|
||||
|
||||
Reference in New Issue
Block a user