Skip to content

feat(chat-media): extract chat history timestamps and sender metadata with automated FFmpeg conversion - #3

Open
satsinush wants to merge 6 commits into
sean-mehra:mainfrom
satsinush:fix-new-export-format
Open

feat(chat-media): extract chat history timestamps and sender metadata with automated FFmpeg conversion#3
satsinush wants to merge 6 commits into
sean-mehra:mainfrom
satsinush:fix-new-export-format

Conversation

@satsinush

Copy link
Copy Markdown

Overview

This PR enhances chat media processing by pulling exact timestamps, sender info, and conversation titles directly from chat_history.json, while ensuring batch media conversions run seamlessly without manual prompts.

Key Changes

1. Chat Media History & Timestamp Resolution (Primary)

  • Added get_chat_media_datetime() to resolve timestamps using a 3-tier priority:
    1. chat_history.json Lookup: Matches media IDs (mid) to retrieve exact creation time, sender ("You" vs contact), and chat title.
    2. File System Stat Fallback: Reads st_ctime / st_mtime to preserve precise creation time of saved files when JSON metadata isn't available.
    3. Date Fallback: Uses filename date prefix (YYYY-MM-DD).
  • Updated console logging in process_chat_media() to output sender details (e.g. (From: You, Chat: Best Friends)).

2. Non-Interactive FFmpeg Processing

  • Added -y and -nostdin flags across convert_to_mp3(), merge_video_clips(), and overlay functions.
  • Prevents FFmpeg from listening to standard input or halting on overwrite prompts, allowing voice messages and videos to convert automatically in batch without pressing Enter.

Verification

  • Verified code compilation via py_compile.
  • Tested metadata extraction against chat_history.json records and verified non-interactive voice message conversion.

…h sender logging

- Add `get_chat_media_datetime()` to match media IDs with `chat_history.json` for exact UTC timestamps, sender details, and chat titles.
- Fall back gracefully to file system timestamps (`st_ctime`/`st_mtime`) and date matching when JSON records are absent.
- Pass `-y` and `-nostdin` to FFmpeg calls (`convert_to_mp3`, video operations) to run non-interactively without stdin prompt pauses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant