fixed test, docs

This commit is contained in:
jbannon 2022-05-07 00:26:51 +00:00
parent 5dd1fb1ece
commit b47e1470a8
5 changed files with 28 additions and 39 deletions

View file

@ -49,7 +49,7 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# #
html_theme = "sphinx_rtd_theme" 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, # 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, # relative to this directory. They are copied after the builtin static files,

View file

@ -7,30 +7,28 @@ ytdl-sub is configured in the ``config.yaml`` and consists of two sections:
configuration: configuration:
presets: presets:
config.yaml
-----------
configuration configuration
^^^^^^^^^^^^^ -------------
The ``configuration`` section contains app-wide configs. The ``configuration`` section contains app-wide configs.
presets presets
^^^^^^^ -------
``presets`` define a `formula` for how to format downloaded media and metadata. ``presets`` define a `formula` for how to format downloaded media and metadata.
source source
"""""" ^^^^^^
Download strategies dictate what exactly is getting downloaded from which Download strategies dictate what exactly is getting downloaded from which
source. By having separate strategies, we can define strategy-dependent source. By having separate strategies, we can define strategy-dependent
parameters to better fine-tune how we download things. parameters to better fine-tune how we download things.
youtube youtube
''''''' """""""
channel channel
....... '''''''
.. code-block:: yaml .. code-block:: yaml
presets: presets:
@ -61,7 +59,7 @@ _____
-------- --------
playlist playlist
........ ''''''''
.. code-block:: yaml .. code-block:: yaml
presets: presets:
@ -76,7 +74,7 @@ ___________
-------- --------
video video
..... '''''
.. code-block:: yaml .. code-block:: yaml
presets: presets:
@ -91,10 +89,10 @@ ________
-------- --------
soundcloud soundcloud
'''''''''' """"""""""
albums_and_singles albums_and_singles
.................. ''''''''''''''''''
.. code-block:: yaml .. code-block:: yaml
presets: presets:
@ -113,49 +111,49 @@ ____________________
-------- --------
output_options output_options
"""""""""""""" ^^^^^^^^^^^^^^
output_directory output_directory
'''''''''''''''' """"""""""""""""
.. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.output_directory .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.output_directory
file_name file_name
''''''''' """""""""
.. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.file_name .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.file_name
thumbnail_name thumbnail_name
'''''''''''''' """"""""""""""
.. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.thumbnail_name .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.thumbnail_name
maintain_download_archive maintain_download_archive
''''''''''''''''''''''''' """""""""""""""""""""""""
.. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.maintain_download_archive .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.maintain_download_archive
keep_files keep_files
'''''''''' """"""""""
.. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.keep_files .. autoproperty:: ytdl_sub.config.preset_options.OutputOptions.keep_files
YTDL Options YTDL Options
"""""""""""" ^^^^^^^^^^^^
TODO TODO
Overrides Overrides
""""""""" ^^^^^^^^^
TODO TODO
Plugins Plugins
""""""" ^^^^^^^
Music Tags Music Tags
'''''''''' """"""""""
TODO TODO
NFO NFO
''' """
TODO TODO
NFO Output Directory NFO Output Directory
'''''''''''''''''''' """"""""""""""""""""
TODO TODO
Format Variables Format Variables

View file

@ -15,7 +15,7 @@ Contents
======== ========
.. toctree:: .. toctree::
:maxdepth: 5 :maxdepth: 10
getting_started getting_started
config config

View file

@ -162,7 +162,7 @@ class YoutubeChannelDownloaderOptions(YoutubeDownloaderOptions, DateRangeValidat
like `UCsvn_Po0SmunchJYOWpOxMg`. You can get this by opening a video and clicking on the 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. channel's avatar image to take you to their channel, then check the url.
""" """
return self.channel_id return self._channel_id.value
@property @property
def channel_avatar_path(self) -> Optional[OverridesStringFormatterValidator]: def channel_avatar_path(self) -> Optional[OverridesStringFormatterValidator]:
@ -203,20 +203,11 @@ class YoutubeChannelDownloader(YoutubeDownloader[YoutubeChannelDownloaderOptions
"""Returns full channel url""" """Returns full channel url"""
return f"https://youtube.com/channel/{channel_id}" 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]: def download(self) -> List[YoutubeVideo]:
""" """
Downloads all videos from a channel 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] = [] channel_videos: List[YoutubeVideo] = []
ytdl_options_overrides = {} ytdl_options_overrides = {}

View file

@ -66,7 +66,7 @@ def expected_full_channel_download():
return ExpectedDownload( return ExpectedDownload(
expected_md5_file_hashes={ expected_md5_file_hashes={
# Download mapping # Download mapping
Path("pz/.ytdl-subscribe-pz-download-mapping.json"): "add71021318bf87a3facb965fd38bd7f", Path("pz/.ytdl-sub-pz-download-archive.json"): "add71021318bf87a3facb965fd38bd7f",
# Output directory files # Output directory files
Path("pz/fanart.jpg"): "e6e323373c8902568e96e374817179cf", Path("pz/fanart.jpg"): "e6e323373c8902568e96e374817179cf",
@ -158,7 +158,7 @@ def expected_recent_channel_download():
return ExpectedDownload( return ExpectedDownload(
expected_md5_file_hashes={ expected_md5_file_hashes={
# Download mapping # Download mapping
Path("pz/.ytdl-subscribe-pz-download-mapping.json"): "a133d9ea8a63e239cd41b799b9031fd5", Path("pz/.ytdl-sub-pz-download-archive.json"): "a133d9ea8a63e239cd41b799b9031fd5",
# Output directory files # Output directory files
Path("pz/fanart.jpg"): "e6e323373c8902568e96e374817179cf", Path("pz/fanart.jpg"): "e6e323373c8902568e96e374817179cf",
@ -205,7 +205,7 @@ def expected_rolling_recent_channel_download():
return ExpectedDownload( return ExpectedDownload(
expected_md5_file_hashes={ expected_md5_file_hashes={
# Download mapping # Download mapping
Path("pz/.ytdl-subscribe-pz-download-mapping.json"): "8013b4d2ba6921c9347c014ac915e3f6", Path("pz/.ytdl-sub-pz-download-archive.json"): "8013b4d2ba6921c9347c014ac915e3f6",
# Output directory files # Output directory files
Path("pz/fanart.jpg"): "e6e323373c8902568e96e374817179cf", Path("pz/fanart.jpg"): "e6e323373c8902568e96e374817179cf",