From b47e1470a892e32ef43df4be47740276b5bd468d Mon Sep 17 00:00:00 2001 From: jbannon Date: Sat, 7 May 2022 00:26:51 +0000 Subject: [PATCH] fixed test, docs --- docs/conf.py | 2 +- docs/config.rst | 44 +++++++++---------- docs/index.rst | 2 +- .../downloaders/youtube_downloader.py | 13 +----- .../youtube/test_channel_as_kodi_tv_show.py | 6 +-- 5 files changed, 28 insertions(+), 39 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index faf3ee3b..d603eaa7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -49,7 +49,7 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # html_theme = "sphinx_rtd_theme" -html_theme_options = {"navigation_depth": 8} +html_theme_options = {"navigation_depth": 10} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/docs/config.rst b/docs/config.rst index 1a881619..62646132 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -7,30 +7,28 @@ ytdl-sub is configured in the ``config.yaml`` and consists of two sections: configuration: presets: -config.yaml ------------ configuration -^^^^^^^^^^^^^ +------------- The ``configuration`` section contains app-wide configs. presets -^^^^^^^ +------- ``presets`` define a `formula` for how to format downloaded media and metadata. source -"""""" +^^^^^^ Download strategies dictate what exactly is getting downloaded from which source. By having separate strategies, we can define strategy-dependent parameters to better fine-tune how we download things. youtube -''''''' +""""""" channel -....... +''''''' .. code-block:: yaml presets: @@ -61,7 +59,7 @@ _____ -------- playlist -........ +'''''''' .. code-block:: yaml presets: @@ -76,7 +74,7 @@ ___________ -------- video -..... +''''' .. code-block:: yaml presets: @@ -91,10 +89,10 @@ ________ -------- soundcloud -'''''''''' +"""""""""" albums_and_singles -.................. +'''''''''''''''''' .. code-block:: yaml presets: @@ -113,49 +111,49 @@ ____________________ -------- output_options -"""""""""""""" +^^^^^^^^^^^^^^ output_directory -'''''''''''''''' +"""""""""""""""" .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.output_directory file_name -''''''''' +""""""""" .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.file_name thumbnail_name -'''''''''''''' +"""""""""""""" .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.thumbnail_name maintain_download_archive -''''''''''''''''''''''''' +""""""""""""""""""""""""" .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.maintain_download_archive keep_files -'''''''''' +"""""""""" .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.keep_files YTDL Options -"""""""""""" +^^^^^^^^^^^^ TODO Overrides -""""""""" +^^^^^^^^^ TODO Plugins -""""""" +^^^^^^^ Music Tags -'''''''''' +"""""""""" TODO NFO -''' +""" TODO NFO Output Directory -'''''''''''''''''''' +"""""""""""""""""""" TODO Format Variables diff --git a/docs/index.rst b/docs/index.rst index 421058ac..8b3be2de 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,7 +15,7 @@ Contents ======== .. toctree:: - :maxdepth: 5 + :maxdepth: 10 getting_started config diff --git a/src/ytdl_sub/downloaders/youtube_downloader.py b/src/ytdl_sub/downloaders/youtube_downloader.py index 676ccf9c..8de267cb 100644 --- a/src/ytdl_sub/downloaders/youtube_downloader.py +++ b/src/ytdl_sub/downloaders/youtube_downloader.py @@ -162,7 +162,7 @@ class YoutubeChannelDownloaderOptions(YoutubeDownloaderOptions, DateRangeValidat like `UCsvn_Po0SmunchJYOWpOxMg`. You can get this by opening a video and clicking on the channel's avatar image to take you to their channel, then check the url. """ - return self.channel_id + return self._channel_id.value @property def channel_avatar_path(self) -> Optional[OverridesStringFormatterValidator]: @@ -203,20 +203,11 @@ class YoutubeChannelDownloader(YoutubeDownloader[YoutubeChannelDownloaderOptions """Returns full channel url""" return f"https://youtube.com/channel/{channel_id}" - @property - def channel_id(self) -> str: - """ - Returns - ------- - Channel ID - """ - return self.download_options.channel_id.value - def download(self) -> List[YoutubeVideo]: """ Downloads all videos from a channel """ - channel_url = self.channel_url(channel_id=self.channel_id) + channel_url = self.channel_url(channel_id=self.download_options.channel_id) channel_videos: List[YoutubeVideo] = [] ytdl_options_overrides = {} diff --git a/tests/e2e/youtube/test_channel_as_kodi_tv_show.py b/tests/e2e/youtube/test_channel_as_kodi_tv_show.py index 01d7de32..03c1e22e 100644 --- a/tests/e2e/youtube/test_channel_as_kodi_tv_show.py +++ b/tests/e2e/youtube/test_channel_as_kodi_tv_show.py @@ -66,7 +66,7 @@ def expected_full_channel_download(): return ExpectedDownload( expected_md5_file_hashes={ # Download mapping - Path("pz/.ytdl-subscribe-pz-download-mapping.json"): "add71021318bf87a3facb965fd38bd7f", + Path("pz/.ytdl-sub-pz-download-archive.json"): "add71021318bf87a3facb965fd38bd7f", # Output directory files Path("pz/fanart.jpg"): "e6e323373c8902568e96e374817179cf", @@ -158,7 +158,7 @@ def expected_recent_channel_download(): return ExpectedDownload( expected_md5_file_hashes={ # Download mapping - Path("pz/.ytdl-subscribe-pz-download-mapping.json"): "a133d9ea8a63e239cd41b799b9031fd5", + Path("pz/.ytdl-sub-pz-download-archive.json"): "a133d9ea8a63e239cd41b799b9031fd5", # Output directory files Path("pz/fanart.jpg"): "e6e323373c8902568e96e374817179cf", @@ -205,7 +205,7 @@ def expected_rolling_recent_channel_download(): return ExpectedDownload( expected_md5_file_hashes={ # Download mapping - Path("pz/.ytdl-subscribe-pz-download-mapping.json"): "8013b4d2ba6921c9347c014ac915e3f6", + Path("pz/.ytdl-sub-pz-download-archive.json"): "8013b4d2ba6921c9347c014ac915e3f6", # Output directory files Path("pz/fanart.jpg"): "e6e323373c8902568e96e374817179cf",