Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

classifier - plugins for sourcing flag lists #353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rraymondgh
Copy link
Contributor

@rraymondgh rraymondgh commented Nov 23, 2024

Enable sourcing of TMDB IDs for use in classifier. This then enables more dynamic content based rules to be constructed.

Example sourcing:

plugins:
  - source: 
      url: http://radarr.home/api/v3/movie
      apikey: secret
    extension: radarr
  - source:
      url: http://sonarr.home/api/v3/series?apikey=secret
    extension: sonarr
  - source:
      url: http://192.168.1.202:8989/api/v3/calendar
      apikey: secret
      start: start
      end: end
      days: 10
    extension: tvsonarrairing
  - source:
      url: https://api.themoviedb.org/3/discover/tv?with_original_language=en&vote_average.gte=7
      apikey: secret
      start: air_date.gte
      end: air_date.lte
      days: 2
    extension: tmdbtvairing

Was proposed as an idea in issue #352 Have extended to make more flexible for APIs from sonarr, radarr and TMDB

@rraymondgh rraymondgh changed the title classifier - plugins for sourcing extension lists #352 classifier - plugins for sourcing extension lists Nov 23, 2024
@rraymondgh
Copy link
Contributor Author

rraymondgh commented Nov 25, 2024

updated sample classifier.yml to use flags and jellyfin example

plugins:
  - source: 
      url: http://radarr.home/api/v3/movie
      apikey: abc123
    flag: radarr
  - source:
      url: http://sonarr.home/api/v3/series?apikey=def456
    flag: sonarr
  - source:
      url: http://192.168.1.202:8989/api/v3/calendar
      apikey: def456
      start: start
      end: end
      days: 10
    flag: sonarr_10day
  - source:
      url: https://api.themoviedb.org/3/discover/tv?with_original_language=en&vote_average.gte=7
      apikey: hjk789
      start: air_date.gte
      end: air_date.lte
      days: 2
    flag: tmdb_tvairing
  - source:
      url: http://jellyfin.home/Items/Latest?Limit=20&UserId=qwe123
      apikey: poi987
    flag: jellyfin_latest

flag_definitions:
  radarr: string_list
  sonarr: string_list
  sonarr_10day: string_list
  jellyfin_latest: string_list
  tmdb_tvairing: string_list

sample use

  tagandkeep:
    # tag active content.  slim down other torrents with few seeders
    - find_match:
      - if_else:
          condition:
            and:
              - "result.contentType == contentType.tv_show"
              - "result.contentSource == 'tmdb' "
              - "result.contentId in flags.sonarr "
          if_action:
            add_tag: sonarr
          else_action: unmatched

      - if_else:
          condition:
            and:
              - "result.contentType == contentType.movie"
              - "result.contentSource == 'tmdb' "
              - "result.contentId in flags.radarr "
          if_action:
            add_tag: radarr
          else_action: unmatched
      - if_else:
          condition: "torrent.seeders <= 5"
          if_action: delete
          else_action: unmatched

@rraymondgh rraymondgh changed the title classifier - plugins for sourcing extension lists classifier - plugins for sourcing flag lists Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant