updated tests and docs
This commit is contained in:
parent
3df583f656
commit
a1c3d480c7
5 changed files with 21 additions and 20 deletions
|
|
@ -309,12 +309,12 @@ For example:
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
:caption: subscription.yaml
|
:caption: subscription.yaml
|
||||||
|
|
||||||
tv_show:
|
TV Show Full Archive:
|
||||||
only_recent:
|
= News:
|
||||||
[News]:
|
|
||||||
"Breaking News": "https://www.youtube.com/@SomeBreakingNews"
|
"Breaking News": "https://www.youtube.com/@SomeBreakingNews"
|
||||||
|
|
||||||
[Tech]:
|
TV Show Only Recent:
|
||||||
|
= Tech | TV-Y:
|
||||||
"Two Minute Papers": "https://www.youtube.com/@TwoMinutePapers"
|
"Two Minute Papers": "https://www.youtube.com/@TwoMinutePapers"
|
||||||
|
|
||||||
Will create two subscriptions named "Breaking News" and "Two Minute Papers", equivalent to:
|
Will create two subscriptions named "Breaking News" and "Two Minute Papers", equivalent to:
|
||||||
|
|
@ -323,8 +323,7 @@ Will create two subscriptions named "Breaking News" and "Two Minute Papers", equ
|
||||||
|
|
||||||
"Breaking News":
|
"Breaking News":
|
||||||
preset:
|
preset:
|
||||||
- "tv_show"
|
- "TV Show Full Archive"
|
||||||
- "only_recent"
|
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
subscription_indent_1: "News"
|
subscription_indent_1: "News"
|
||||||
|
|
@ -333,25 +332,30 @@ Will create two subscriptions named "Breaking News" and "Two Minute Papers", equ
|
||||||
|
|
||||||
"Two Minute Papers":
|
"Two Minute Papers":
|
||||||
preset:
|
preset:
|
||||||
- "tv_show"
|
- "TV Show Only Recent"
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
subscription_indent_1: "Tech"
|
subscription_indent_1: "Tech"
|
||||||
|
subscription_indent_2: "TV-Y"
|
||||||
subscription_name: "Two Minute Papers"
|
subscription_name: "Two Minute Papers"
|
||||||
subscription_value: "https://www.youtube.com/@TwoMinutePapers"
|
subscription_value: "https://www.youtube.com/@TwoMinutePapers"
|
||||||
|
|
||||||
You can provide as many parent presets in the form of keys, and subscription indents as ``[keys]``.
|
You can provide as many parent presets in the form of keys, and subscription indents as ``=keys``.
|
||||||
This can drastically simplify subscription definitions by setting things like so in your
|
This can drastically simplify subscription definitions by setting things like so in your
|
||||||
parent preset:
|
parent preset:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
presets:
|
presets:
|
||||||
tv_show_name:
|
"TV Show Preset":
|
||||||
overrides:
|
overrides:
|
||||||
|
subscription_indent_1: "default-genre"
|
||||||
|
subscription_indent_2: "default-content-rating"
|
||||||
|
|
||||||
tv_show_name: "{subscription_name}"
|
tv_show_name: "{subscription_name}"
|
||||||
url: "{subscription_value}"
|
url: "{subscription_value}"
|
||||||
genre: "{subscription_indent_1}"
|
genre: "{subscription_indent_1}"
|
||||||
|
content_rating: "{subscription_indent_2}"
|
||||||
|
|
||||||
.. _subscription value:
|
.. _subscription value:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ presets:
|
||||||
# it applied to every TV show. Or, use them on the individual subscriptions.
|
# it applied to every TV show. Or, use them on the individual subscriptions.
|
||||||
# - "add_subtitles"
|
# - "add_subtitles"
|
||||||
# - "sponsorblock"
|
# - "sponsorblock"
|
||||||
# - "include_info_json"
|
|
||||||
|
|
||||||
# To download age-restricted videos, you will need to uncomment and set your cookie
|
# To download age-restricted videos, you will need to uncomment and set your cookie
|
||||||
# file here as a ytdl parameter. For more info, see
|
# file here as a ytdl parameter. For more info, see
|
||||||
|
|
@ -92,7 +91,8 @@ presets:
|
||||||
# subtitles_name: "{episode_file_path}.{lang}.{subtitles_ext}"
|
# subtitles_name: "{episode_file_path}.{lang}.{subtitles_ext}"
|
||||||
# subtitles_type: "srt"
|
# subtitles_type: "srt"
|
||||||
|
|
||||||
languages: "en" # supports list of multiple languages
|
languages:
|
||||||
|
- "en"
|
||||||
allow_auto_generated_subtitles: True # allow auto subtitles
|
allow_auto_generated_subtitles: True # allow auto subtitles
|
||||||
|
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,18 @@
|
||||||
# Global overrides for all subscriptions. Can either be set here or in your config.yaml
|
# Global overrides for all subscriptions. Can either be set here or in your config.yaml
|
||||||
__preset__:
|
__preset__:
|
||||||
overrides:
|
overrides:
|
||||||
tv_show_directory: "/tv_shows"
|
tv_show_directory: "/tv_shows" # Root folder of ytdl-sub TV Shows
|
||||||
episode_title: "{upload_date_standardized} - {title}"
|
download_range: "2months" # Range to keep for only recent
|
||||||
episode_plot: "{webpage_url}"
|
|
||||||
download_range: "2months"
|
|
||||||
|
|
||||||
|
|
||||||
# All subscriptions under this will use the `TV Show Full Archive` preset
|
# All subscriptions under this will use the `TV Show Full Archive` preset
|
||||||
TV Show Full Archive:
|
TV Show Full Archive:
|
||||||
# Sets "Music" as the TV show genre
|
# Sets "Music" for genre
|
||||||
= Music:
|
= Music:
|
||||||
"Rick A": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
|
"Rick A": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
|
||||||
"Opeth": "https://www.youtube.com/channel/UCmQSJTFZaXN85gYk6W3XbdQ"
|
"Opeth": "https://www.youtube.com/channel/UCmQSJTFZaXN85gYk6W3XbdQ"
|
||||||
|
|
||||||
# Sets "Kids" as the TV show genre, and "TV-Y" as the content rating
|
# Sets "Kids" for genre, "TV-Y" for content rating
|
||||||
= Kids | TV-Y:
|
= Kids | TV-Y:
|
||||||
"Jake Trains": "https://www.youtube.com/@JakeTrains"
|
"Jake Trains": "https://www.youtube.com/@JakeTrains"
|
||||||
"Kids Toys Play": "https://www.youtube.com/@KidsToysPlayChannel"
|
"Kids Toys Play": "https://www.youtube.com/@KidsToysPlayChannel"
|
||||||
|
|
@ -27,7 +25,6 @@ TV Show Only Recent:
|
||||||
|
|
||||||
|
|
||||||
# ADVANCED USAGE:
|
# ADVANCED USAGE:
|
||||||
# If a key is not a preset, it is treated as a subscription.
|
|
||||||
# Subscriptions can use the same format as a preset found within a config.
|
# Subscriptions can use the same format as a preset found within a config.
|
||||||
"Equivalent to BBC":
|
"Equivalent to BBC":
|
||||||
preset:
|
preset:
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def recent_preset_dict(output_directory):
|
def recent_preset_dict(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "tv_show",
|
"preset": "TV Show Full Archive",
|
||||||
"date_range": {"after": "20150101"},
|
"date_range": {"after": "20150101"},
|
||||||
"format": "worst[ext=mp4]", # download the worst format so it is fast
|
"format": "worst[ext=mp4]", # download the worst format so it is fast
|
||||||
"ytdl_options": {
|
"ytdl_options": {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def channel_preset_dict(output_directory):
|
def channel_preset_dict(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "tv_show",
|
"preset": "TV Show Full Archive",
|
||||||
"format": "worst[ext=mp4]", # download the worst format so it is fast
|
"format": "worst[ext=mp4]", # download the worst format so it is fast
|
||||||
"ytdl_options": {
|
"ytdl_options": {
|
||||||
"max_views": 100000, # do not download the popular PJ concert
|
"max_views": 100000, # do not download the popular PJ concert
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue