apiVersion: v1
data:
  config.yaml: |
    configuration:
      working_directory: ".ytdl-sub-working-directory"
    presets:
      TV Shows:
        preset:
        - "Jellyfin TV Show by Date"
        - "Max 1080p"
        embed_thumbnail: True
        throttle_protection:
          sleep_per_download_s:
            min: 2.2
            max: 10.8
          sleep_per_subscription_s:
            min: 9.0
            max: 14.1
          max_downloads_per_subscription:
            min: 10
            max: 36
        ytdl_options:
          source_address: '0.0.0.0'
          cookiefile: /config/cookies.txt
        date_range:
          after: "now-1year"
        chapters:
          # Embedded Chapter Fields
          embed_chapters: True
          allow_chapters_from_comments: False
          remove_chapters_regex:
            - "Intro"
            - "Outro"
          # Sponsorblock Fields
          sponsorblock_categories:
            - "outro"
            - "selfpromo"
            - "preview"
            - "interaction"
            - "sponsor"
            - "music_offtopic"
            - "intro"
          remove_sponsorblock_categories: "sponsor"
      TV Shows Fortnight:
        preset:
        - "TV Shows"
        date_range:
          after: "now-14days"

  subscriptions.yaml: |
    __preset__:
      overrides:
        tv_show_directory: "/youtube/tv_shows"
        music_directory: "/youtube/tv_shows"

    "TV Shows":
      = Documentaries:
        "Technogy Connections": "https://www.youtube.com/@TechnologyConnections"
        "Adam Savage's Tested": "https://www.youtube.com/@tested"

    "TV Shows Fortnight":
      = Music:
        "Rick Beato": "https://www.youtube.com/@RickBeato"
  run_cron: |
    #!/bin/bash
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    echo 'Cron started, running ytdl-sub...'
    cd /config/
    ytdl-sub --config=config.yaml sub subscriptions.yaml
  abc: |
    0     */6     *       *       *       /config/ytdl-sub-configs/run_cron
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: ytdl-sub-config