devome / dockerfiles

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

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

Closed ZJY0516 closed 1 month ago

ZJY0516 commented 1 year ago

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

devome commented 1 year 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