Quantcast
Channel: configuration - Forum - FlexGet
Viewing all articles
Browse latest Browse all 716

Timeframe, Target, Quality, & Trakt_emit Questions

$
0
0

@jbaddock wrote:

Hi, I was wondering if someone could explain a little further, or provide an example how emit (trakt_emit)is to work or be used. My understanding based on all my reading is it updates local db with the next episode to be watched/captured/downloaded. The script I have does work, I am trying to understand and implement trakt_emit properly. Should I create a separate task for emit, or embed it in the "My-TV-Series" task?

The other question I have, is I prefer to download the first 720p version of a show that is available, then when a 1080p webdl comes around download that. So I made a Upgrade task where I download the better quality (My-TV-Series-Upgrade). However, when a 1080p webdl version comes along:
My-TV-Series-Upgrade Ignored TV-Series.S03E12.1080p.WEB-DL.DD5.1.H.264. Does not meet quality requirement 720p webdl h264.
This is happening less than 12 hours after the air date/time. What would be the correct setup of this task to accomplish this, download 1080p, and then after 5 days take the 720p version? Would this be happening because I did not have emit setup previously?

The direction of this script, if you were wondering:
Started with Jeff Wilson's config.
Continued forward with Tarzasai's as my example.
-Began pulling things out of the global template as he suggested in a previous question, and as I learn more. Still tweaking/learning.

###############################################################################################################
###############################################################################################################
#
# Flexget (http://www.flexget.com) configuration file.
#
# Lots of credit goes to: 
#    - Jeff Wilson <jeff@jeffalwilson.com>  Available from: https://github.com/jawilson/dotfiles
#    - Giorgio Gelardi https://github.com/tarzasai/.flexget
#
#
#
# Modified to suit my purposes
#
###############################################################################################################
###############################################################################################################


secrets: secretfile.yml


