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,17 +61,26 @@
"shortlist_instruction": "Use <i>!sl {indexes}</i> to play the item you want.",
"start_updating": "Start updating...",
"stopped": "Music stopped.",
"too_long": "<b>{song}</b> is too long, removed from playlist!",
"too_long": "<b>{song}</b> is too long ({duration} > {max_duration}), removed from playlist!",
"unable_download": "Unable to download <b>{item}</b>. Removed from the library.",
"unable_play": "Unable to play <b>{item}</b>. Removed from the library.",
"unknown_mode": "Unknown playback mode '{mode}'. It should be one of <i>one-shot</i>, <i>repeat</i>, <i>random</i>.",
"update_successful": "<h2>botamusique v{version} Installed!</h2><hr />\n<h3>Changelog</h3> {changelog} <hr /> Visit <a href=\"https://github.com/azlux/botamusique\">our github repo</a> for more details!",
"url": "URL",
"url_ban": "This URL is banned!",
"url_ban": "The URL {url} is banned! Removed from playlist!",
"url_ban_success": "The following URL is banned: {url}.",
"url_ban_list": "List of banned URL: <br>{list}",
"url_from_playlist": "URL",
"url_from_playlist_item": "<a href=\"{url}\"><b>{title}</b></a> <i>from playlist</i> <a href=\"{playlist_url}\">{playlist}</a> <i>added by</i> {user}",
"url_item": "<a href=\"{url}\"><b>{title}</b></a> <i>added by</i> {user}",
"url_unban_success": "The following URL is unbanned: {url}.",
"url_unwhitelist_success": "The following URL is un-whitelisted: {url}.",
"url_whitelist_success": "The following URL is whitelisted: {url}.",
"url_whitelist_list": "List of whitelisted URL: <br>{list}",
"user_ban": "You are banned, not allowed to do that!",
"user_ban_success": "User {user} is banned.",
"user_ban_list": "List of banned user: <br>{list}",
"user_unban_success": "User {user} is unbanned.",
"user_password_set": "Your password has been updated.",
"web_user_list": "Following users have the privilege to access the web interface: <br /> {users}",
"webpage_address": "Your own address to access the web interface is <a href=\"{address}\">{address}</a>",

View File

@ -61,13 +61,13 @@
"shortlist_instruction": "Use <i>!sl {índices}</i> para reproducir los elementos que usted desea.",
"start_updating": "Empezando la actualización...",
"stopped": "Música fue detenida.",
"too_long": "<b>{song}</b> es muy larga. Eliminada de la lista de reproducción!",
"too_long": "<b>{song}</b> es muy larga ({duration} > {max_duration}). Eliminada de la lista de reproducción!",
"unable_download": "No fue posible descargar <b>{item}</b>. Eliminado de la biblioteca.",
"unable_play": "No fue posible reproducir <b>{item}</b>. Eliminado de la biblioteca.",
"unknown_mode": "Modo de reproducción '{mode}' desconocido. Debiera ser o bien <i>one-shot</i>, <i>repeat</i> o <i>random</i>.",
"update_successful": "<h2>botamusique v{version} instalado!</h2><hr />\n<h3>Lista de cambios</h3> {changelog} <hr /> Visite <a href=\"https://github.com/azlux/botamusique\">nuestro repositorio en Github</a> para más detalles!",
"url": "URL",
"url_ban": "Esta URL está baneada!",
"url_ban": "URL {url} está baneada! Eliminada de la lista de reproducción!",
"url_from_playlist": "URL",
"url_from_playlist_item": "<a href=\"{url}\"><b>{title}</b></a> <i>de lista de reproducción</i> <a href=\"{playlist_url}\">{playlist}</a> <i>añadido por</i> {user}",
"url_item": "<a href=\"{url}\"><b>{title}</b></a> <i>añadido por</i> {user}",

View File

