devome / dockerfiles

一些Dockerfile
https://evine.win
GNU General Public License v3.0
194 stars 23 forks source link

qb针对某一特定分类的种子限速 #100

Open ZJY0516 opened 10 months ago

ZJY0516 commented 10 months ago

请问能否限制某一特定分类种子的上传速度

devome commented 10 months ago

下载完成后开始限速,在容器内新建/data/diy/diy.sh,把limit_tag改成你想设置的分类,把131072改成限速值(单位是KiB/s),就行:

category=$($cmd_curl "${api_url_base}/torrents/info?hashes=${torrent_hash}" | jq .[0] | jq -r .category)
if [[ $category == limit_tag ]]; then
    $cmd_curl_post -d "hashes=${torrent_hash}&limit=131072" ${api_url_base}/torrents/setUploadLimit
fi