DiscordChatExporter icon indicating copy to clipboard operation
DiscordChatExporter copied to clipboard

HTML --media option doesn't download emoji

Open ghost opened this issue 3 years ago • 4 comments

Version

v2.28.0

Flavor

CLI (Command Line Interface)

Export format

HTML

Details

Using the HTML format with the --media option doesn't download emojis. They remain as links to Discord servers and twemoji.maxcdn.com. All emojis, especially custom ones, should be downloaded so that they're viewable offline or if the original Discord server is deleted.

Steps to reproduce

  1. Create a channel and post some messages containing single emojis.
  2. Export it with the HTML format and the --media option.
  3. Open the generated HTML file.

The HTML file contains lines such as

<span class="preserve-whitespace"><img class="emoji emoji--large" alt="🎉" title="tada" src="https://twemoji.maxcdn.com/2/svg/1f389.svg"></span>

for Discord emojis and

<span class="preserve-whitespace"><img class="emoji emoji--large" alt="foo" title="foo" src="https://cdn.discordapp.com/emojis/858851733346582541.png"></span>

for custom emojis. The files directory doesn't contain the emojis.

ghost avatar Jun 27 '21 23:06 ghost

I think all we're technically missing is ResolveUrlAsync(...) here: https://github.com/Tyrrrz/DiscordChatExporter/blob/95cd6cb50cc1498a3512818c50f9990be0d01421/DiscordChatExporter.Core/Exporting/Writers/MarkdownVisitors/HtmlMarkdownVisitor.cs#L128-L137

However, the visitor processes nodes synchronously, so we need to find a way to transform the URLs at a later stage instead.

Tyrrrz avatar Jun 28 '21 10:06 Tyrrrz

Interestingly the emoji reactions appear to be downloaded when using --media.

Dani21 avatar Jul 04 '21 03:07 Dani21

Interestingly the emoji reactions appear to be downloaded when using --media.

Those are separate

Tyrrrz avatar Jul 04 '21 12:07 Tyrrrz

First time user and I noticed this mismatch too between reactions downloading and custom emoji not. A bit of an archival bummer and would love to see this fixed.

(Btw thanks for all the hard work on this project guys! It's a shame discord doesn't export natively 😮‍💨)

Jayowend avatar Jul 14 '21 22:07 Jayowend