broader try blocks
This commit is contained in:
parent
e5fcb50e70
commit
2d1b968780
1 changed files with 5 additions and 5 deletions
10
robot.py
10
robot.py
|
@ -60,9 +60,9 @@ def handle_url(bot, update):
|
||||||
filter(lambda e: e.type == 'url',
|
filter(lambda e: e.type == 'url',
|
||||||
update.message.entities))))
|
update.message.entities))))
|
||||||
if len(ytdl_urls) > 0:
|
if len(ytdl_urls) > 0:
|
||||||
logger.info("Downloading %s" % ytdl_urls)
|
|
||||||
update.message.reply_text('Downloading now...')
|
|
||||||
try:
|
try:
|
||||||
|
logger.info("Downloading %s" % ytdl_urls)
|
||||||
|
update.message.reply_text('Downloading now...')
|
||||||
download_ydl(ytdl_urls)
|
download_ydl(ytdl_urls)
|
||||||
except:
|
except:
|
||||||
type, value, _ = sys.exc_info()
|
type, value, _ = sys.exc_info()
|
||||||
|
@ -82,10 +82,10 @@ def handle_rest(bot, update):
|
||||||
elif update.message.video is not None:
|
elif update.message.video is not None:
|
||||||
file = update.message.video.file_id
|
file = update.message.video.file_id
|
||||||
if file is not None:
|
if file is not None:
|
||||||
url = bot.getFile(file).file_path
|
|
||||||
update.message.reply_text('Downloading now...')
|
|
||||||
logger.info("Downloading '%s'" % url)
|
|
||||||
try:
|
try:
|
||||||
|
url = bot.getFile(file).file_path
|
||||||
|
update.message.reply_text('Downloading now...')
|
||||||
|
logger.info("Downloading '%s'" % url)
|
||||||
download_raw(url)
|
download_raw(url)
|
||||||
except:
|
except:
|
||||||
type, value, _ = sys.exc_info()
|
type, value, _ = sys.exc_info()
|
||||||
|
|
Loading…
Reference in a new issue