update all docs

This commit is contained in:
jbannon 2022-06-05 22:54:09 +00:00
parent 2151084496
commit af236cf1bb
4 changed files with 19 additions and 15 deletions

View file

@ -38,7 +38,7 @@ download, like a YouTube channel to pull new videos. It looks something like:
john_smith_channel: john_smith_channel:
preset: "yt_channel_as_tv" preset: "yt_channel_as_tv"
youtube: youtube:
channel_id: "UCsvn_Po0SmunchJYtttWpOxMg" channel_url: "https://youtube.com/channe/UCsvn_Po0SmunchJYtttWpOxMg"
overrides: overrides:
tv_show_name: "John Smith Vlogs" tv_show_name: "John Smith Vlogs"
``` ```
@ -53,9 +53,9 @@ a one-hit wonder music video. Anything you can define in a subscription can be
defined using CLI arguments. This example is equivalent to the subscription defined using CLI arguments. This example is equivalent to the subscription
example above: example above:
```shell ```shell
ytdl-sub dl \ ytdl-sub dl \
--preset "yt_channel_as_tv" \ --preset "yt_channel_as_tv" \
--youtube.channel_id "UCsvn_Po0SmunchJYtttWpOxMg" \ --youtube.channel_url "https://youtube.com/channel/UCsvn_Po0SmunchJYtttWpOxMg" \
--overrides.tv_show_name "John Smith Vlogs" --overrides.tv_show_name "John Smith Vlogs"
``` ```

View file

@ -190,13 +190,13 @@ Below is an example that downloads YouTube videos:
my_subscription_name: my_subscription_name:
preset: "playlist_preset_ex" preset: "playlist_preset_ex"
youtube: youtube:
playlist_id: "UCsvn_Po0SmunchJYtttWpOxMg" playlist_url: "https://youtube.com/playlist?list=UCsvn_Po0SmunchJYtttWpOxMg"
overrides: overrides:
playlist_name: "diy-playlist" playlist_name: "diy-playlist"
Our preset ``playlist_preset_ex`` uses the `YouTube Playlist`_ download strategy, and defines two Our preset ``playlist_preset_ex`` uses the `YouTube Playlist`_ download strategy, and defines two
custom variables: ``{output_directory}`` and ``{playlist_name}``. The subscription sets custom variables: ``{output_directory}`` and ``{playlist_name}``. The subscription sets
the `parent preset`_ to ``playlist_preset_ex``, and must define the ``playlist_id`` field and the `parent preset`_ to ``playlist_preset_ex``, and must define the ``playlist_url`` field and
the ``{playlist_name}`` variable since the preset did not. the ``{playlist_name}`` variable since the preset did not.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------

View file

@ -51,19 +51,19 @@ class ConfigOptions(StrictDictValidator):
configuration: configuration:
dl_aliases: dl_aliases:
mv: "--preset yt_music_video" mv: "--preset yt_music_video"
v: "--youtube.video_id" v: "--youtube.video_url"
Simplifies Simplifies
.. code-block:: bash .. code-block:: bash
ytdl-sub dl --preset yt_music_video --youtube.video_id a1b2c3 ytdl-sub dl --preset yt_music_video --youtube.video_url youtube.com/watch?v=a1b2c3
to to
.. code-block:: bash .. code-block:: bash
ytdl-sub dl --mv --v a1b2c3 ytdl-sub dl --mv --v youtube.com/watch?v=a1b2c3
""" """
if self._dl_aliases: if self._dl_aliases:
return self._dl_aliases.dict return self._dl_aliases.dict

View file

@ -43,25 +43,29 @@ class TestDownloadArgsParser:
"aliases, cmd, expected_sub_dict", "aliases, cmd, expected_sub_dict",
[ [
( (
{"mv": "--preset yt_music_video", "v": "--youtube.video_id"}, {"mv": "--preset yt_music_video", "v": "--youtube.video_url"},
"dl --mv --v 123abc", "dl --mv --v 123abc",
{"preset": "yt_music_video", "youtube": {"video_id": "123abc"}}, {"preset": "yt_music_video", "youtube": {"video_url": "123abc"}},
), ),
( (
{ {
"ch": "--preset yt_channel", "ch": "--preset yt_channel",
"c": "--youtube.channel_id", "c": "--youtube.channel_url",
"name": "--overrides.tv_name", "name": "--overrides.tv_name",
"concert": "--overrides.genre 'Some Genre Name'", "concert": "--overrides.genre 'Some Genre Name'",
}, },
"dl --ch --c 123abc --name 'Sweet TV Show' --concert", "dl --ch --c https://youtube.com/channel/123abc --name 'Sweet TV Show' --concert",
{ {
"preset": "yt_channel", "preset": "yt_channel",
"youtube": {"channel_id": "123abc"}, "youtube": {"channel_url": "https://youtube.com/channel/123abc"},
"overrides": {"tv_name": "Sweet TV Show", "genre": "Some Genre Name"}, "overrides": {"tv_name": "Sweet TV Show", "genre": "Some Genre Name"},
}, },
), ),
(None, "dl --youtube.playlist_id 123abc", {"youtube": {"playlist_id": "123abc"}}), (
None,
"dl --youtube.playlist_url https://youtube.com/playlist?list=123abc",
{"youtube": {"playlist_url": "https://youtube.com/playlist?list=123abc"}},
),
], ],
) )
def test_successful_args(self, config_options_generator, aliases, cmd, expected_sub_dict): def test_successful_args(self, config_options_generator, aliases, cmd, expected_sub_dict):