song name
This commit is contained in:
@@ -263,7 +263,7 @@ export class QuixoticBot {
|
||||
await this.bot.sendAudio(chatId, audioUrl, {
|
||||
title: title,
|
||||
performer: performer || 'SoundCloud',
|
||||
caption: `🎵 ${title}`,
|
||||
caption: undefined,
|
||||
thumbnail: thumbnail,
|
||||
parse_mode: undefined
|
||||
});
|
||||
@@ -274,7 +274,7 @@ export class QuixoticBot {
|
||||
// Fallback: try as document
|
||||
try {
|
||||
await this.bot.sendDocument(chatId, audioUrl, {
|
||||
caption: `🎵 ${title}`,
|
||||
caption: undefined,
|
||||
parse_mode: undefined
|
||||
});
|
||||
console.log(`✅ Document sent: ${title}`);
|
||||
|
||||
@@ -90,7 +90,7 @@ app.post('/api/search', async (req: Request, res: Response) => {
|
||||
// Convert video to MP3
|
||||
app.post('/api/convert', async (req: Request, res: Response) => {
|
||||
try {
|
||||
const { videoId, title, userId, url }: { videoId?: string; title?: string; userId?: string; url?: string } = req.body;
|
||||
const { videoId, title, userId, url, performer }: { videoId?: string; title?: string; userId?: string; url?: string; performer?: string } = req.body;
|
||||
console.log('Convert request received:', { videoId, title, userId });
|
||||
|
||||
if (!videoId) {
|
||||
@@ -99,7 +99,8 @@ app.post('/api/convert', async (req: Request, res: Response) => {
|
||||
|
||||
// Generate safe filename
|
||||
const safeTitle = (title || '').replace(/[^\w\s-]/g, '').replace(/\s+/g, '_').substring(0, 50);
|
||||
const filename = `${videoId}_${safeTitle}.mp3`;
|
||||
const safePerformer = (performer || '').replace(/[^\w\s-]/g, '').replace(/\s+/g, '_').substring(0, 20);
|
||||
const filename = safePerformer ? `${safePerformer} - ${safeTitle}.mp3` : `${safeTitle}.mp3`;
|
||||
const outputPath = path.join(downloadsDir, filename);
|
||||
|
||||
// Check if file already exists
|
||||
|
||||
Reference in New Issue
Block a user