Skip to content

fix(chat): expand grouped media exports#1245

Open
expary wants to merge 1 commit into
iyear:masterfrom
expary:expary/fix-chat-export-grouped-media
Open

fix(chat): expand grouped media exports#1245
expary wants to merge 1 commit into
iyear:masterfrom
expary:expary/fix-chat-export-grouped-media

Conversation

@expary

@expary expary commented May 31, 2026

Copy link
Copy Markdown

Problem

tdl chat export currently writes only the message that directly matches the filter. For grouped media albums, Telegram stores each media item as a separate message sharing the same grouped ID. If only one item in the album contains the matched text, the export JSON includes only that item, so a later tdl dl -f export.json misses the rest of the album.

Changes

  • add an export message expander that runs the filter on the iterated message
  • when the matched message belongs to grouped media, resolve the whole group with tutil.GetGroupedMessages
  • export every downloadable message in the matched group
  • deduplicate message IDs so later iterator hits from the same group are not written twice
  • preserve existing --all, --with-content, and --raw export behavior for each emitted message

Tests

  • go test ./app/chat -count=50
  • go test ./app/chat ./app/dl ./pkg/tmessage
  • go test $(go list ./... | grep -v '^github.com/iyear/tdl/test$') ./core/... ./extension/...

Closes #1207

When a filtered message belongs to a grouped media album, export all downloadable messages from that group and deduplicate later iterator hits.

Closes iyear#1207
@expary expary requested a review from XMLHexagram as a code owner May 31, 2026 23:02
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.

[Bug] The exported JSON file is missing some video IDs.导出的json文件缺少id

1 participant