templates:


  global:
    regexp:
      # RegExr (http://www.gskinner.com/RegExr/) is a great tool for testing regexes
      reject:
        - (s|d)ub(s|bed)?\b: {from: title}                    # Block any subbed/dubbed/etc videos
        - \bspanish\b: {from: title}                          # Spanish releases kept cropping up
        - \b(duo|tri|quadri|tetra|penta)logy\b: {from: title} # Block series, only accept one at a time
        - \b3-?D\b: {from: title}                             # I don't have any 3D displays
        - \btrailer\b: {from: title}                          # I've gotten a few trailers that matched as movies. VERY annoying
        # - \bR5\b: {from: title}                               # The following are poor quality types that somehow got through the quality
        - \bWEBSCR\b: {from: title}                           # features usually due to the title including a keyword like "720p" as well
        - hevc
    torrent_alive:
      # Require at least 20 seeds of any torrent
      min_seeds: 20
      reject_for: 4 hours
    content_filter:
        # Filter by filenames. Allow multiple video types.
      require:
        - '*.avi'
        - '*.mkv'
        - '*.mpg'
        - '*.mp4'
      reject:
        - 'password.txt'
        - '*.wmv'
        - '*.r0*'
        - '*.part0*'
    verify_ssl_certificates: no
      # The Pirate Bay ssl certs always fail
    log_filter:
      ## Prevent some messages to be logged - see https://github.com/tarzasai/.flexget/tree/master/plugins
      content_size:
        # - too big, rejecting
        - too small, rejecting



  prog-deluge:
    deluge:
      # ensure that the connection is created in deluge or will not work
      username: '{{ secrets.deluge.username }}'
      password: '{{ secrets.deluge.password }}'
      main_file_only: yes
        # Ignore all but the file that is >90% of the torrent if it exists
      keep_subs: yes      
      port: 8112
      magnetization_timeout: 30  
        #Have magnets disabled below
      ratio: 3
      removeatratio: yes
    free_space:         # Make there's 10GB free before adding more downloads
      path: '{{ secrets.folders.local }}'
      space: 10000
    pathscrub: windows
      # Make sure all filenames are Windows safe (for samba)

      
  ### All the metainfo plugins need by task handling series
  tvinfo:
    # plugin_priority:
      # # manipulate must fix the titles before metainfo_series.
      # manipulate: 255
    metainfo_series: yes
    thetvdb_lookup: yes
    thexem:
      source: scene
      destination: tvdb
    trakt_lookup:
      account: '{{ secrets.trakt.account }}'
      username: '{{ secrets.trakt.username }}'
    

  feeds-tv:
    # This template is a "global" template for all TV-related tasks.
    # We keep all of the RSS feeds that list tv-related torrents here
    # as well as where to check existing shows.
    # This is a TON of feeds, you probably don't need so many, but why not? 
    inputs:
      - rss: { url: 'https://kat.cr/usearch/category%3Atv%20verified%3A1OR%20ettv%20OR%20vtv%20OR%20r0b0T%20OR%20vtv%20OR%20kikAssess%20OR%20rartv%20OR%20TvTeam/?field=time_add&sorder=desc&rss=1', silent: yes }
      - rss: { url: 'http://showrss.info/feeds/all.rss', silent: yes }           # ShowRSS Feed - All
      - rss: { url: 'http://www.torlock.com/television/rss.xml' }                # TorLock (TV)
      - rss: { url: 'http://torrentz.eu/feed_verified?q=tv' }                    # Torrentz (Verified only, TV)
    if:
      - "has_field('category')":
          regexp:
            reject_excluding:
              - '^Episodes( HD)?$': {from: category}
    archive: [tv]      
      # The archive plugin will keep a history whether they have been accepted or not. Can then later be searched, and entries injected into a task again.
    content_size:
      # Impose reasonable size constraints      
      max: 5000
      min: 50
    exists_series:
      # Prevent from downloading shows that were aquired manually or are currently downloading
      path:
        - '{{ secrets.folders.srvtv }}'           #TV Series
        - '{{ secrets.folders.srvtvprem }}'       #TV Premiere
        - '{{ secrets.folders.srvtvdaily }}'      #TV Daily
        - '{{ secrets.folders.srvtvdocu }}'       #TV Documentaries
        - '{{ secrets.folders.localdl }}'         #Local Downloading
        - '{{ secrets.folders.localcomplete }}'   #Local Completed
        - '{{ secrets.folders.localstaging }}'    #Local Completed/Staging
      allow_different_qualities: better  # turned off and will turn on in the upgrade section.
    thexem:
      source: scene
      destination: tvdb
    # Look up info on TheTVDB.com to fill in extra info
    thetvdb_lookup: yes
    trakt_lookup:
      account: '{{ secrets.trakt.account }}'
      username: '{{ secrets.trakt.username }}'
    require_field: [series_name, series_id]

       
     
  tv-shows-find:
    discover:
      #no_entries_ok: yes
      what: [filler: yes]
      from:
        - flexget_archive: [tv]
        - kat:
            category: tv
            verified: yes

            
  logs-global:
    log_filter:
      task:
        - series plugin because episode has already been downloaded
      
  ### Where to move the files to for staging - Prior to final move.  Need to do this as there is issues with Deluge downloading more files than wanted.   
  stage-series:
    set:
      #queuetotop: yes
      movedone: >
        /home/torrent/torrents/Staging/tv_series/{{ tvdb_series_name|default(series_name)|replace('/', '_')|replace(' - ', '-')|replace(':', ' -')|replace(' ', '.')|replace("'", '')  }}/
      # Rename the "content file" to something nice, use leading slash to force file to top level
      content_filename: >
        /{{ tvdb_series_name|default(series_name)|replace('/', '_')|replace(' - ', '-')|replace(':', ' -')|replace(',', '')|replace(' ', '.')|replace("'", '')  }}.{{ series_id }}.{{ (quality)|replace(' ', '.') }}
      label: Series

  stage-series-upgrade:
    set:
      movedone: >
        /home/torrent/torrents/Staging/tv_series_upgrade/{{ tvdb_series_name|default(series_name)|replace('/', '_')|replace(' - ', '-')|replace(':', ' -')|replace(' ', '.')|replace("'", '')  }}/
      # Rename the "content file" to something nice, use leading slash to force file to top level
      content_filename: >
        /{{ tvdb_series_name|default(series_name)|replace('/', '_')|replace(' - ', '-')|replace(':', ' -')|replace(',', '')|replace(' ', '.')|replace("'", '')  }}.{{ series_id }}.{{ (quality)|replace(' ', '.') }}
      label: Series-Upgrade
 
      
