update all docs
This commit is contained in:
parent
2151084496
commit
af236cf1bb
4 changed files with 19 additions and 15 deletions
|
|
@ -38,7 +38,7 @@ download, like a YouTube channel to pull new videos. It looks something like:
|
|||
john_smith_channel:
|
||||
preset: "yt_channel_as_tv"
|
||||
youtube:
|
||||
channel_id: "UCsvn_Po0SmunchJYtttWpOxMg"
|
||||
channel_url: "https://youtube.com/channe/UCsvn_Po0SmunchJYtttWpOxMg"
|
||||
overrides:
|
||||
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
|
||||
example above:
|
||||
```shell
|
||||
ytdl-sub dl \
|
||||
--preset "yt_channel_as_tv" \
|
||||
--youtube.channel_id "UCsvn_Po0SmunchJYtttWpOxMg" \
|
||||
ytdl-sub dl \
|
||||
--preset "yt_channel_as_tv" \
|
||||
--youtube.channel_url "https://youtube.com/channel/UCsvn_Po0SmunchJYtttWpOxMg" \
|
||||
--overrides.tv_show_name "John Smith Vlogs"
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -190,13 +190,13 @@ Below is an example that downloads YouTube videos:
|
|||
my_subscription_name:
|
||||
preset: "playlist_preset_ex"
|
||||
youtube:
|
||||
playlist_id: "UCsvn_Po0SmunchJYtttWpOxMg"
|
||||
playlist_url: "https://youtube.com/playlist?list=UCsvn_Po0SmunchJYtttWpOxMg"
|
||||
overrides:
|
||||
playlist_name: "diy-playlist"
|
||||
|
||||
Our preset ``playlist_preset_ex`` uses the `YouTube Playlist`_ download strategy, and defines two
|
||||
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.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -51,19 +51,19 @@ class ConfigOptions(StrictDictValidator):
|
|||
configuration:
|
||||
dl_aliases:
|
||||
mv: "--preset yt_music_video"
|
||||
v: "--youtube.video_id"
|
||||
v: "--youtube.video_url"
|
||||
|
||||
Simplifies
|
||||
|
||||
.. 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
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
ytdl-sub dl --mv --v a1b2c3
|
||||
ytdl-sub dl --mv --v youtube.com/watch?v=a1b2c3
|
||||
"""
|
||||
if self._dl_aliases:
|
||||
return self._dl_aliases.dict
|
||||
|
|
|
|||
|
|
@ -43,25 +43,29 @@ class TestDownloadArgsParser:
|
|||
"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",
|
||||
{"preset": "yt_music_video", "youtube": {"video_id": "123abc"}},
|
||||
{"preset": "yt_music_video", "youtube": {"video_url": "123abc"}},
|
||||
),
|
||||
(
|
||||
{
|
||||
"ch": "--preset yt_channel",
|
||||
"c": "--youtube.channel_id",
|
||||
"c": "--youtube.channel_url",
|
||||
"name": "--overrides.tv_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",
|
||||
"youtube": {"channel_id": "123abc"},
|
||||
"youtube": {"channel_url": "https://youtube.com/channel/123abc"},
|
||||
"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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue