File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -41,14 +41,20 @@ def _extract_author(auth):
4141
4242
4343def _extract_language (alpha_3 ):
44+ if not alpha_3 :
45+ return _read_language ()
4446 try :
4547 return pycountry .languages .get (alpha_3 = alpha_3 ).name
4648 except AttributeError :
4749 try :
4850 return pycountry .languages .get (alpha_2 = alpha_3 [:2 ]).name
4951 except AttributeError :
5052 # I give up
51- return input ('Please specify the book\' s Language: ' )
53+ return _read_language ()
54+
55+
56+ def _read_language ():
57+ return input ('Please specify the book\' s Language: ' )
5258
5359
5460def _extract_shelves (shelves , take ):
@@ -104,7 +110,7 @@ def search(self, path):
104110
105111 if isbn :
106112 log .debug ("Searching Goodreads by ISBN {} for '{}'" ,
107- isbn , book [ 'Title' ] )
113+ isbn , book . get ( 'Title' , isbn ) )
108114 return self .show_by_isbn (isbn )
109115 elif book ['Title' ]:
110116 search_term = book ['Title' ]
Original file line number Diff line number Diff line change 33
44"""
55Note, read https://openlibrary.org/dev/docs/api/covers
6- The cover access by ids other than CoverID and OLID are rate-limited.
6+ The cover access by ids other than CoverID and OLID are rate-limited.
77Currently only 100 requests/IP are allowed for every 5 minutes.
8- If any IP tries to access more that the allowed limit,
8+ If any IP tries to access more that the allowed limit,
99the service will return "403 Forbidden" status.
1010"""
1111
12- from .logging import log
13-
1412API_URL = 'http://covers.openlibrary.org/b/{}/{}-{}.jpg'
1513
1614
You can’t perform that action at this time.
0 commit comments