Merge remote-tracking branch 'scholary/master'

This commit is contained in:
Ozzieisaacs
2021-12-30 14:55:39 +01:00
5 changed files with 9 additions and 12 deletions
+2 -2
View File
@@ -26,14 +26,14 @@ class Google(Metadata):
__name__ = "Google"
__id__ = "google"
def search(self, query, __):
def search(self, query, generic_cover=""):
if self.active:
val = list()
result = requests.get("https://www.googleapis.com/books/v1/volumes?q="+query.replace(" ","+"))
for r in result.json()['items']:
v = dict()
v['id'] = r['id']
v['title'] = r['volumeInfo']['title']
v['title'] = r['volumeInfo'].get('title',"")
v['authors'] = r['volumeInfo'].get('authors', [])
v['description'] = r['volumeInfo'].get('description', "")
v['publisher'] = r['volumeInfo'].get('publisher', "")