fix: use .png instead of .webp for Telegram photo URL
This commit is contained in:
@@ -345,10 +345,12 @@ async function publishOne(scheduledPost) {
|
||||
} catch(_) { /* внешний URL или файл не найден — считаем реальным */ }
|
||||
|
||||
if (coverIsReal) {
|
||||
photoUrl = article.cover_url.startsWith('http')
|
||||
? article.cover_url
|
||||
: `https://zeropost.ru${article.cover_url}`;
|
||||
console.log(`[scheduled-runner] cover=${article.cover_url.split('/').pop()} article=${article.id}`);
|
||||
// Telegram не принимает .webp по URL — используем .png версию
|
||||
const coverForTg = article.cover_url.replace(/\.webp$/, '.png');
|
||||
photoUrl = coverForTg.startsWith('http')
|
||||
? coverForTg
|
||||
: `https://zeropost.ru${coverForTg}`;
|
||||
console.log(`[scheduled-runner] cover=${coverForTg.split('/').pop()} article=${article.id}`);
|
||||
} else {
|
||||
const attempts = scheduledPost.cover_regen_attempts || 0;
|
||||
const MAX_REGEN_ATTEMPTS = 3; // 3 × 15 мин = 45 мин максимум ждём
|
||||
|
||||
Reference in New Issue
Block a user