Commit Graph
13 Commits
Author SHA1 Message Date
Mak5er 5a22c39ebe fix(logger): route bot logs to stdout, demote noisy traces to debug, and add startup/shutdown lifecycle logs 2026-09-14 23:41:15 +03:00
Mak5er c15cc22609 feat(download): record download history and summary logs across all media handlers 2026-09-14 15:24:35 +03:00
Mak5erandClaude Fable 5 caffc343af refactor: apply full-project audit — bug fixes, performance, deduplication
Full-codebase audit (149 raw findings, 57 verified and applied).

Fixes:
- download resume: recompute Range header per retry attempt; never resume
  preallocated multipart .part files (silent media corruption)
- inline sends: canonical error tail (rate-limit/queue-busy/timeout/failure)
  for all platforms; YouTube inline no longer strands tokens in
  'processing' for 6h
- admin mailing: exclude banned users; fix Telegram error-text matching
- middlewares: instantiate once and share across message/callback/inline
  so antiflood/ban state no longer fragments
- event loop: move ZIP compression, JSON state persistence, admin FS
  walks, PIL/ffmpeg/ffprobe work off the loop
- download queue: prune idle per-user scopes; cancelled leader releases
  joined duplicate requests
- worker subprocess: disable log sinks (stderr error protocol and log
  rotation no longer race the parent)
- third-party loggers route through app handlers instead of lastResort
- tiktok: fix mojibake reaction emoji; per-user settings in doc callback;
  per-URL locks for short-URL expansion; parallel photo-set downloads
- ci: fix broken yt-dlp auto-bump workflow baseline
- db: drop redundant analytics_events indexes (migration 000010)

Refactoring:
- services/inline/send_flow.py: shared inline delivery flow for all five
  platforms (~640 duplicated lines removed)
- services/media/audio_flow.py: shared MP3 pipeline (was duplicated 6x
  across youtube/youtube_inline/soundcloud/spotify)
- CobaltMediaService base + shared Cobalt response parsing
- services/platforms/ytdlp_helpers.py: shared yt-dlp scaffolding
- register_inline_send_handlers: one chosen_inline_result/callback
  registration factory for 8 handlers
- merge pinterest/threads single-media and media-group flows
- logging decorator factory; remove ~11 dead repository methods

Tests: 470 -> 518 passing, coverage 77.3% -> 80.9% (CI gate 74%).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 16:25:59 +03:00
Mak5er 635e50b407 feat(settings): add media quality & file options, ZIP multi-photo archives, and categorized /settings UI
- Add video_quality, as_document, audio_format, and file_button to user settings schema and Alembic migrations.
- Categorize /settings into Media & Quality, Appearance & Buttons, and Chat & Clean-up with dynamic back navigation.
- Implement strict document delivery with disable_content_type_detection=True to prevent Telegram video player fallback when as_document is ON.
- Add multi-photo ZIP archive packaging for photo carousels in as_document mode.
- Differentiate DB media file cache entries between video and document types (url#document vs url#video) to eliminate cache collisions.
- Hide redundant Download File inline button when as_document setting is active.
- Remove obsolete referral system (/ref command and links).
2026-07-22 13:18:09 +03:00
Mak5er 40662635b7 feat: add Spotify audio downloads and rich metadata
Add Spotify track resolution through YouTube audio sources with oEmbed fallback, caching, routing, analytics, and user-facing support. Normalize MP3 filenames, ID3 tags, JPEG cover art, Telegram thumbnails, and duplicate artist metadata across Spotify, YouTube Music, and SoundCloud. Extend regression coverage for provider parsing, delivery, metadata, covers, cache behavior, and link dispatch.
2026-07-10 12:22:17 +03:00
Mak5er 4ead6d0710 fix: handle business message dedupe safely 2026-06-26 02:55:32 +03:00
Mak5er 35b626dfc6 Embed bot avatar in audio uploads 2026-04-26 12:40:27 +03:00
Mak5er 9cdf29d65e feat: add video metadata handling for Telegram video attributes and update video send kwargs 2026-04-20 18:27:15 +03:00
Mak5er 134ba2b269 fix: send full Instagram carousels beyond Telegram batch limit 2026-04-20 11:52:19 +03:00
Mak5er 26b7873cd0 fix(concurrency): scope parallel media flows per chat
Scope download queue limits by user and chat so the same user can run downloads across multiple chats without tripping a shared pending cap.

Also coalesce concurrent single-media requests by cache key so duplicate links wait for the first upload and then reuse the cached Telegram file_id instead of downloading the same file again.
2026-04-10 19:22:04 +03:00
Mak5er 77c4cda0b8 Refactor logging paths and stabilize db tests 2026-04-10 00:42:21 +03:00
Mak5er 19de714a4a refactor: share media delivery orchestration 2026-04-09 00:45:20 +03:00
Mak5er bb964728a7 refactor: organize services into domain subpackages 2026-04-07 01:08:39 +03:00