GithubHelp home page GithubHelp logo

juszoe / flexget-limiter Goto Github PK

View Code? Open in Web Editor NEW
27.0 1.0 10.0 19 KB

A flexget plugin for limit I/O and network usage

License: GNU General Public License v3.0

Python 100.00%
flexget flexget-plugins torrent disk-usage network-usage

flexget-limiter's Introduction

flexget-limiter

A flexget plugin for stop task when high I/O or network usage

English | 中文

Requirement

Install

  1. Install psutil
pip install psutil
  1. Download plugin limiter.py
  2. Create a new plugins folder under the Flexget configuration folder, for example:
~/.flexget/plugins/                   # Linux
C:\Users\<YOURUSER>\flexget\plugins\  # Windows
  1. Copy the limiter.py to the plugins folder
  2. If Web-UI or daemon is enabled, please restart Flexget to reload the configuration

Usage

  1. Editing the Flexget configuration. Add limiter option and configure as needed
limiter:
  down: 1000       # download speed KB/s
  up: 100          # upload speed KB/s
  disk:
    read: 10000    # disk read speed KB/s
    write: 10000   # disk write speed KB/s

advanced

limiter:
  wait: 1          # detection time, second, default: 1s
  reject: no       # reject all items, yes or no, default: no

When the system parameter exceeds the configured value, the current Flexget task will stop
Note: The configuration can be incomplete, just set the parameters you want to limit

  1. Start Flexget
flexget execute

Configuration example

Stop task when upload speed exceeds 10MB/s

tasks:
  my-limit-upload-task:
    rss: https://www.example.com/rss
    limiter:
      down: 10240  # 10 x 1024 = 10240
    download: ~/flexget/torrents/

Stop task when disk write speed exceeds 80MB/s

tasks:
  my-limit-write-task:
    rss: https://www.example.com/rss
    limiter:
      disk:
        write: 81920  # 80 x 1024 = 81920
    download: ~/flexget/torrents/

Q&A

How can I use because my python version is 2.X ?

This plugin only supports Python 3.X or Python 2.7. Other versions are not available. Please uninstall Flexget and install with Python3.

pip uninstall flexget  # uninstall
pip3 install flexget   # install with pip3

flexget-limiter's People

Contributors

juszoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

flexget-limiter's Issues

希望能添加检测硬盘活动时间来控制是否加种

通过控制网速有时会少很多种,没有最大化硬盘。控制硬盘浪费网速,而且有时在活动时间为100时也就是卡盘的时候,磁盘速度没有触发限制,网速也因为卡盘慢,触发不了网速限制,这个时候还加种就更加卡死了,所以希望加入硬盘空闲时间的检测,防止卡盘

群晖系统安装psutil出现了错误

Collecting psutil
Using cached https://files.pythonhosted.org/packages/73/93/4f8213fbe66fc20cb904f35e6e04e20b47b85bee39845cc66a0bcf5ccdcb/psutil-5.6.7.tar.gz
Building wheels for collected packages: psutil
Building wheel for psutil (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /volume1/@appstore/py3k/usr/local/bin/flexget/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-upa3b70p/psutil/setup.py'"'"'; file='"'"'/tmp/pip-install-upa3b70p/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-3p859nt0 --python-tag cp35
cwd: /tmp/pip-install-upa3b70p/psutil/
Complete output (41 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psaix.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/init.py -> build/lib.linux-x86_64-3.5/psutil
creating build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/main.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/init.py -> build/lib.linux-x86_64-3.5/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/psutil
/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_X86_64 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=567 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/volume1/@appstore/py3k/usr/local/include/python3.5m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.5/psutil/_psutil_common.o
unable to execute '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc': No such file or directory
error: command '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc' failed with exit status 1

ERROR: Failed building wheel for psutil
Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: psutil
Running setup.py install for psutil ... error
ERROR: Command errored out with exit status 1:
command: /volume1/@appstore/py3k/usr/local/bin/flexget/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-upa3b70p/psutil/setup.py'"'"'; file='"'"'/tmp/pip-install-upa3b70p/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-609u258q/install-record.txt --single-version-externally-managed --compile --install-headers /volume1/@appstore/py3k/usr/local/bin/flexget/include/site/python3.5/psutil
cwd: /tmp/pip-install-upa3b70p/psutil/
Complete output (41 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psaix.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/init.py -> build/lib.linux-x86_64-3.5/psutil
creating build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/main.py -> build/lib.linux-x86_64-3.5/psutil/tests
copying psutil/tests/init.py -> build/lib.linux-x86_64-3.5/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/psutil
/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_X86_64 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=567 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/volume1/@appstore/py3k/usr/local/include/python3.5m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.5/psutil/_psutil_common.o
unable to execute '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc': No such file or directory
error: command '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /volume1/@appstore/py3k/usr/local/bin/flexget/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-upa3b70p/psutil/setup.py'"'"'; file='"'"'/tmp/pip-install-upa3b70p/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-609u258q/install-record.txt --single-version-externally-managed --compile --install-headers /volume1/@appstore/py3k/usr/local/bin/flexget/include/site/python3.5/psutil Check the logs for full command output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.