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

Can't get images from https://bibliotheques-specialisees.paris.fr #1

Open
julienperret opened this issue Mar 5, 2020 · 0 comments
Open

Comments

@julienperret
Copy link
Member

I don't know if it comes from the website (limited access?), from the library or from my code (I tried different things), but I can't seem to download the images from, for instance the following ark identifier:
https://bibliotheques-specialisees.paris.fr/ark:/73873/pf0000935116

from gallipy import Resource, Ark
def save(either, filename):
  print('save')
  # Handle exceptions here
  if either.is_left:
    raise either.value
  # Otherwise we can safely unwrap its content.
  with open(filename,'wb') as file:
    file.write(either.value)
  return either  # Enables method chaining.
my_ark = 'https://bibliotheques-specialisees.paris.fr/ark:/73873/pf0000935116'
filename = 'pf0000935116.png'
# Async call: save(either, filename) is a callback method.
#Resource(my_ark).content(startview=1, nviews=17, mode='pdf').map(lambda x: save(x, filename))
ark = Ark.parse(my_ark) # Parse the ark
ark.map(print)
ark.map(lambda x : print(repr(x)))
ark.map(lambda x : print(x.arkid))
#Ark.parse(my_ark).map(Resource).value.iiif_data(view='v0014.simple').map(lambda x: save(x, filename))
Resource(my_ark).iiif_data(view=1).map(lambda x: save(x, filename))
ark.map(lambda x : print(repr(x.arkid)))
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

1 participant