qbit_manage icon indicating copy to clipboard operation
qbit_manage copied to clipboard

[Bug]:

Open eliotalanfoss opened this issue 3 years ago • 1 comments

Describe the Bug

When trying to do a dry run, the program seems to error with an argument of type 'NoneType' is not iterable.

I think the config file is set up correctly.

I have many torrents in qbittorrent with the "Moving" status, which may be an issue?

Config

commands:
  # The commands defined below will IGNORE any commands used in command line and docker env variables.
  dry_run: True
  cross_seed: False
  recheck: False
  cat_update: False
  tag_update: False
  rem_unregistered: False
  tag_tracker_error: True
  rem_orphaned: False
  tag_nohardlinks: True
  skip_recycle: False

qbt:
  # qBittorrent parameters
  host: "localhost:8080"
  user: ""
  pass: ""

settings:
  force_auto_tmm: False  # Will force qBittorrent to enable Automatic Torrent Management for each torrent.
  tracker_error_tag: issue  # Will set the tag of any torrents that do not have a working tracker.
  ignoreTags_OnUpdate: # When running tag-update function, it will update torrent tags for a given torrent even if the torrent has one or more of the tags defined here.
    - noHL
    - issue
    - cross-seed
directory:
  # Do not remove these
  # Cross-seed var: </your/path/here/>  # Output directory of cross-seed
  # root_dir var: </your/path/here/>  # Root downloads directory used to check for orphaned files, noHL, and RecycleBin.
  # <OPTIONAL> remote_dir var: </your/path/here/>  # Path of docker host mapping of root_dir.
  # Must be set if you're running qbit_manage locally and qBittorrent/cross_seed is in a docker
  # <OPTIONAL> recycle_bin var: </your/path/here/>   # Path of the RecycleBin folder. Default location is set to remote_dir/.RecycleBin
  # <OPTIONAL> torrents_dir var: </your/path/here/>  # Path of the your qbittorrent torrents directory. Required for `save_torrents` attribute in recyclebin

  # cross_seed: "/your/path/here/"
  root_dir: "/mnt/nfs/torrents/"
  # remote_dir: "/mnt/user/data/torrents/"
  recycle_bin: "/mnt/nfs/torrents/.RecycleBin/"
  torrents_dir: "/mnt/nfs/torrents/Torrent Files/"

cat:
  # Category & Path Parameters
  # <Category Name> : <save_path>  # Path of your save directory.
  Anime-alone: "/mnt/nfs/torrents/Anime"
  anime-sonarr: "/mnt/nfs/torrents/Anime"
  anime-sonarr-completed: "/mnt/nfs/torrents/Anime"


cat_change:
  # This moves all the torrents from one category to another category. This executes on --cat-update
  # WARNING: if the paths are different and Default Torrent Management Mode is set to automatic the files could be moved !!!
  # <Old Category Name> : <New Category>


tracker:
  # Tag Parameters
  # <Tracker URL Keyword>:    # <MANDATORY> This is the keyword in the tracker url
  # <MANDATORY> Set tag name. Can be a list of tags or a single tag
  #   tag: <Tag Name>
  # <OPTIONAL> Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading. -2 means the global limit should be used, -1 means no limit.
  #   max_ratio: 5.0
  # <OPTIONAL> Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding. -2 means the global limit should be used, -1 means no limit.
  #   max_seeding_time: 129600
  # <OPTIONAL> Will limit the upload speed KiB/s (KiloBytes/second) (-1 sets the limit to infinity)
  #   limit_upload_speed: 150
  # <OPTIONAL> Set this to the notifiarr react name. This is used to add indexer reactions to the notifications sent by Notifiarr
  #   notifiarr: <notifiarr indexer>
  nyaa:
    tag: Nyaa
    max_ratio: -2
    max_seeding_time: -2
    limit_upload_speed: -1

nohardlinks:
  # Tag Movies/Series that are not hard linked
  # Mandatory to fill out directory parameter above to use this function (root_dir/remote_dir)
  # This variable should be set to your category name of your completed movies/completed series in qbit. Acceptable variable can be any category you would like to tag if there are no hardlinks found
  anime-sonarr-completed:
    # <OPTIONAL> exclude_tags var: Will exclude the following tags when searching through the category.
    exclude_tags:
      - AnimeBytes
    # <OPTIONAL> cleanup var: WARNING!! Setting this as true Will remove and delete contents of any torrents that are in paused state and has the NoHL tag
    cleanup: true
    # <OPTIONAL> max_ratio var: Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading
    max_ratio: 1.0
    # <OPTIONAL> max seeding time var: Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding
    max_seeding_time: 86400
    # <OPTIONAL> Limit Upload Speed var: Will limit the upload speed KiB/s (KiloBytes/second) (`-1` : No Limit)
    limit_upload_speed:
    # <OPTIONAL> min seeding time var: Will ensure that torrent is not deleted by cleanup variable if torrent does not meet minimum seeding time (min).
    min_seeding_time: 0

recyclebin:
  # Recycle Bin method of deletion will move files into the recycle bin (Located in /root_dir/.RecycleBin) instead of directly deleting them in qbit
  # By default the Recycle Bin will be emptied on every run of the qbit_manage script if empty_after_x_days is defined.
  enabled: true
  # <OPTIONAL> empty_after_x_days var:
  # Will automatically remove all files and folders in recycle bin after x days. (Checks every script run)
  # If this variable is not defined it, the RecycleBin will never be emptied.
  # WARNING: Setting this variable to 0 will delete all files immediately upon script run!
  empty_after_x_days: 60
  # <OPTIONAL> save_torrents var:
  # If this option is set to true you MUST fill out the torrents_dir in the directory attribute.
  # This will save a copy of your .torrent and .fastresume file in the recycle bin before deleting it from qbittorrent
  save_torrents: true
  # <OPTIONAL> split_by_category var:
  # This will split the recycle bin folder by the save path defined in the `cat` attribute
  # and add the base folder name of the recycle bin that was defined in the `recycle_bin` sub-attribute under directory.
  split_by_category: false

orphaned:
  # Orphaned files are those in the root_dir download directory that are not referenced by any active torrents.
  # File patterns that will not be considered orphaned files. Handy for generated files that aren't part of the torrent but belong with the torrent's files
  exclude_patterns:
    - "**/.DS_Store"
    - "**/Thumbs.db"
    - "**/@eaDir"
    - "/data/torrents/temp/**"
    - "**/*.!qB"

apprise:
  # Apprise integration with webhooks
  # Leave Empty/Blank to disable

notifiarr:
  # Notifiarr integration with webhooks
  # Leave Empty/Blank to disable

webhooks:
  # Webhook notifications:
  # Possible values:
  # Set value to notifiarr if using notifiarr integration
  # Set value to apprise if using apprise integration
  # Set value to a valid webhook URL
  # Leave Empty/Blank to disable

bhd:
  # BHD Integration used for checking unregistered torrents
  apikey:

Logs

https://gist.github.com/eliotalanfoss/7a4360b41e4292197b9edf6c9bb030c4

Screenshots

No response

Installation

Local

Version Number

3.2.6

What branch are you on?

master

eliotalanfoss avatar Sep 30 '22 08:09 eliotalanfoss

The torrents finished moving and the error still persists.

eliotalanfoss avatar Sep 30 '22 09:09 eliotalanfoss

I solved this particular issue.

I misunderstood the phasing in the comments of the config file. "Leave Empty/Blank to disable" does not mean you should delete all the entries in that section like I did. Instead the definition should be left blank to disable the features given by that section (notably apprise, notifiarr, and webhooks).

My new config file now looks more like this:

commands:
  # The commands defined below will IGNORE any commands used in command line and docker env variables.
  dry_run: true
  cross_seed: false
  recheck: false
  cat_update: false
  tag_update: false
  rem_unregistered: false
  tag_tracker_error: true
  rem_orphaned: false
  tag_nohardlinks: true
  skip_recycle: false

qbt:
  # qBittorrent parameters
  host: localhost:8080
  user: 
  pass: 

settings:
  force_auto_tmm: false  # Will force qBittorrent to enable Automatic Torrent Management for each torrent.
  tracker_error_tag: issue  # Will set the tag of any torrents that do not have a working tracker.
  ignoreTags_OnUpdate: # When running tag-update function, it will update torrent tags for a given torrent even if the torrent has one or more of the tags defined here.
  - noHL
  - issue
  - cross-seed
