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

Try to save files with correct extension 2 #251

Closed
jathri opened this issue Oct 11, 2024 · 6 comments
Closed

Try to save files with correct extension 2 #251

jathri opened this issue Oct 11, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@jathri
Copy link

jathri commented Oct 11, 2024

Hello,
great tool that works (using 7e5242b with --exporthtml option). My only problem is similar like in #232. It is that some files are saved with a .bin extension. And basename is in format: Attachment_1_-1. But I can see that whole filename is present in html file (like Attachment 'search.json.mozlz4'). Can signalbackup-tools_win be improved so as the files are saved with the name from chat? Can attach screens if needed.

@bepaald
Copy link
Owner

bepaald commented Oct 12, 2024

Hi!

While it is technically possible to do this, it would be a lot of work. The output of the tool when exporting to directory is meant as a more or less literal representation of the backup contents. It can be read back by the tool to create a valid Android backup file again. Changing the filenames would make this process much, much more difficult. And then there is the problem of duplicate filenames, you might end up with image.jpg and image (2).jpg, and ten more similarly named files. The tool would need to somehow figure out which file is the one that corresponds to a specific message.

What is the use-case here? Generally when exporting a backup file to directory, one would work with the SQL database that is exported. This can then be used to match the attachments to certain messages (and filenames), all this info is in the database. If you just want to save the media from the backup, but do not want the HTML to be generated, maybe try --dumpmedia? Does that do what you want?

Thanks!

@jathri
Copy link
Author

jathri commented Oct 12, 2024

Hello, I do not believe that html exports are used for creating backup files again. There are better formats for that. Html exports are used for convenienece (to read info comfortably). And part of this convenience package could be real names of files. Note: It is just feature proposal. Perhaps new parameter could be added (to export files with real names). For users who do not care about creating backup file back again. But I respect the argument that it would be a lot of time or that the priority for this is low.

@bepaald
Copy link
Owner

bepaald commented Oct 12, 2024

O sorry, I think I misunderstood your initial message. I'll take a better look at it when I get home later today.

@bepaald
Copy link
Owner

bepaald commented Oct 12, 2024

Ok, apologies again, in my initial reply for some reason I had gotten it in my head you wanted original filenames for attachments when exporting the raw backup to directory (not HTML export, but just signalbackup-tools [input] [passphrase] -o OUTDIR/).

For the HTML export, the reason for the current file naming scheme is that using the original filenames would break the --append option (which is quite useful). But I have no problem adding a switch for using the original filenames, which then also disallows --append (will only work with --overwrite, or an empty output directory). Not sure when I'll get to it, but I'll give it a go and report back here when i have something to test.

Thanks!

@bepaald bepaald added the enhancement New feature or request label Oct 12, 2024
bepaald added a commit that referenced this issue Oct 14, 2024
…(almost done I think). Fix sorting of HTML search results. Update emoji list. Shrink searchidx.js some. Some refactoring (fileSize()). Warn when Desktop data directory is not found. Adjustments to CSS.
@bepaald
Copy link
Owner

bepaald commented Oct 16, 2024

I believe this feature is done. The option is --originalfilenames. When this option is supplied, the directory passed to --exporthtml must either be empty, non-existing, or --overwrite must also be supplied.

Please test it and let me know if it behaves as you'd expect.

Thanks!

@jathri
Copy link
Author

jathri commented Oct 16, 2024

Yes, it works exactly like it should :) Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants