diff --git a/app/api/titles.py b/app/api/titles.py index eb67b66..a768984 100644 --- a/app/api/titles.py +++ b/app/api/titles.py @@ -29,9 +29,16 @@ def titles_route(): if image_cache: titles[title]["image"] = image_cache.image else: - toloka_torrent = config.toloka.get_torrent( - f"https://toloka.to/{titles[title]['guid']}" - ) + try: + toloka_torrent = config.toloka.get_torrent( + f"https://toloka.to/{titles[title]['guid']}" + ) + except AttributeError as e: + print(f"https://toloka.to/{titles[title]['guid']}") + config.logger.warning( + f"Failed to get https://toloka.to/{titles[title]['guid']} torrent: {str(e)}" + ) + pass toloka_img = ( f"https:{toloka_torrent.img}" if toloka_torrent.img.startswith("//")