Only output file download error text when logging is turned up.
[clinton/thingy_grabber.git] / thingy_grabber.py
index f35eb5b..c4fb963 100755 (executable)
@@ -682,7 +682,9 @@ class Thing:
                     file_link.name, file_link.link, file_name))
                 data_req = SESSION.get(file_link.link)
                 if data_req.status_code != 200:
-                    logging.error("Unexpected status code {} for {}: {}".format(data_req.status_code,
+                    logging.error("Unexpected status code {} for {}".format(data_req.status_code,
+                                                                                sanitise_url(file_link.link)))
+                    logging.debug("Unexpected status code {} for {}: {}".format(data_req.status_code,
                                                                                 sanitise_url(file_link.link),
                                                                                 data_req.text))
                     fail_dir(self.download_dir)