Skip to content

Commit

Permalink
Merge pull request #2045 from internetarchive/hotfix/search-debugging
Browse files Browse the repository at this point in the history
relax https->http for internal advancedsearch calls, enable debug
  • Loading branch information
mekarpeles committed Apr 13, 2019
2 parents 50aec13 + ed92cac commit b7574c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openlibrary/core/lending.py
Expand Up @@ -179,14 +179,14 @@ def compose_ia_url(limit=None, page=1, subject=None, query=None, work_id=None,
(sorts if sorts and isinstance(sorts, list) (sorts if sorts and isinstance(sorts, list)
else [''])])) else [''])]))
rows = limit or DEFAULT_IA_RESULTS rows = limit or DEFAULT_IA_RESULTS
url = "https://%s/advancedsearch.php?q=%s&%s&%s&rows=%s&page=%s&output=json" % ( url = "http://%s/advancedsearch.php?q=%s&%s&%s&rows=%s&page=%s&output=json" % (
config_bookreader_host, q, encoded_fields, sort, str(rows), str(page)) config_bookreader_host, q, encoded_fields, sort, str(rows), str(page))
return url return url


def get_random_available_ia_edition(): def get_random_available_ia_edition():
"""uses archive advancedsearch to raise a random book""" """uses archive advancedsearch to raise a random book"""
try: try:
url=("https://%s/advancedsearch.php?q=_exists_:openlibrary_work"\ url=("http://%s/advancedsearch.php?q=_exists_:openlibrary_work"\
"+AND+loans__status__status:AVAILABLE"\ "+AND+loans__status__status:AVAILABLE"\
"&fl=identifier,openlibrary_edition,loans__status__status"\ "&fl=identifier,openlibrary_edition,loans__status__status"\
"&output=json&rows=1&sort[]=random" % (config_bookreader_host)) "&output=json&rows=1&sort[]=random" % (config_bookreader_host))
Expand Down

0 comments on commit b7574c0

Please sign in to comment.