summaryrefslogtreecommitdiff
path: root/nypl_recrop.rb
diff options
context:
space:
mode:
authorRyan Baumann <ryan.baumann@gmail.com>2016-08-23 16:19:31 -0400
committerRyan Baumann <ryan.baumann@gmail.com>2016-08-23 16:19:31 -0400
commitc90c7ee64a30332a5dc0e44fbc613b580782eed5 (patch)
tree9a0b512e164f3f1627553a1e43a34d6e3bd88fe0 /nypl_recrop.rb
parent48b73c35c312d9a00d94f34bffc7d5e1a8f10904 (diff)
Guard against case where there's no highResLink
Diffstat (limited to 'nypl_recrop.rb')
-rwxr-xr-xnypl_recrop.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/nypl_recrop.rb b/nypl_recrop.rb
index 4ca1843..304fc29 100755
--- a/nypl_recrop.rb
+++ b/nypl_recrop.rb
@@ -27,6 +27,11 @@ if matching_captures && matching_captures.length > 0
highres_url = matching_captures[0]['highResLink']
lowres_url = stereo_metadata['url']
+ if highres_url.nil? || highres_url.empty?
+ puts image_captures.to_json
+ abort("No highResLink for #{digital_id}")
+ end
+
# download images
$stderr.puts "Downloading images..."
`wget -nc -O #{ARGV[0]}.jpg '#{lowres_url}'`