[BUGFIX] Fix playlists not downloading correctly
Due to url ytdl-options not materializing
This commit is contained in:
parent
7676fd9488
commit
88110a816d
3 changed files with 14 additions and 6 deletions
|
|
@ -1,7 +1,9 @@
|
|||
from typing import Any
|
||||
from typing import Dict
|
||||
from typing import Optional
|
||||
|
||||
from ytdl_sub.config.defaults import DEFAULT_DOWNLOAD_ARCHIVE_NAME
|
||||
from ytdl_sub.config.overrides import Overrides
|
||||
from ytdl_sub.validators.file_path_validators import OverridesStringFormatterFilePathValidator
|
||||
from ytdl_sub.validators.file_path_validators import StringFormatterFileNameValidator
|
||||
from ytdl_sub.validators.strict_dict_validator import StrictDictValidator
|
||||
|
|
@ -48,6 +50,16 @@ class YTDLOptions(UnstructuredOverridesDictFormatterValidator):
|
|||
where each key is a ytdl argument. Include in the example are some popular ytdl_options.
|
||||
"""
|
||||
|
||||
def to_native_dict(self, overrides: Overrides) -> Dict:
|
||||
"""
|
||||
Materializes the entire ytdl-options dict from OverrideStringFormatters into
|
||||
native python
|
||||
"""
|
||||
return {
|
||||
key: overrides.apply_overrides_formatter_to_native(val)
|
||||
for key, val in self.dict.items()
|
||||
}
|
||||
|
||||
|
||||
# Disable for proper docstring formatting
|
||||
# pylint: disable=line-too-long
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ class MultiUrlDownloader(SourcePlugin[MultiUrlValidator]):
|
|||
|
||||
def _download_metadata(self, url: str, validator: UrlValidator) -> Iterable[Entry]:
|
||||
metadata_ytdl_options = self.metadata_ytdl_options(
|
||||
ytdl_option_overrides=validator.ytdl_options.dict
|
||||
ytdl_option_overrides=validator.ytdl_options.to_native_dict(self.overrides)
|
||||
)
|
||||
download_reversed = ScriptUtils.bool_formatter_output(
|
||||
self.overrides.apply_formatter(validator.download_reverse)
|
||||
|
|
|
|||
|
|
@ -110,11 +110,7 @@ class SubscriptionYTDLOptions:
|
|||
|
||||
@property
|
||||
def _user_ytdl_options(self) -> Dict:
|
||||
native_ytdl_options = {
|
||||
key: self._overrides.apply_overrides_formatter_to_native(val)
|
||||
for key, val in self._preset.ytdl_options.dict.items()
|
||||
}
|
||||
return native_ytdl_options
|
||||
return self._preset.ytdl_options.to_native_dict(self._overrides)
|
||||
|
||||
@property
|
||||
def _plugin_match_filters(self) -> Dict:
|
||||
|
|
|
|||
Loading…
Reference in a new issue