From b88f9d0b2647f37009a7acc971102d6b336bb35e Mon Sep 17 00:00:00 2001 From: jbannon Date: Sat, 25 Jun 2022 15:22:55 +0000 Subject: [PATCH] fix docs --- docs/config.rst | 11 +++++++++++ src/ytdl_sub/config/config_file.py | 4 ++-- src/ytdl_sub/downloaders/youtube/merge_playlist.py | 10 ++++------ src/ytdl_sub/downloaders/youtube/split_video.py | 11 +++-------- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index a7e0179a..65eb3ca3 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -90,6 +90,17 @@ ___________ ------------------------------------------------------------------------------- +merge_playlist +______________ +.. autoclass:: ytdl_sub.downloaders.youtube.merge_playlist.YoutubeMergePlaylistDownloaderOptions() + :members: + :member-order: bysource + :inherited-members: + +.. autofunction:: ytdl_sub.downloaders.youtube.merge_playlist.YoutubeMergePlaylistDownloader.ytdl_option_defaults() + +------------------------------------------------------------------------------- + soundcloud '''''''''' Download strategies for downloading music from Soundcloud. See diff --git a/src/ytdl_sub/config/config_file.py b/src/ytdl_sub/config/config_file.py index bd031ecf..77f68aa6 100644 --- a/src/ytdl_sub/config/config_file.py +++ b/src/ytdl_sub/config/config_file.py @@ -57,13 +57,13 @@ class ConfigOptions(StrictDictValidator): .. code-block:: bash - ytdl-sub dl --preset yt_music_video --youtube.video_url youtube.com/watch?v=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 youtube.com/watch?v=a1b2c3 + ytdl-sub dl --mv --v "youtube.com/watch?v=a1b2c3" """ if self._dl_aliases: return self._dl_aliases.dict diff --git a/src/ytdl_sub/downloaders/youtube/merge_playlist.py b/src/ytdl_sub/downloaders/youtube/merge_playlist.py index ba1f6157..a7a7c620 100644 --- a/src/ytdl_sub/downloaders/youtube/merge_playlist.py +++ b/src/ytdl_sub/downloaders/youtube/merge_playlist.py @@ -10,12 +10,9 @@ from ytdl_sub.utils.chapters import Timestamp from ytdl_sub.utils.ffmpeg import add_ffmpeg_metadata from ytdl_sub.validators.validators import BoolValidator -############################################################################### -# Youtube split video downloader + options - class YoutubeMergePlaylistDownloaderOptions(YoutubePlaylistDownloaderOptions): - """ + r""" Downloads all videos in a playlist and merges them into a single video. Usage: @@ -53,7 +50,8 @@ class YoutubeMergePlaylistDownloaderOptions(YoutubePlaylistDownloaderOptions): @property def add_chapters(self) -> Optional[bool]: """ - Whether to add chapters using each video's title in the merged playlist. Defaults to false. + Optional. Whether to add chapters using each video's title in the merged playlist. + Defaults to False. """ return self._add_chapters @@ -68,7 +66,7 @@ class YoutubeMergePlaylistDownloader( @classmethod def ytdl_option_defaults(cls) -> Dict: """ - Default `ytdl_options`_ for ``split_video`` + Default `ytdl_options`_ for ``merge_playlist`` .. code-block:: yaml diff --git a/src/ytdl_sub/downloaders/youtube/split_video.py b/src/ytdl_sub/downloaders/youtube/split_video.py index 909ae5a9..8bb80db3 100644 --- a/src/ytdl_sub/downloaders/youtube/split_video.py +++ b/src/ytdl_sub/downloaders/youtube/split_video.py @@ -41,12 +41,8 @@ def _split_video_ffmpeg_cmd( return cmd -############################################################################### -# Youtube split video downloader + options - - class YoutubeSplitVideoDownloaderOptions(YoutubeVideoDownloaderOptions): - """ + r""" Downloads a single youtube video, then splits in to separate videos using a file containing timestamps. Each separate video will be formatted as if it was downloaded from a playlist. This download strategy is intended for CLI usage performing a one-time download of a video, @@ -84,9 +80,8 @@ class YoutubeSplitVideoDownloaderOptions(YoutubeVideoDownloaderOptions): 16:39 Jokes 1:02:23 Ending - The above will create 5 videos in total. The first timestamp must start with ``0:00`` - and the last timestamp, in this example, would create a video starting at ``1:02:23`` and - end at Youtube video's ending. + The above will create 5 videos in total. The last timestamp, in this example, would create a + video starting at ``1:02:23`` and end at Youtube video's ending. """ _required_keys = {"video_url", "split_timestamps"}