@ -61,13 +61,13 @@
"shortlist_instruction": "Utilisez <i>!sl {indexes}</i> pour jouer l'élément que vous voulez.",
"start_updating": "Début de la mise à jour...",
"stopped": "Musique arrêté.",
"too_long": "<b>{song}</b> est trop long, supprimé de la playlist !",
"too_long": "<b>{song}</b> est trop long ({duration} > {max_duration}), supprimé de la playlist !",
"unable_download": "Impossible de télécharger <b>{item}</b>. Retiré de la bibliothèque.",
"unable_play": "Impossible de jouer <b>{item}</b>. Retiré de la bibliothèque.",
"unknown_mode": "Mode de lecture \"{mode}\" inconnu. Il devrait s'agir d'un des modes suivants : <i>one-shot</i>, <i>repeat</i>, <i>random</i>.",
"update_successful": "<h2>botamusique v{version} Installé ! </h2><hr />\n<h3>Changelog</h3> {changelog} <hr /> Visitez <a href=\"https://github.com/azlux/botamusique\">notre repo github</a> pour plus de détails !",
"url": "URL",
"url_ban": "Cette URL est interdite !",
"url_ban": "URL {url} est interdite !",
"url_from_playlist": "URL",
"url_from_playlist_item": "<a href=\"{url}\"><b>{title}</b></a> <i>depuis la playlist</i> <a href=\"{playlist_url}\">{playlist}</a> <i>ajouté par</i> {user}",
"url_item": "<a href=\"{url}\"><b>{title}</b></a> <i>ajouté par</i> {user}",

View File

@ -61,13 +61,13 @@
"shortlist_instruction": "Usa <i>!sl {indexes}</i> per riprodurre l'elemento desiderato.",
"start_updating": "Inizio aggiornamento...",
"stopped": "Riproduzione interrotta.",
"too_long": "<b>{song}</b> è troppo lunga, rimossa dalla playlist!",
"too_long": "<b>{song}</b> è troppo lunga ({duration} > {max_duration}), rimossa dalla playlist!",
"unable_download": "Impossibile scaricare <b>{item}</b>. Rimosso dalla libreria.",
"unable_play": "Impossibile riprodurre <b>{item}</b>. Rimosso dalla libreria.",
"unknown_mode": "Modalità di riproduzione '{mode}' sconosciuta. Dovrebbe essere <i>one-shot</i>, <i>ripeti</i>, <i>casuale</i>.",
"update_successful": "<h2>botamusique v{version} installato!</h2><hr />\n<h3>Changelog</h3> {changelog} <hr /> Visita <a href=\"https://github.com/azlux/botamusique\">la nostra repository GitHub</a> per ulteriori dettagli!",
"url": "URL",
"url_ban": "Questo URL è vietato!",
"url_ban": "URL {url} è vietato!",
"url_from_playlist": "URL",
"url_from_playlist_item": "<a href=\"{url}\"><b>{title}</b></a> <i>dalla playlist</i> <a href=\"{playlist_url}\">{playlist}</a> <i>aggiunto da</i> {user}",
"url_item": "<a href=\"{url}\"><b>{title}</b></a> <i>aggiunto da</i> {user}",

View File

@ -53,21 +53,21 @@
"rb_play_empty": "ラジオIDを提供してください。",
"rb_query_result": "検索の結果(<i> !rbplay {ID} </i>を送信して再生する)",
"records_omitted": "…",
"removed_tags": "もう<b>{song}</b>からタグ「 <i>{tags}</i>」を削除しました。",
"removed_tags_from_all": "もう再生リストの全ての曲にタグ「<i>{tags}</i> 」を削除しました。",
"removing_item": "もう再生リストに「{item}」を削除しました。",
"removed_tags": "<b>{song}</b>からタグ「 <i>{tags}</i>」を削除しました。",
"removed_tags_from_all": "再生リストの全ての曲にタグ「<i>{tags}</i> 」を削除しました。",
"removing_item": "再生リストに「{item}」を削除しました。",
"repeat": "「{song}」を{n}回リピートするになります。",
"report_version": "現在のbotamusiqueバージョンは<b>{version}</b>です。",
"shortlist_instruction": "<i>!sl {indexes}</i>を使ってこのリストの曲を再生する。",
"start_updating": "更新しています…",
"stopped": "再生停止。",
"too_long": "「{song}」が長さ制限を超えました。削除されました。",
"too_long": "「{song}」が長さ制限を超えました{duration} > {max_duration}。削除されました。",
"unable_download": "「{item}」がダウンロードできません。削除されました。",
"unable_play": "「{item}」が再生できません。削除されました。",
"unknown_mode": "不正な再生モード「{mode}」。 <i>one-shot</i>, <i>repeat</i>, <i>random</i>, <i>autoplay</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が禁止されています。",
"url_ban": "URL {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> {user} </i>に追加されました。",

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>。",