Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve filenames for downloaded assets #1232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Lymia
Copy link

@Lymia Lymia commented May 13, 2024

This changes the filenames output by DiscordChatExporter to be more meaningful (in the case of emojis and avatars) and more resilient against collisions.

The hash is 12 characters of base32 now, rather than 5 characters of hexadecimal. This allows for nearly 5 million downloads with the same name before there is even a 0.001% of a single collision. This should actually be enough, even for problematic filenames like those associated with Youtube thumbnails.

Emojis and Discord attachments are instead guaranteed to not collide as they instead contain the unique snowflake of the attachment or emoji. The 19 digit id is significantly longer than the old 5 digit ids - however, reencoding it in base32 would only save 6 characters, so better to use the more recognizable numeric form IMO.

Closes #1231

@Tyrrrz Tyrrrz changed the title Improve filenames for downloaded assets. Improve filenames for downloaded assets May 13, 2024
@Tyrrrz Tyrrrz added bug and removed enhancement labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--reuse-media creates an unacceptably high chance of a collision
2 participants