add #ignore tag
This commit is contained in:
parent
0e0dd5a468
commit
38eb2f335a
1 changed files with 9 additions and 0 deletions
9
robot.py
9
robot.py
|
@ -105,6 +105,10 @@ def handle_url(bot, update):
|
||||||
logger.info("Downloading %s" % ytdl_urls)
|
logger.info("Downloading %s" % ytdl_urls)
|
||||||
hashtag = get_first_hashtag(update.message)
|
hashtag = get_first_hashtag(update.message)
|
||||||
|
|
||||||
|
if hashtag == 'IGNORE':
|
||||||
|
update.message.reply_text('Ignoring...')
|
||||||
|
return
|
||||||
|
|
||||||
reply = 'Downloading'
|
reply = 'Downloading'
|
||||||
if hashtag:
|
if hashtag:
|
||||||
mkdir_p(f'{OUT_DIR}/{hashtag}')
|
mkdir_p(f'{OUT_DIR}/{hashtag}')
|
||||||
|
@ -141,12 +145,17 @@ def handle_rest(bot, update):
|
||||||
url = bot.getFile(file).file_path
|
url = bot.getFile(file).file_path
|
||||||
logger.info("Downloading %s" % url)
|
logger.info("Downloading %s" % url)
|
||||||
hashtag = get_first_hashtag(update.message)
|
hashtag = get_first_hashtag(update.message)
|
||||||
|
if hashtag == 'IGNORE':
|
||||||
|
update.message.reply_text('Ignoring...')
|
||||||
|
return
|
||||||
|
|
||||||
reply = 'Downloading'
|
reply = 'Downloading'
|
||||||
if hashtag:
|
if hashtag:
|
||||||
mkdir_p(f'{OUT_DIR}/{hashtag}')
|
mkdir_p(f'{OUT_DIR}/{hashtag}')
|
||||||
reply += f' to "{hashtag}"'
|
reply += f' to "{hashtag}"'
|
||||||
reply += '...'
|
reply += '...'
|
||||||
update.message.reply_text(reply)
|
update.message.reply_text(reply)
|
||||||
|
|
||||||
if hashtag:
|
if hashtag:
|
||||||
mkdir_p(f'{OUT_DIR}/{hashtag}')
|
mkdir_p(f'{OUT_DIR}/{hashtag}')
|
||||||
download_raw(url, filename, hashtag or '.', update.message.date)
|
download_raw(url, filename, hashtag or '.', update.message.date)
|
||||||
|
|
Loading…
Reference in a new issue