We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40d22b1 commit fb5ba59Copy full SHA for fb5ba59
1 file changed
pythonbits/goodreads.py
@@ -41,7 +41,14 @@ def _extract_author(auth):
41
42
43
def _extract_language(alpha_3):
44
- return pycountry.languages.get(alpha_3=alpha_3).name
+ try:
45
+ return pycountry.languages.get(alpha_3=alpha_3).name
46
+ except AttributeError:
47
48
+ return pycountry.languages.get(alpha_2=alpha_3[:2]).name
49
50
+ # I give up
51
+ return input('Please specify the book\'s Language: ')
52
53
54
def _extract_shelves(shelves, take):
0 commit comments