135 lines
No EOL
5.8 KiB
YAML
135 lines
No EOL
5.8 KiB
YAML
# This example shows how to download and format an entire Youtube channel
|
|
# to display in Kodi as a TV show. The directory format will look like
|
|
#
|
|
# /path/to/youtube_tv_shows/My Favorite Youtube Channel
|
|
# /Season 2021
|
|
# s2021.e0317 - St Pattys Day Video.jpg
|
|
# s2021.e0317 - St Pattys Day Video.mp4
|
|
# s2021.e0317 - St Pattys Day Video.nfo
|
|
# /Season 2022
|
|
# s2022.e1225 - Merry Christmas.jpg
|
|
# s2022.e1225 - Merry Christmas.mp4
|
|
# s2022.e1225 - Merry Christmas.nfo
|
|
# poster.jpg
|
|
# fanart.jpg
|
|
# tvshow.nfo
|
|
#
|
|
# The idea is to use dates as the numeric to represent season and episode
|
|
# numbers. Once downloaded, it can immediately be recognized by Kodi.
|
|
configuration:
|
|
working_directory: '.ytdl-sub-downloads'
|
|
|
|
presets:
|
|
|
|
###############################################################################
|
|
# LEVEL 1 - FULL ARCHIVE
|
|
#
|
|
# We will call this preset `yt_channel_as_tv`, and it will download every single video in
|
|
# a YouTube channel.
|
|
yt_channel_as_tv:
|
|
# YouTube channels are our source/download strategy
|
|
# Use the channel avatar and banner images for Kodi
|
|
youtube:
|
|
download_strategy: "channel"
|
|
channel_avatar_path: "poster.jpg"
|
|
channel_banner_path: "fanart.jpg"
|
|
|
|
# For advanced YTDL users only.
|
|
# It is wise to leave ignoreerrors=True to avoid errors for things
|
|
# like age-restricted videos in case you have not set your cookie.
|
|
ytdl_options:
|
|
ignoreerrors: True
|
|
|
|
# For each video downloaded, set the file and thumbnail name here.
|
|
# We set both with {episode_name}, which is a variable we define in
|
|
# the overrides section further below to represent our date-like episode
|
|
# naming convention. Using override variables helps reduce copy-paste.
|
|
#
|
|
# Another field worth mentioning is maintain_download_archive=True. This
|
|
# is generally a good thing to enable with channels because it will
|
|
# store previously downloaded video ids to tell YTDL not to re-download
|
|
# them on a successive invocation.
|
|
output_options:
|
|
output_directory: "{youtube_tv_shows_directory}/{tv_show_name_sanitized}"
|
|
file_name: "{episode_name}.{ext}"
|
|
thumbnail_name: "{episode_name}.jpg"
|
|
maintain_download_archive: True
|
|
|
|
# For each video downloaded, add an episode NFO file for it. We give it
|
|
# the same date-like episode name using our {episode_name} variable, and
|
|
# populate the NFO with available video metadata that Kodi will recognize.
|
|
nfo_tags:
|
|
nfo_name: "{episode_name}.nfo"
|
|
nfo_root: "episodedetails"
|
|
tags:
|
|
title: "{title}"
|
|
season: "{upload_year}"
|
|
episode: "{upload_month}{upload_day_padded}"
|
|
plot: "{description}"
|
|
year: "{upload_year}"
|
|
aired: "{upload_date_standardized}"
|
|
|
|
# In the output directory, create a tvshow.nfo file. Kodi looks for this
|
|
# in the root of the TV show directory to get the TV show (title) name.
|
|
output_directory_nfo_tags:
|
|
nfo_name: "tvshow.nfo"
|
|
nfo_root: "tvshow"
|
|
tags:
|
|
title: "{tv_show_name}"
|
|
|
|
# Overrides is a section where we can define our own variables, and use them in
|
|
# any other section. We define our tv show directory and episode file name here,
|
|
# which gets reused above for the video, thumbnail, and NFO file.
|
|
overrides:
|
|
youtube_tv_shows_directory: "/path/to/youtube_tv_shows"
|
|
episode_name: "Season {upload_year}/s{upload_year}.e{upload_month_padded}{upload_day_padded} - {title_sanitized}"
|
|
|
|
###############################################################################
|
|
# LEVEL 2 - RECENT ARCHIVE
|
|
#
|
|
# It is not always ideal to go full data-hoarder on a channel's videos.
|
|
# This example shows how you can only download the last 14 days-worth
|
|
# of videos on each download invocation.
|
|
yt_channel_as_tv__recent:
|
|
# `preset` can be set to any other preset in the config, and will inherit all its defined fields.
|
|
# This helps reduce copy-paste in the config.yaml
|
|
preset: "yt_channel_as_tv"
|
|
|
|
# We will add the `after` field onto `yt_channel_as_tv`'s YouTube channel download strategy.
|
|
# This is saying 'only download videos uploaded in the last 2 weeks'
|
|
youtube:
|
|
after: "today-2weeks"
|
|
|
|
# This is getting into YTDL voodoo. By default, YTDL will try to
|
|
# download all channel videos beginning with the most recent one.
|
|
# By setting break_on_reject, we will break this full-download on
|
|
# the first video that gets rejected. Since we have youtube.after
|
|
# defined, all videos after today-14days will be rejected. Therefore,
|
|
# the first video that is out of range that it tries to download, it
|
|
# will stop there, and save a significant amount of time.
|
|
#
|
|
# Similar to break_on_reject, but instead, breaks if a video has
|
|
# already been downloaded. If you were to perform a download on this
|
|
# subscription one-after-the-other, the second invocation would stop
|
|
# after looking at the first (most recent) video since it would exist
|
|
# in the download archive.
|
|
ytdl_options:
|
|
break_on_reject: True
|
|
break_on_existing: True
|
|
|
|
###############################################################################
|
|
# LEVEL 3 - ROLLING ARCHIVE
|
|
|
|
# If you put the recent archive example in a cron job, then in a year or so
|
|
# you will basically be datahoarding that channel unless you manually delete
|
|
# old videos. This example shows how to only keep the last 14-days worth of videos,
|
|
# and delete the rest.
|
|
yt_channel_as_tv__only_recent:
|
|
# Reuse `yt_channel_as_tv__recent` to only download the last 2 weeks' of videos
|
|
preset: "yt_channel_as_tv__recent"
|
|
|
|
# This is saying "only keep files if they were uploaded in the last 2 weeks".
|
|
# All other files that this subscription had previously downloaded will be
|
|
# deleted.
|
|
output_options:
|
|
keep_files_after: "today-2weeks" |