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

Generate unique WARC file names when creating WACZ files #2

Open
ibnesayeed opened this issue Mar 2, 2023 · 1 comment
Open

Generate unique WARC file names when creating WACZ files #2

ibnesayeed opened this issue Mar 2, 2023 · 1 comment

Comments

@ibnesayeed
Copy link

I was looking at WACZ files generated from ReplayWeb.page and noticed that the WARC file under the archive/ folder is always named data.warc.gz (or data.warc). It looks like the file name is hard-coded.

this.warcName = this.gzip ? "data.warc.gz" : "data.warc";

Would it be practical to add datetime or some other pseudo-unique or unique strings (like a hash or GUID) to the name (e.g., data-YYYYMMDDhhmmss.warc.gz)? One issue I can see is that if the same data is downloaded multiple times, a new timestamp might be added, making the WACZ file bytes non-reproducible, unless we use some deterministic identifier (like the datetime of the first capture or the hash of the WARC file itself, which might require renaming the file after writing data).

If people were to extract WARC files from more than one WACZ files and place them in a single folder, there is a chance of overwriting due to name collisions.

@ikreymer
Copy link
Member

ikreymer commented Mar 2, 2023

Yeah, one of the main reasons for this it to have deterministic output when downloading the WACZ, so that the same file is produced on subsequent downloads. Currently, ArchiveWeb.page should produce the same exact byte-for-byte WACZ, if nothing has changed (of course, if version is updated, it will change). This also becomes important when generating WACZ files to put on IPFS. I suppose the name could be set to the initial creation time, which is also available. data-<collection-creation-date-timestamp>.warc as a possible option.. will check

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

No branches or pull requests

2 participants