feat: Whitelist URL feature.

In the configuration, `max_duration` can be set to prevent
long song(URL item) being downloaded and added to the
playlist.
This whitelist feature provided a way to override this
duration check: songs being whitelisted will be added to
the playlist no matter how long they are.
Three admin commands are introduced:
 - !urlwhitelist (!urlw)
 - !urlunwhitelist, (!urlunw)
 - !urlwhitelistlist, (!urlwls).

 Also, if one song fails due to its length, the bot will
 show the length of this song and the max length limit in
 the reply message.

 Implement #173, #196.
This commit is contained in:
Terry Geng
2021-02-17 12:55:11 +08:00
parent f59062ec1f
commit 1f9573b1d5
11 changed files with 176 additions and 111 deletions

View File

@ -61,13 +61,13 @@
"shortlist_instruction": "使用<i>!sl {indexes}</i>播放列表中的曲目。",
"start_updating": "开始更新……",
"stopped": "音乐停止。",
"too_long": "<b>{song}</b>超出长度限制!已被移出播放列表。",
"too_long": "<b>{song}</b>超出长度限制{duration} > {max_duration}!已被移出播放列表。",
"unable_download": "无法下载<b>{item}</b>。已移出播放列表。",
"unable_play": "无法播放<b>{item}</b>。已移出播放列表。",
"unknown_mode": "未知播放模式\"{mode}\"。播放模式应为 <i>one-shot</i>, <i>repeat</i>, <i>random</i>中的一个。",
"update_successful": "<h2>botamusique v{version} 安装完毕!</h2><hr />\n<h3>更新日志</h3> {changelog} <hr /> 请访问我们的 <a href=\"https://github.com/azlux/botamusique\">github页面</a> 获取更多信息!",
"url": "URL",
"url_ban": "链接被列入黑名单了!",
"url_ban": "链接{url}被列入黑名单了!",
"url_from_playlist": "URL",
"url_from_playlist_item": "<a href=\"{url}\"><b>{title}</b></a>,来自播放列表 <a href=\"{playlist_url}\">{playlist}</a>,由<i> {user} </i>添加。",
"url_item": "<a href=\"{url}\"><b>{title}</b></a><i>由</i> {user} <i>添加</i>。",