From eb53df610e8c6f306b30a15faad48e820b59c822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Mon, 5 Feb 2018 12:38:33 +0100 Subject: [PATCH] add #ignore tag --- robot.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/robot.py b/robot.py index baf6983..bbd0665 100755 --- a/robot.py +++ b/robot.py @@ -105,6 +105,10 @@ def handle_url(bot, update): logger.info("Downloading %s" % ytdl_urls) hashtag = get_first_hashtag(update.message) + if hashtag == 'IGNORE': + update.message.reply_text('Ignoring...') + return + reply = 'Downloading' if hashtag: mkdir_p(f'{OUT_DIR}/{hashtag}') @@ -141,12 +145,17 @@ def handle_rest(bot, update): url = bot.getFile(file).file_path logger.info("Downloading %s" % url) hashtag = get_first_hashtag(update.message) + if hashtag == 'IGNORE': + update.message.reply_text('Ignoring...') + return + reply = 'Downloading' if hashtag: mkdir_p(f'{OUT_DIR}/{hashtag}') reply += f' to "{hashtag}"' reply += '...' update.message.reply_text(reply) + if hashtag: mkdir_p(f'{OUT_DIR}/{hashtag}') download_raw(url, filename, hashtag or '.', update.message.date)