Updated errors to print out url

This commit is contained in:
Anon 2023-10-21 15:58:34 -07:00
parent 22c5a6e231
commit af2e4df3dc
3 changed files with 6 additions and 6 deletions

View File

@ -123,13 +123,13 @@ class downloader:
search_request = requests.get(search_url, headers=self.header)
if search_request.status_code != 200:
print("Search request returned:", search_request.status_code)
print("Search {} request returned: {}".format(search_url, search_request.status_code))
return None
selected = select_from_response(search_request.json(), profile, self.max_size)
if selected is None:
print("Could not select image based on criteria")
print("Could not select image based on criteria", search_url)
return None
tag_response = collect_tags(selected)

View File

@ -146,7 +146,7 @@ class downloader:
search_ok = search_request.status_code == 200
if not search_ok:
print("Search request returned:", search_request.status_code)
print("Search {} request returned: {}".format(search_url, search_request.status_code))
return None
posts = search_request.json()["post"]
@ -155,7 +155,7 @@ class downloader:
selected = select_from_response(posts, profile, self.max_size)
if selected is None:
print("Could not select image based on criteria")
print("Could not select image based on criteria", search_url)
return None
tag_response = collect_tags(selected)

View File

@ -136,7 +136,7 @@ class downloader:
search_request = self.search(search_url)
if search_request.status_code != 200:
print("Search request returned:", search_request.status_code)
print("Search {} request returned: {}".format(search_url, search_request.status_code))
continue
posts = search_request.json()
@ -145,7 +145,7 @@ class downloader:
selected = select_from_response(posts, profile)
if selected is None:
print("Could not select image based on criteria")
print("Could not select image based on criteria", search_url)
time.sleep(2)
search_request = self.search(search_url_html)