Hi, I have a Python program where you can create your own bookshelf.
Database and everything are working fine, everything is almost done. But I
noticed that there are some books (during the search) that loads forever
and Terminal returns me (infinite times):
```
DEBUG: https://www.googleapis.com:443 "GET /books/v1/volumes?q=moby%20dick
HTTP/1.1" 200 None
DEBUG: Starting new HTTPS connection (1): www.googleapis.com:443
```
Here is my code:
@app.route('/search', methods=["GET", "POST"])
@login_required
def search():
if request.method == "POST":
while True:
try:
seek = request.form.get("seek")
url = f
'https://www.googleapis.com/books/v1/volumes?q={seek}'
response = requests.get(url)
response.raise_for_status()
search = response.json()
seek = search['items']
infobooks = []
for i in range(len(seek)):
infobooks.append({
"book_id": seek[i]['id'],
"thumbnail":
seek[i]['volumeInfo']['imageLinks']['thumbnail'],
"title": seek[i]['volumeInfo']['title'],
"authors": seek[i]['volumeInfo']['authors']
})
return render_template("index.html", infobooks = infobooks)
except (requests.RequestException, KeyError, TypeError,
ValueError):
continue
else:
return render_template("index.html")
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/ae8fe44f-4e81-4fc7-a296-298d8b28066fn%40googlegroups.com.