Tyrrrz / DiscordChatExporter

Exports Discord chat logs to a file
MIT License
7.48k stars 682 forks source link

Remove CDN signature before hashing asset URL #1138

Closed slatinsky closed 11 months ago

slatinsky commented 11 months ago

Discord recently introduced signed cdn links. This change breaks --reuse-media for assets, because url is used to detect if the file is already downloaded.

This pull request solves this issue by stripping out ex, is and hm query params before hashing the url.

slatinsky commented 11 months ago

check for discord cdn added. Also added (simple) check if the url is really signed by checking for ex is and hm substrings (could be improved with regex if needed). For example avatars and emojis are not signed.

Also fixed formatting error introduced by the previous PR.

Tyrrrz commented 11 months ago

Thanks!