directory:
  # Do not remove these
  # Cross-seed var: </your/path/here/>  # Output directory of cross-seed
  # root_dir var: </your/path/here/>  # Root downloads directory used to check for orphaned files, noHL, and RecycleBin.
  # <OPTIONAL> remote_dir var: </your/path/here/>  # Path of docker host mapping of root_dir.
  # Must be set if you're running qbit_manage locally and qBittorrent/cross_seed is in a docker
  # <OPTIONAL> recycle_bin var: </your/path/here/>   # Path of the RecycleBin folder. Default location is set to remote_dir/.RecycleBin
  # <OPTIONAL> torrents_dir var: </your/path/here/>  # Path of the your qbittorrent torrents directory. Required for `save_torrents` attribute in recyclebin

  # cross_seed: "/your/path/here/"
  root_dir: /mnt/nfs/torrents/
  # remote_dir: "/mnt/user/data/torrents/"
  recycle_bin: /mnt/nfs/torrents/.RecycleBin/
  torrents_dir: /mnt/nfs/torrents/Torrent Files/

  remote_dir: /mnt/nfs/torrents/
  cross_seed:
cat:
  # Category & Path Parameters
  # <Category Name> : <save_path>  # Path of your save directory.
  Anime-alone: /mnt/nfs/torrents/Anime
  anime-sonarr: /mnt/nfs/torrents/Anime
  anime-sonarr-completed: /mnt/nfs/torrents/Anime


cat_change:
  # This moves all the torrents from one category to another category. This executes on --cat-update
  # WARNING: if the paths are different and Default Torrent Management Mode is set to automatic the files could be moved !!!
  # <Old Category Name> : <New Category>


tracker:
  # Tag Parameters
  # <Tracker URL Keyword>:    # <MANDATORY> This is the keyword in the tracker url
  # <MANDATORY> Set tag name. Can be a list of tags or a single tag
  #   tag: <Tag Name>
  # <OPTIONAL> Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading. -2 means the global limit should be used, -1 means no limit.
  #   max_ratio: 5.0
  # <OPTIONAL> Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding. -2 means the global limit should be used, -1 means no limit.
  #   max_seeding_time: 129600
  # <OPTIONAL> Will limit the upload speed KiB/s (KiloBytes/second) (-1 sets the limit to infinity)
  #   limit_upload_speed: 150
  # <OPTIONAL> Set this to the notifiarr react name. This is used to add indexer reactions to the notifications sent by Notifiarr
  #   notifiarr: <notifiarr indexer>
  nyaa:
    tag: Nyaa
    max_ratio: -2
    max_seeding_time: -2
    limit_upload_speed: -1

nohardlinks:
  # Tag Movies/Series that are not hard linked
  # Mandatory to fill out directory parameter above to use this function (root_dir/remote_dir)
  # This variable should be set to your category name of your completed movies/completed series in qbit. Acceptable variable can be any category you would like to tag if there are no hardlinks found
  anime-sonarr-completed:
    # <OPTIONAL> exclude_tags var: Will exclude the following tags when searching through the category.
    exclude_tags:
    # - AnimeBytes
    # <OPTIONAL> cleanup var: WARNING!! Setting this as true Will remove and delete contents of any torrents that are in paused state and has the NoHL tag
    cleanup: true
    # <OPTIONAL> max_ratio var: Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading
    max_ratio: 1.0
    # <OPTIONAL> max seeding time var: Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding
    max_seeding_time: 86400
    # <OPTIONAL> Limit Upload Speed var: Will limit the upload speed KiB/s (KiloBytes/second) (`-1` : No Limit)
    limit_upload_speed:
    # <OPTIONAL> min seeding time var: Will ensure that torrent is not deleted by cleanup variable if torrent does not meet minimum seeding time (min).
    min_seeding_time: 0

