diff --git a/modules/title.py b/modules/title.py index b3d2fd85..d06ec24d 100644 --- a/modules/title.py +++ b/modules/title.py @@ -10,11 +10,11 @@ class Module(ModuleManager.BaseModule): def _get_title(self, url): try: page = utils.http.request(url, soup=True) + except utils.http.HTTPWrongContentTypeException: + return None except Exception as e: self.log.error("failed to get URL title", [], exc_info=True) return None - except utils.http.HTTPWrongContentTypeException: - return None if page.data.title: return page.data.title.text.replace("\n", " ").replace( "\r", "").replace(" ", " ").strip()