Total Pageviews

Sunday, 8 November 2020

Flexget配置

 FlexGet官网:https://flexget.com/

官方安装向导:https://flexget.com/InstallWizard/Linux


配置Flexget

flexget会在用户目录下的.flexget文件夹(~/.flexget)种查找配置文件(config.yml),装好后默认是没有的,需要自己建一个:

mkdir .flexget

cd .flexget

nano config.yml

要注意的是,由于配置文件是YAML格式,需要遵循YAML语法,也就是说,千万不要使用tab来缩进,一定要用空格。缩进是一定要遵守的,每个层级之间用两个空格缩进。

写配置文件的时候可以通过flexget --test execute来测试配置文件

基本的配置文件格式如下:

tasks:

  test 任务名:

    rss: http://mysite.com/myfeed.rss

    accept_all: yes

    download: /root/bt/torrents

    transmission:

    path: /root/bt/downloads


templates:

  default:

    transmission:

      host: localhost

      port: 9091

      username: admin

      password: "123456"

    clean_transmission:

      enabled: no

test 任务名是任务的名称可以自己随便起

rss是输入插件,flexget支持许多种输入方式,但是最常用的还是配合PT使用的RSS

accept_all是过滤器插件,表示接受rss源中的所有项

download是输出插件,表示将rss项中的种子文件存到指定的文件夹。

templates 是模板可以设置不同transmission客户端


配置好后检测、验证FlexGet配置

flexget check

检测FlexGet配置文件是否有错误,如果有错会指出错误在哪一行


flexget --test execute

执行FlexGet的RSS测试,不会下载任何文件到硬盘。


flexget execute

执行RSS,开始自动下载RSS订阅内容。


flexget status

检查FlexGet执行状态。


如果检测或者执行时有rejected,failed,别忘记执行文章末尾的清除命令.

如果提示Transmissionrpc module version 0.11 or higher required.

执行 sudo pip install transmissionrpc


让Transmission自动添加种子任务

上一步我们用Flexget把种子已经下载到了/root/bt/中,现在我们需要让Transmission监视这个目录并自动添加任务

利用watch.sh脚本,可以实现。


定时任务

which flexget

确认FlexGet位置。例如路径是/usr/bin/flexget


crontab -e

添加计划任务(修改成上面Flexget查出来的路径)

* */1 * * * /usr/bin/flexget -c /root/.flexget/config.yml execute

每小时自动执行FlexGet,监控RSS订阅,一旦RSS有更新就会自动下载到指定的目录中。

*/1 * * * * /usr/bin/flexget -c /root/.flexget/config.yml execute

每分钟自动执行 FlexGet,监控RSS订阅,一旦RSS有更新就会自动下载到指定的目录中。


附:

flexget rejected list 列出所有被拒绝的条目

flexget rejected clear 清除所有被拒绝的条目

flexget failed list 列出所有失败的条目

flexget failed clear 清除所有失败的条目


更多用法说明查看官网:https://flexget.com/CLI

----------

transmission 配合 flexget: 下番神器

尝试了一下 flexget,还是比较简单好用的,记录一下。

前提条件:安装 transmission-daemon,pyenv 安装一个 miniconda(python3.5 版本以上)

安装步骤如下

1. 安装 flexget

1
pip install flexget

2. 准备好配置文件config.yml,自己的配置文件如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
templates:
  global:
    download: /root/.flexget/torrent
  freespace:
    free_space:
      path: /data1
      space: 2048
  tr:
    transmission:
      path: /data1/bt/dm/
      host: localhost
      port: 9090
      username: username
      password: password
 
web_server:
  bind: 0.0.0.0
  port: 5050
schedules:
  tasks: [anime*]
    interval:
      minutes: 30
       
tasks:
  anime-入间:
    accept_all: yes
    template:
      - tr
      - freespace

默认端口在 5050,30 分钟检查 rss 是否更新,当本地磁盘小于 2g 就不下载了。
默认种子下载的位置在 / root/.flexget/torrent

3. 设置 web ui 密码

1
flexget web passwd <some_password>

4. 运行

1
flexget daemon start --daemonize

折腾中遇到的问题
使用 dmhy 的 rss 会遇到Can't download magnet url的报错,网上查不到任何解决方法,flexget 文档也没有说明这些东西,后来仔细看了下 rss,发现种子链接不是正常 http,是 megnet 的链接,所以 flexget 下载不了,换成bangumi.moe的 rss 链接就可以了。

参考文档:
https://lacia.life/blog/2019/09/11/shiyongflexgetdingyuersszidongtuisongzhiqbittorrent/
https://einverne.github.io/post/2020/02/flexget.html
https://blog.monsterx.cn/tech/auto-download-bangumi-with-aria2-rss/
https://flexget.com/InstallWizard/Linux

-------

FlexGet is a multipurpose automation tool for content like torrents, nzbs, podcasts, comics, series, movies, etc. It can use different kinds of sources like RSS-feeds, html pages, csv files, search engines and there are even plugins for sites that do not provide any kind of useful feeds.

Example

Flexget uses a YAML based configuration file. The following example will look in the RSS feed in the link, will match any item that match the series names and download it:

tasks:
  tv_task:
    rss: http://example.com/torrents.xml
    series:
    - some series
    - another series
    download: /tvshows

There are numerous plugins that allow utilizing FlexGet in interesting ways and more are being added continuously.

FlexGet is extremely useful in conjunction with applications which have watch directory support or provide interface for external utilities like FlexGet. To get a sense of the many things that can be done with FlexGet you can take a look in our cookbook.

ChangeLog: https://flexget.com/ChangeLog

Help: https://discuss.flexget.com/

Chat: https://flexget.com/Chat

Bugs: https://github.com/Flexget/Flexget/issues

Install

FlexGet is installable via pip with the command:

pip install flexget

For more detailed instructions see the installation guide.

Feature requests

http://feathub.com/Flexget/Flexget?format=svg

How to use GIT checkout

Check that you have Python 3.6 or newer available with command python -V.

In some environments newer python might be available under another name like 'python3.6' or 'python3' in which case you need to use that one instead of plain 'python'.

To start using FlexGet from this directory:

python3 -m venv .

This will initialize python virtualenv. This doesn't need to be directly in your checkout directory, but these instructions assume that's where it is.

On some linux distributions (eg. debian, ubuntu) venv module is not included with python and this fails. Please install python3-virtualenv package and retry (or use the separate virtualenv python package).

Upgrading pip to latest version is highly advisable and can de done with:

bin/pip install --upgrade pip

Next we need to install dependencies and FlexGet itself, this can be done simply:

bin/pip install -e .

This does an editable (-e) development install of the current directory (.).

After that FlexGet is usable via <checkout directory>/bin/flexget. Verify installation by running:

bin/flexget -V

You may place the config file in your checkout directory, or in ~/.flexget (Unix, Mac OS X) or C:\Documents and Setting\<username>\flexget (Windows).

If you don't want to use virtualenv there's flexget_vanilla.py file which can be used to run FlexGet without virtualenv, note that you will need to install all required dependencies yourself.related post: https://briteming.blogspot.com/2015/02/transmission-daemon.html

from https://github.com/Flexget/Flexget

No comments:

Post a Comment