lhllhx / PT_signin

Pt站点的自动签到和数据统计
https://blog.3628688.xyz/index.php/2022/07/25/利用阿里云实现pt自动签到和数据统计/
244 stars 114 forks source link

Failed to load config file: Did not pass schema validation. #9

Closed EricGao-Byte closed 2 years ago

EricGao-Byte commented 2 years ago

求助大佬 使用账号密码时可以正常运行 telegram也能正常收到消息 加上使用cookie登录的其他站点后就无法通过配置文件有效性检查 日志显示[/tasks/sign_in/auto_sign_in/sites/hdchina] Got {'cookie': 'PHPSESSID=xxxxxxxxxxxxxxxxxx; hdchina=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}, expected: string 重新fork之后测试还是这种情况

我的config.yml如下

  #自动签到
  sign_in:
    auto_sign_in:
      user-agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'
      max_workers: 1
      get_messages: no #设为no跳过获取未读信息。默认no
      get_details: yes #设为no跳过获取统计。默认yes      
      aipocr:  #baidu ocr参数
        app_id: 'xxx'
        api_key: 'xxx'
        secret_key: 'xxx'
      sites:
      #以下为具体站点设置 
      #https://github.com/lhllhx/flexget_qbittorrent_mod/tree/master/ptsites 下存在需要的站点 只需配置相应的 主域名: cookie 
        hdchina:
          cookie: 'PHPSESSID=xxxxxxxxxxxxx; hdchina=xxxxxxxxxxxxxxx'
        m-team:
          login:
            username: 'xxxxxx'
            password: 'xxxxxx'
            secret_key: 'xxxxxxxxxxxxxxxxxxxxxxxx'
    accept_all: yes
    seen:
      fields:
        - title
    notify:
      task:
        always_send: true
        message: |+
          {%- if task.accepted -%}
          {%- for group in task.accepted|groupby('task') -%}
          FlexGet has just signed in {{ group.list|length }} sites for task {{ group.grouper }}:
          {% for entry in group.list %}
          {{ loop.index }}: {{ entry.title }} {{ entry.result }}
          {%- if entry.messages|d('') %}
          Messages: {{ entry.messages }}
          {% endif %}
          {%- endfor -%}
          {%- endfor -%}
          {%- endif -%}
          {%- if task.failed %}
          {% for group in task.failed|groupby('task') %}
          The following sites have failed for task {{ group.grouper }}:
          {% for entry in group.list %}
          {{ loop.index }}: {{ entry.title }} Reason: {{ entry.reason|d('unknown') }}
          {%- if entry.messages|d('') %}
          Messages: {{ entry.messages }}
          {% endif %}
          {%- endfor -%}
          {%- endfor -%}
          {%- endif -%}
        via: #推送渠道选择 选择你需要的推送渠道 将不需要的删掉
          - telegram_mod: #tg
              bot_token: 'xxxxxx'
              image: 'details_report.png'
              recipients:
                - username: 'xxxxxx' #注意这里是用户名,不是昵称,不带@

flexget.log

2021-12-09 14:44:47 DEBUG    manager                       config_base: /home/runner/.flexget
2021-12-09 14:44:47 CRITICAL manager                       [/tasks/sign_in/auto_sign_in/sites/hdchina] Got `{'cookie': 'PHPSESSID=xxxxxxxxxxxxxxxxxx; hdchina=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}`, expected: string
2021-12-09 14:44:47 DEBUG    manager                       invalid config, rolling back
2021-12-09 14:44:47 CRITICAL manager                       Failed to load config file: Did not pass schema validation.
2021-12-09 14:44:47 DEBUG    manager                       Removed /home/runner/.flexget/.config-lock
lhllhx commented 2 years ago

非特殊站点 不需要”cookie:” 具体看清楚我的样例配置文件

EricGao-Byte commented 2 years ago

非特殊站点 不需要”cookie:” 具体看清楚我的样例配置文件

还是不行 添加了几个站点测试之后发现只有m-team能够通过检测 其他的站点无法通过 日志显示的还是expected string 搞不懂了😭

tasks:
  #自动签到
  sign_in:
    auto_sign_in:
      user-agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'
      max_workers: 1
      get_messages: no #设为no跳过获取未读信息。默认no
      get_details: yes #设为no跳过获取统计。默认yes      
      aipocr:  #baidu ocr参数
        app_id: 'xxxxxx'
        api_key: 'xxxxxxxxx'
        secret_key: 'xxxxxxxx'
      sites:
      #以下为具体站点设置 
      #https://github.com/lhllhx/flexget_qbittorrent_mod/tree/master/ptsites 下存在需要的站点 只需配置相应的 主域名: cookie 
        chdbits:
          login:
            username: 'xxxxxx'
            password: 'xxxxxx'
        m-team:
          login:
            username: 'xxxxxxx'
            password: 'xxxxxxxxx'
            secret_key: 'xxxxxxx'
        pterclub:
          login:
            username: 'xxxxxxx'
            password: 'xxxxxxxxx'
            secret_key: 'xxxxxxxxxx'
        lemonhd:
          login:
            username: 'xxxxxxxxx'
            password: 'xxxxxxxxxxxxx'
    accept_all: yes
    seen:
      fields:
        - title
    notify:
      task:
        always_send: true
        message: |+
          {%- if task.accepted -%}
          {%- for group in task.accepted|groupby('task') -%}
          FlexGet has just signed in {{ group.list|length }} sites for task {{ group.grouper }}:
          {% for entry in group.list %}
          {{ loop.index }}: {{ entry.title }} {{ entry.result }}
          {%- if entry.messages|d('') %}
          Messages: {{ entry.messages }}
          {% endif %}
          {%- endfor -%}
          {%- endfor -%}
          {%- endif -%}
          {%- if task.failed %}
          {% for group in task.failed|groupby('task') %}
          The following sites have failed for task {{ group.grouper }}:
          {% for entry in group.list %}
          {{ loop.index }}: {{ entry.title }} Reason: {{ entry.reason|d('unknown') }}
          {%- if entry.messages|d('') %}
          Messages: {{ entry.messages }}
          {% endif %}
          {%- endfor -%}
          {%- endfor -%}
          {%- endif -%}
        via: #推送渠道选择 选择你需要的推送渠道 将不需要的删掉
          - telegram_mod: #tg
              bot_token: 'xxxxxxxxx'
              image: 'details_report.png'
              recipients:
                - username: 'xxxxxxxxx' #注意这里是用户名,不是昵称,不带@

flexget.log

2021-12-10 12:22:17 INFO     flexget.plugins.ptsites._version                 flexget_qbittorrent_mod v0.8.9_dev
2021-12-10 12:22:17 DEBUG    plugin                        Plugin `memusage` requires plugin `ext lib `guppy`` to load.
2021-12-10 12:22:18 DEBUG    plugin                        Trying to load components from: ['/home/runner/.flexget/components', '/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/flexget/components']
2021-12-10 12:22:18 DEBUG    plugin                        Plugins took 3.94 seconds to load. 325 plugins in registry.
2021-12-10 12:22:18 DEBUG    manager                       Connecting to: sqlite:////home/runner/.flexget/db-config.sqlite
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin simple_persistence schema version to 4
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin feed schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin telegram_chat_ids schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin wecom_access_token schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin message schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin user_details schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin make_rss schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin log_once schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin api_rottentomatoes schema version to 2
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin input_cache schema version to 2
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin tail schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin discover schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin gazelle_session schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin pogcal_acquired schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin myepisodes schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin digest schema version to 2
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin version_checker schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin api_bluray schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin upgrade schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin delay schema version to 3
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin seen schema version to 4
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin tvmaze schema version to 7
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin trakt_auth schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin api_trakt schema version to 7
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin api_tmdb schema version to 6
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin morethantv schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin passthepopcorn schema version to 1
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin alpharatio schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin hebits schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin filelist schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin rutracker_auth schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin series schema version to 14
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin api_tvdb schema version to 7
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin backlog schema version to 3
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin variables schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin pending_approval schema version to 1
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin imdb_list schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin subtitle_list schema version to 1
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin regexp_list schema version to 1
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin movie_list schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin entry_list schema version to 2
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin pending_list schema version to 1
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin imdb_lookup schema version to 10
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin archive schema version to 0
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin failed schema version to 3
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin remember_rejected schema version to 3
2021-12-10 12:22:19 DEBUG    schema                        Initializing plugin status schema version to 2
2021-12-10 12:22:19 DEBUG    manager                       config_name: config
2021-12-10 12:22:19 DEBUG    manager                       config_base: /home/runner/.flexget
2021-12-10 12:22:19 CRITICAL manager                       [/tasks/sign_in/auto_sign_in/sites/chdbits] Got `{'login': {'username': 'xxxxxxxxxx', 'password': 'xxxxxxxx'}}`, expected: string
2021-12-10 12:22:19 CRITICAL manager                       [/tasks/sign_in/auto_sign_in/sites/lemonhd] Got `{'login': {'username': 'xxxxxxxxxxx', 'password': 'xxxxxxxxxx'}}`, expected: string
2021-12-10 12:22:19 CRITICAL manager                       [/tasks/sign_in/auto_sign_in/sites/pterclub] Got `{'login': {'username': 'xxxxxxx', 'password': 'xxxxxxxxxx', 'secret_key': 'xxxxxxxxxxxx'}}`, expected: string
2021-12-10 12:22:19 DEBUG    manager                       invalid config, rolling back
2021-12-10 12:22:19 CRITICAL manager                       Failed to load config file: Did not pass schema validation.
2021-12-10 12:22:19 DEBUG    manager                       Removed /home/runner/.flexget/.config-lock
lhllhx commented 2 years ago

不是所有网站都是使用账号密码登录的,只有示例里面那几个特殊网站是允许账号密码 其他的改成类似

lemonhd: '这里填cookie'

的形式

具体参考这里 https://github.com/madwind/flexget_qbittorrent_mod/blob/a57003089c9b1a2cec9b303311a543005a15e67f/config_example.yml#L36 的sites_setting

EricGao-Byte commented 2 years ago

不是所有网站都是使用账号密码登录的,只有示例里面那几个特殊网站是允许账号密码 其他的改成类似

lemonhd: '这里填cookie'

的形式

具体参考这里 https://github.com/madwind/flexget_qbittorrent_mod/blob/a57003089c9b1a2cec9b303311a543005a15e67f/config_example.yml#L36 的sites_setting

搞定了 感谢大佬👍 原来站点配置cookie现在不用cookie字段了 之前还没问题来着