-
Notifications
You must be signed in to change notification settings - Fork 73
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
Tools for working with WACZs #3670
Tools for working with WACZs #3670
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3670 +/- ##
===========================================
+ Coverage 69.01% 69.45% +0.43%
===========================================
Files 54 54
Lines 7478 7542 +64
===========================================
+ Hits 5161 5238 +77
+ Misses 2317 2304 -13 ☔ View full report in Codecov by Sentry. |
Edge case: I should double check (and add to the test suite) what happens when you manually request to download the WACZ of a Perma Link for which there is only a WARC. The button won't appear in the tray, and the API will report |
Ah, yep, if you manually construct URLs like
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Nice work @rebeccacremona!
See LIL-2863.
We recently started saving WACZs from Scoop instead of WARCs. We have long had some facility for users to download Perma Links' WARC files, both using the API and via the GUI. This PR adds identical functionality for WACZ files:
wacz_size
andwacz_download_url
fields have been added to theLink
andAuthenticatedLink
serializers, so that any API route that includes information aboutLink
objects will now return that infothe
warc_download_url
field was updated: it will now be populated if a WARC or a WACZ is available for a given Perma Link, since the WARC can be extracted from the WACZ and served.a "Download WACZ" button has been added to the tray next to the "Download WARC" button, when a WACZ is available:
For compatibility, that "button" is a link pointing to a URL of the form
https://perma.test:8000/B925-DU9S?type=wacz_download
, following the pattern of the WARC "button", which is a URL of the formhttps://perma.test:8000/B925-DU9S?type=warc_download
. (This pattern predates the existence of the/download
API route.)The only change in existing functionality: now, if a Perma Link redirects to another Perma Link (as with
https://perma.cc/AAAA-AAAA
), the file format will always be included in the query string of the redirected API request to download it (e.g.https://api.perma.cc/v1/archives/69AE-PWJB/download?file_format=warc
).