tasks:

  Local-Torrents-TV:
    # Use a local folder (synced with Dropbox) as a source
    # I can drop torrents in this folder and they are synced with Dropbox, always
    # accepted, then the original file is deleted
    priority: 1
    include:
      - series-favorite.yml
      # - series-following.yml
      - series-daily.yml
      # - series-ak.yml
    template:
      - feeds-tv
      - stage-series
      - prog-deluge
      - tvinfo
    disable:
      - seen
      - seen_info_hash
      - retry_failed
      - configure_series
      - trakt_list
      - inputs
      - exists_series
      - regexp
      - content_size
      - content_filter
      - torrent_alive
      #- tracking
    all_series:
      parse_only: yes
    sequence:
      - configure_series:
          settings:
            assume_special: true
            upgrade: yes
          from:
            trakt_list:
              account: '{{ secrets.trakt.account }}'
              username: '{{ secrets.trakt.username }}'
              list: My TV
              type: shows
              strip_dates: yes
      - configure_series:
          settings:
            assume_special: true
            upgrade: yes
          from:
            trakt_list:
              account: '{{ secrets.trakt.account }}'
              username: '{{ secrets.trakt.username }}'
              list: Her TV
              type: shows
              strip_dates: yes
    plugin_priority:
      exec: 0
    filesystem:
      path: '{{ secrets.folders.localtorrenttv }}'
      recursive: yes
      retrieve: files
      regexp: '.*\.torrent$'
    no_entries_ok: yes
    verify_ssl_certificates: no
    exec:
      on_output:
        for_accepted: rm "{{location}}"
    accept_all: yes
    set:
      label: local-tv


  Sync-TV-Shows:
    manual: yes 
    template: no_global # None of the global templates make sense here
    filesystem:
      path:
        - '{{ secrets.folders.srvtv }}'
        - '{{ secrets.folders.srvtvprem }}'
        - '{{ secrets.folders.srvtvdaily }}'
        - '{{ secrets.folders.srvtvdocu }}'
      recursive: yes
      retrieve: files
      regexp: '.*\.(avi|mkv|mp4|mpg|m4v)$'
    regexp:
      reject:
        - \bsample\b: {from: title}
    disable: builtins
    thetvdb_lookup: yes
    thexem:
      source: tvdb
      destination: scene
    include:
      - series-favorite.yml
    sequence:
      - configure_series:
          settings:
            tracking: no
          from:
            trakt_list:
              account: '{{ secrets.trakt.account }}'
              username: '{{ secrets.trakt.username }}'
              list: My TV
              type: shows
              strip_dates: yes
      - configure_series:
          settings:
            tracking: no
          from:
            trakt_list:
              account: '{{ secrets.trakt.account }}'
              username: '{{ secrets.trakt.username }}'
              list: Her TV
              type: shows
              strip_dates: yes
    exec: echo "Found {{ series_name }} - {{ series_id }} ({{ location }})" >> /dev/null


  ### Downloads first available quality of regular TV Series in watchlists  720p+
  My-TV-Series:
    priority: 10
    include:
      - series-favorite.yml
    template:
      - feeds-tv
      - stage-series
      - prog-deluge
      - logs-global
    sequence:
      - configure_series:
          settings:
            upgrade: no
            target: 720p+
            timeframe: 4 hours
            quality: <=bluray
          from:
            trakt_list:
              account: '{{ secrets.trakt.account }}'
              username: '{{ secrets.trakt.username }}'
              list: My TV
              type: shows
              strip_dates: yes
      - configure_series:
          settings:
            upgrade: no
            target: 720p+
            timeframe: 4 hours
            quality: <=bluray
          from:
            trakt_list:
              account: '{{ secrets.trakt.account }}'
              username: '{{ secrets.trakt.username }}'
              list: Her TV
              type: shows
              strip_dates: yes
      

  ### Downloads upgraded qualities and stages them in another folder to be processed.      
  My-TV-Series-Upgrade:
    priority: 100
    include:
      - series-favorite.yml
    template:
      - feeds-tv  # use also flexget_archive: [tv]
      - stage-series-upgrade
      - prog-deluge
      - logs-global
    disable: seen
    flexget_archive: [tv]   # pull from flexget archives instead of hitting the RSS Feed again.  Currently using both.
    sequence:
      - configure_series:
          settings:
            upgrade: yes
            target: 1080p webdl h264
            timeframe: 5 days
            quality: 720p webdl h264
            # tracking: backfill
            # propers: yes
          from:
            trakt_list:
              account: '{{ secrets.trakt.account }}'
              username: '{{ secrets.trakt.username }}'
              list: My TV
              type: shows
              strip_dates: yes
      - configure_series:
          settings:
            timeframe: 5 days
            upgrade: yes
            target: 1080p webdl h264
            quality: 720p webdl h264
            # tracking: backfill
            # propers: yes
          from:
            trakt_list:
              account: '{{ secrets.trakt.account }}'
              username: '{{ secrets.trakt.username }}'
              list: Her TV
              type: shows
              strip_dates: yes
    
        
          
  My-TV-Shows-Find-Next-Favorite:
    # # Less priority task, and looks for random tv shows
    # template:
      # - feeds-tv
      # - tv-shows-find
      # #- prog-deluge
      # #- stage-series
    # disable: inputs
    trakt_emit:
      account: '{{ secrets.trakt.account }}'
      username: '{{ secrets.trakt.username }}'
      context: collected
      position: next
      list: My TV
      # strip_dates: yes 
    # - trakt_emit:
      # account: '{{ secrets.trakt.account }}'
      # username: '{{ secrets.trakt.username }}'
      # context: collected
      # position: next
      # list: Her TV
      # strip_dates: yes 
    accept_all: yes
    set_series_begin: yes

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 716

Trending Articles