recyclebin:
  # Recycle Bin method of deletion will move files into the recycle bin (Located in /root_dir/.RecycleBin) instead of directly deleting them in qbit
  # By default the Recycle Bin will be emptied on every run of the qbit_manage script if empty_after_x_days is defined.
  enabled: true
  # <OPTIONAL> empty_after_x_days var: 
  # Will automatically remove all files and folders in recycle bin after x days. (Checks every script run)
  # If this variable is not defined it, the RecycleBin will never be emptied.
  # WARNING: Setting this variable to 0 will delete all files immediately upon script run!
  empty_after_x_days: 60
  # <OPTIONAL> save_torrents var:
  # If this option is set to true you MUST fill out the torrents_dir in the directory attribute.
  # This will save a copy of your .torrent and .fastresume file in the recycle bin before deleting it from qbittorrent
  save_torrents: true
  # <OPTIONAL> split_by_category var:
  # This will split the recycle bin folder by the save path defined in the `cat` attribute 
  # and add the base folder name of the recycle bin that was defined in the `recycle_bin` sub-attribute under directory.
  split_by_category: false

orphaned:
  # Orphaned files are those in the root_dir download directory that are not referenced by any active torrents.
  # File patterns that will not be considered orphaned files. Handy for generated files that aren't part of the torrent but belong with the torrent's files
  exclude_patterns:
  - '**/.DS_Store'
  - '**/Thumbs.db'
  - '**/@eaDir'
  - /data/torrents/temp/**
  - '**/*.!qB'

apprise:
  # Apprise integration with webhooks
  # Leave Empty/Blank to disable
  api_url:
  # Mandatory to fill out the notification url/urls based on the notification services provided by apprise. https://github.com/caronc/apprise/wiki
  notify_url:

notifiarr:
  # Notifiarr integration with webhooks
  # Leave Empty/Blank to disable
  apikey:
  # <OPTIONAL> Set to a unique value (could be your username on notifiarr for example)
  instance:

webhooks:
  # Webhook notifications:
  # Possible values:
  # Set value to notifiarr if using notifiarr integration
  # Set value to apprise if using apprise integration
  # Set value to a valid webhook URL
  # Leave Empty/Blank to disable
  error:
  run_start:
  run_end:
  function:
    cross_seed:
    recheck: notifiarr
    cat_update: apprise
    tag_update: notifiarr
    rem_unregistered: notifiarr
    tag_tracker_error: notifiarr
    rem_orphaned: notifiarr
    tag_nohardlinks: notifiarr
    empty_recyclebin: notifiarr

bhd:
  # BHD Integration used for checking unregistered torrents
  apikey:

eliotalanfoss avatar Sep 30 '22 11:09 eliotalanfoss

if you're not using this you can remove this whole section form your config

orphaned:
  # Orphaned files are those in the root_dir download directory that are not referenced by any active torrents.
  # File patterns that will not be considered orphaned files. Handy for generated files that aren't part of the torrent but belong with the torrent's files
  exclude_patterns:
  - '**/.DS_Store'
  - '**/Thumbs.db'
  - '**/@eaDir'
  - /data/torrents/temp/**
  - '**/*.!qB'

apprise:
  # Apprise integration with webhooks
  # Leave Empty/Blank to disable
  api_url:
  # Mandatory to fill out the notification url/urls based on the notification services provided by apprise. https://github.com/caronc/apprise/wiki
  notify_url:

notifiarr:
  # Notifiarr integration with webhooks
  # Leave Empty/Blank to disable
  apikey:
  # <OPTIONAL> Set to a unique value (could be your username on notifiarr for example)
  instance:

webhooks:
  # Webhook notifications:
  # Possible values:
  # Set value to notifiarr if using notifiarr integration
  # Set value to apprise if using apprise integration
  # Set value to a valid webhook URL
  # Leave Empty/Blank to disable
  error:
  run_start:
  run_end:
  function:
    cross_seed:
    recheck: notifiarr
    cat_update: apprise
    tag_update: notifiarr
    rem_unregistered: notifiarr
    tag_tracker_error: notifiarr
    rem_orphaned: notifiarr
    tag_nohardlinks: notifiarr
    empty_recyclebin: notifiarr

bhd:
  # BHD Integration used for checking unregistered torrents
  apikey:

bobokun avatar Sep 30 '22 12:09 bobokun

Thanks! That is the functionality I wanted!

eliotalanfoss avatar Sep 30 '22 23:09 eliotalanfoss