xlcnd / isbnlib

python library to validate, clean, transform and get metadata of ISBN strings (for devs).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The description and Cover feature don't seem to work

Gammaslah132 opened this issue · comments

The Bug:
When I ran a program I made to that finds the details of the ISBN, a description, and a cover of it. The cover and description functions didn't work and I got this big long error message which I screenshotted below.

My code was:

from isbnlib import meta, desc, cover
Service = 'openl'
ISBN = input("What is your ISBN number (no spaces) ")
book = meta(ISBN, Service)
print(book)
print(desc(ISBN))
bookCover = cover(ISBN)

Screenshot of Error:
Screen Shot 2019-04-25 at 12 20 13 PM
Screen Shot 2019-04-25 at 12 20 21 PM

Computer info:

  • OS: [Mac]
  • Python version [3.6]
  • isbnlib version [3.9.6]

If this isn't a bug and an error on my part I would love to know what I did wrong.

commented

Are you in a very slow internet connection?

Does that affect how the feature works?

Let me try it somewhere with better internet and I will let you know if that fixed it

commented

Yes, if your connection is very slow it timeout...

Tried with faster internet and same result

commented

This is not a problem with 'isbnlib', it is a problem with your connection OR python installation.

I see any recommendations on what to do then

commented

Try with a different version of python.

commented

You could check here that isbnlib is working OK.

By the way, what operating system are you using?

commented

Check the firewall settings.

Also, I'm using Python 3.6 and Pycharm

Doesn't seem to work I tried changing the python version and looked at firewall settings.

How fast would my internet to be for it to work?

commented

You don't need a fast internet... ìsbnlib` gives 10 seconds to the connection to be establish (only a very very slow internet needs more than that)!

Something (?!) is blocking the handshake with the Google services, but is not related with isbnlib.

Hmmm wonder what that could be

Does the isbnlib connect to your default browser?

commented

Looking at your script I see that you are using service 'openl' to get the metadata. Did it work?

I got the metadata using openl. I got all the book info from the ISBN.

commented

isbnlibdoesn't use the browser...

Ok was just checking to see if that might be the issue

commented

Can I have the ISBN that you are using?

9780590353427

commented

The description is:

Rescued from the outrageous neglect of his aunt and uncle, a young boy with
a great destiny proves his worth while attending Hogwarts School for
Witchcraft and Wizardry.

And the links to the cover are:

smallThumbnail: http://books.google.com/books/content?id=fo4rzdaHDAwC&printsec=frontcover&img=1&zoom=5&source=gbs_api
thumbnail: http://books.google.com/books/content?id=fo4rzdaHDAwC&printsec=frontcover&img=1&zoom=1&source=gbs_api

commented

In what part of the world you are?

Thanks but I was trying to create a program that allows the user to give a ISBN and then the program gives it to them. Europe

commented

Maybe it is only a problem with Google Books services for your country... that happens and usually after I couple of hours the problem is gone.

Should I try not using openL

commented

For metadata 'openl' is a good choice ... but you can use just

from isbnlib import meta, desc, cover
ISBN = input("What is your ISBN number (no spaces) ")
print(meta(ISBN))
print(desc(ISBN))
print(cover(ISBN)[1])

and will use the Google Books service.

I got it to work by using this code I found from this website:http://blog.pengyifan.com/how-to-fix-python-ssl-certificate_verify_failed/

import os, ssl if (not os.environ.get('PYTHONHTTPSVERIFY', '') and getattr(ssl, '_create_unverified_context', None)): ssl._create_default_https_context = ssl._create_unverified_context

Thank you for your help though