diff --git a/backend/stream.py b/backend/stream.py index c8413b3..d5c2623 100755 --- a/backend/stream.py +++ b/backend/stream.py @@ -14,8 +14,6 @@ import aiohttp import aiohttp_socks import html.parser import stream_providers -import tracemalloc -tracemalloc.start() logging.basicConfig(format='[%(filename)s:%(lineno)d] %(message)s', stream=sys.stdout, level=logging.INFO) logger = logging.getLogger(__name__) @@ -203,21 +201,25 @@ class UpstreamHandler(): resp_upstream_future = session.get(self.upstream) try: resp_embed = await resp_embed_future - except Exception: + except Exception as e: + logger.info(e) resp_embed = None try: resp_upstream = await resp_upstream_future - except Exception: + except Exception as e: + logger.info(e) resp_upstream = None text_embed_future = resp_embed.text() text_upstream_future = resp_upstream.text() try: text_embed = await text_embed_future - except Exception: + except Exception as e: + logger.info(e) text_embed = None try: text_upstream = await text_upstream_future - except Exception: + except Exception as e: + logger.info(e) text_upstream = None parser = MetaParser() parser.feed(text_upstream) @@ -244,11 +246,13 @@ class UpstreamHandler(): image_status_standard_future = session.head(standard_image) try: image_status_full = await image_status_full_future - except Exception: + except Exception as e: + logger.info(e) image_status_full = None try: image_status_standard = await image_status_standard_future - except Exception: + except Exception as e: + logger.info(e) image_status_standard = None if hasattr(image_status_full, "status") and (image_status_full.status < 400): data["og:image"] = full_image