diff options
author | Nick White <git@njw.name> | 2020-09-28 17:15:09 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2020-09-28 17:15:09 +0100 |
commit | 6809e665273e2a4626d1494bd201f8059688bcd0 (patch) | |
tree | 7b9dc1369431162159ee61dd787fc8bd5db9470c /cmd | |
parent | 02cd2607c79c243070eb072eea78654683b39c96 (diff) |
[iiifdownloader] Work around oxford needing the iiif suffix adding to its id
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/iiifdownloader/main.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/iiifdownloader/main.go b/cmd/iiifdownloader/main.go index 507293b..737cdb5 100644 --- a/cmd/iiifdownloader/main.go +++ b/cmd/iiifdownloader/main.go @@ -153,7 +153,14 @@ func parseIIIFManifest(u string) ([]string, error) { for _, canvas := range v.Sequences[0].Canvases { for _, image := range canvas.Images { - urls = append(urls, image.Resource.Id) + u := image.Resource.Id + // iiif.bodleian.ox.ac.uk serves manifests that use an ID which + // redirects to a info.json unless we manually add the appropriate + // iiif parameters. + if !strings.HasSuffix(u, ".jpg") && !strings.HasSuffix(u, ".jpeg") { + u += "/full/full/0/native.jpg" + } + urls = append(urls, u) } } |