Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions noisy.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ def _is_blacklisted(self, url):
:param url: full URL
:return: boolean indicating whether a URL is blacklisted or not
"""
return any(blacklisted_url in url for blacklisted_url in self._config["blacklisted_urls"])
try:
return any(blacklisted_url in url for blacklisted_url in self._config["blacklisted_urls"])
except UnicodeDecodeError:
return True

def _should_accept_url(self, url):
"""
Expand Down Expand Up @@ -171,7 +174,7 @@ def _browse_from_links(self, depth=0):
# remove the dead-end link from our list
self._remove_and_blacklist(random_link)

except requests.exceptions.RequestException:
except (requests.exceptions.RequestException, UnicodeDecodeError):
logging.debug("Exception on URL: %s, removing from list and trying again!" % random_link)
self._remove_and_blacklist(random_link)

Expand Down