Commit Graph

9 Commits

Author SHA1 Message Date
exostring d01a17146e Retry oversized video downloads instead of giving up permanently
VK can briefly serve a not-yet-transcoded master stream on a capped-height
URL right after a video is published, tripping the size check on the very
first attempt. Treat that as transient (retry with a longer backoff) instead
of failing permanently, and merge the fallback note into a single "Смотреть
видео в VK" link instead of two separate lines.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-04 23:24:06 +05:00
exostring 4ad047b5c3 Retry transient video download failures, friendlier fallback link text, enable previews
- yt-dlp: retry transient failures (stall/timeout) up to 2x before falling
  back to a link-only post; permanent errors (private/removed) still fail fast
- Fallback note: friendlier wording, "Смотреть видео" as link text instead of
  a bare "ссылка", plus a link to the original VK wall post as a backup
- TG: enable link preview for text-only fallback posts (was unconditionally
  disabled, leaving fallback posts with no visual at all)
- MAX: attach the VK video's own thumbnail as an image so failed/oversized
  video fallbacks still show a preview picture (MAX has no OG-preview for
  arbitrary URLs, but does accept a remote image url without upload)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-21 20:36:22 +05:00
exostring ec65aaf57d Fix duplicate-post and timeout bugs in TG/MAX posting pipeline
- Stop blindly retrying send_photo/send_video/send_media_group and MAX
  send_message on ambiguous network timeouts - a timeout doesn't prove
  the message wasn't delivered, and retrying risked posting duplicates
  (observed live: a video posted 3-5x after repeated timeout retries).
- Raise/rework timeouts that were too short for real large-file transfer
  speeds: TG media upload timeout, and yt-dlp download now uses stall
  detection (killed only on true silence) instead of a flat ceiling that
  was cutting off legitimately slow-but-successful video downloads.
- Fix sendRichMessage: ok=true with an unparseable message_id no longer
  triggers a fallback send (Telegram already created the message).
- MAX: videos over the documented 250MB cap are now sent as a "watch via
  link" note instead of silently failing the upload.
- Add PRAGMA busy_timeout to all DB connections.
- Remove unused MAX_MEDIA_CHANNEL_ID (MAX's /uploads returns a portable
  token directly, no staging channel needed, unlike Telegram).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 12:17:47 +05:00
exostring 6a7a995d5f Fix duplicate posting, HTML escaping, restore sendRichMessage correctly
- Stop re-sending to a platform that already succeeded when the other
  platform failed (was causing duplicate posts on partial failure)
- Escape VK post text before sending with parse_mode=HTML instead of
  only escaping matched bracket-link substrings (bare & < > broke sends)
- Restore Telegram sendRichMessage (Bot API 10.1) ported faithfully from
  new_vk_parser's proven implementation, with fallback to standard
  send_photo/send_video/send_media_group
- Restore "media unavailable" note when a video/photo fails to download
  instead of silently dropping it
- Handle YouTube link attachments from VK posts (route into yt-dlp)
- MAX: chunk media beyond 10 items into follow-up messages instead of
  dropping them
- yt-dlp format selector no longer falls back to unconstrained height
- Wire up VK_RATE_LIMIT_RPS, drop unused Pillow dep and dead config fields
2026-08-14 21:21:57 +05:00
exostring bcdb352cca Fix yt-dlp file creation and clean video pipeline 2026-08-14 19:59:33 +05:00
exostring 144dd3cb52 Support full 2GB/2h video downloads via Local Bot API, clean VK wiki links and remove fallback links 2026-08-14 19:46:16 +05:00
exostring 3ded8d3edd Ensure loguru logger import in all modules 2026-08-14 19:27:57 +05:00
exostring de8501045f Fix import resolution for direct execution 2026-08-14 19:21:52 +05:00
exostring 41722c0ffc Initial commit for RedAirsoft VK to TG and MAX poster 2026-08-14 19:10:27 +05:00