Flexget / Flexget

The official FlexGet repository
http://www.flexget.com
MIT License
1.74k stars 473 forks source link

Unhandled error in plugin transmission: list indices must be integers or slices, not File #2798

Closed X-dark closed 3 years ago

X-dark commented 3 years ago

Expected behaviour:

Transmission plugin is unusable since #2791. Once worked around #2794 I still hit the following error. As noted in the forum, this seems to be related to skip_files settings. I am reverting ff560afdb2af44060bac143bb592f1c0eaf5fd1a for now to have a usable flexget.

Actual behaviour:

Config:

  transmissionrpc:
    transmission:
      host: 1.2.3.4
      port: 9091
      username: '{? transmission.login ?}'
      password: '{? transmission.password ?}'
      ratio: 0
      add_paused: no
      magnetization_timeout: 60
      path: /data/buffer/completed/flexget
      skip_files:
        - '*.nfo'
        - '*.sfv'
        - '*[sS]ample*'
        - '*.txt'
      main_file_only: yes

Log:

list indices must be integers or slices, not File error (click to expand) ``` 2021-01-02 07:13:12 CRITICAL task watch-rss BUG: Unhandled error in plugin transmission: list indices must be integers or slices, not File Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 912, in _bootstrap self._bootstrap_inner() │ └ File "/usr/local/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() │ └ File "/usr/local/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) │ │ │ │ │ └ {} │ │ │ │ └ │ │ │ └ () │ │ └ │ └ > └ File "/usr/local/lib/python3.9/site-packages/flexget/task_queue.py", line 46, in run self.current_task.execute() │ │ └ │ └ File "/usr/local/lib/python3.9/site-packages/flexget/task.py", line 87, in wrapper return func(self, *args, **kw) │ │ │ └ {} │ │ └ () │ └ File "/usr/local/lib/python3.9/site-packages/flexget/task.py", line 722, in execute self._execute() │ └ File "/usr/local/lib/python3.9/site-packages/flexget/task.py", line 688, in _execute self.__run_task_phase(phase) │ └ 'output' └ File "/usr/local/lib/python3.9/site-packages/flexget/task.py", line 514, in __run_task_phase response = self.__run_plugin(plugin, phase, args) │ │ │ └ (, {'host': '1.2.3.4', 'port': 9091, 'username': 'user', 'password':... │ │ └ 'output' │ └ > File "/usr/local/lib/python3.9/site-packages/flexget/task.py", line 547, in __run_plugin result = method(*args, **kwargs) │ │ └ {} │ └ (, {'host': '1.2.3.4', 'port': 9091, 'username': 'user', 'password':... └ File "/usr/local/lib/python3.9/site-packages/flexget/event.py", line 20, in __call__ return self.func(*args, **kwargs) │ │ │ └ {} │ │ └ (, {'host': '1.2.3.4', 'port': 9091, 'username': 'transmission', 'password':... │ └ File "/usr/local/lib/python3.9/site-packages/flexget/plugins/clients/transmission.py", line 486, in on_task_output if find_main_file and file_list[f]['size'] > total_size * main_ratio: │ │ │ │ └ 0.9 │ │ │ └ 2337927969 │ │ └ File(name='Show.S05E05.720p.WEB.DDP5.1.x264.mkv', size=2337927969, completed=0, priority='normal', s... │ └ [File(name='Show.S05E05.720p.WEB.DDP5.1.x264.mkv', size=2337927969, completed=0, priority='normal', ... └ True TypeError: list indices must be integers or slices, not File ```

Additional information:

mfonville commented 3 years ago

I have the exact same error

malomehi commented 3 years ago

I believe it is caused by this breaking change in transmission-rpc: https://github.com/Flexget/Flexget/issues/2794#issuecomment-752220098

gazpachoking commented 3 years ago

I took a stab at this based on the docs. Don't have transmission installed to test against, so please report back in if this is working. Extra points if it comes with a PR to fix anything I didn't. 😃

X-dark commented 3 years ago

Thank you, will try and report back.

edit: at least it is not crashing, I am now waiting for it to have something to send to transmission.

malomehi commented 3 years ago

I took a stab at this based on the docs. Don't have transmission installed to test against, so please report back in if this is working. Extra points if it comes with a PR to fix anything I didn't. smiley

@gazpachoking I have tested your fix and it works ok for me.

X-dark commented 3 years ago

Yes I can confirm all is good now, thanks!