Added some try catch
This commit is contained in:
parent
37441d2dd4
commit
64559d3668
1 changed files with 10 additions and 3 deletions
|
@ -29,9 +29,16 @@ def titles_route():
|
||||||
if image_cache:
|
if image_cache:
|
||||||
titles[title]["image"] = image_cache.image
|
titles[title]["image"] = image_cache.image
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
toloka_torrent = config.toloka.get_torrent(
|
toloka_torrent = config.toloka.get_torrent(
|
||||||
f"https://toloka.to/{titles[title]['guid']}"
|
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 = (
|
toloka_img = (
|
||||||
f"https:{toloka_torrent.img}"
|
f"https:{toloka_torrent.img}"
|
||||||
if toloka_torrent.img.startswith("//")
|
if toloka_torrent.img.startswith("//")
|
||||||
|
|
Loading…
Reference in a new issue