From 2d1b9687809e194809e3d03b75ebcd16d8425ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Wed, 31 Jan 2018 12:40:42 +0100 Subject: [PATCH] broader try blocks --- robot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/robot.py b/robot.py index 1f7dc7b..1c87fd6 100755 --- a/robot.py +++ b/robot.py @@ -60,9 +60,9 @@ def handle_url(bot, update): filter(lambda e: e.type == 'url', update.message.entities)))) if len(ytdl_urls) > 0: - logger.info("Downloading %s" % ytdl_urls) - update.message.reply_text('Downloading now...') try: + logger.info("Downloading %s" % ytdl_urls) + update.message.reply_text('Downloading now...') download_ydl(ytdl_urls) except: type, value, _ = sys.exc_info() @@ -82,10 +82,10 @@ def handle_rest(bot, update): elif update.message.video is not None: file = update.message.video.file_id if file is not None: - url = bot.getFile(file).file_path - update.message.reply_text('Downloading now...') - logger.info("Downloading '%s'" % url) try: + url = bot.getFile(file).file_path + update.message.reply_text('Downloading now...') + logger.info("Downloading '%s'" % url) download_raw(url) except: type, value, _ = sys.exc_info()