no download_strategy
This commit is contained in:
parent
b64a58f467
commit
91e38a2966
2 changed files with 3 additions and 12 deletions
|
|
@ -276,17 +276,11 @@ class MultiUrlValidator(OptionsValidator):
|
||||||
def __init__(self, name, value):
|
def __init__(self, name, value):
|
||||||
super().__init__(name, value)
|
super().__init__(name, value)
|
||||||
|
|
||||||
# Copy since we're popping things
|
|
||||||
value_copy = copy.deepcopy(value)
|
|
||||||
if isinstance(value, dict):
|
|
||||||
# Pop old required field in case it's still there
|
|
||||||
value_copy.pop("download_strategy", None)
|
|
||||||
|
|
||||||
# Deal with old multi-url download strategy
|
# Deal with old multi-url download strategy
|
||||||
if isinstance(value, dict) and "urls" in value_copy:
|
if isinstance(value, dict) and "urls" in value:
|
||||||
self._urls = UrlListValidator(name=name, value=value_copy["urls"])
|
self._urls = UrlListValidator(name=name, value=value["urls"])
|
||||||
else:
|
else:
|
||||||
self._urls = UrlListValidator(name=name, value=value_copy)
|
self._urls = UrlListValidator(name=name, value=value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def urls(self) -> UrlListValidator:
|
def urls(self) -> UrlListValidator:
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,6 @@ class TestPreset:
|
||||||
"youtube.com/watch?v=123abc", # single string
|
"youtube.com/watch?v=123abc", # single string
|
||||||
["youtube.com/watch?v=123abc", "youtube.com/watch?v=123xyz"], # list of strings
|
["youtube.com/watch?v=123abc", "youtube.com/watch?v=123xyz"], # list of strings
|
||||||
[{"url": "youtube.com/watch?v=123abc"}, "youtube.com/watch?v=123abc"], # dict and str
|
[{"url": "youtube.com/watch?v=123abc"}, "youtube.com/watch?v=123abc"], # dict and str
|
||||||
# OLD download_strategy format
|
|
||||||
{"download_strategy": "url", "url": "youtube.com/watch?v=123abc"},
|
|
||||||
{"download_strategy": "multi-url", "urls": [{"url": "youtube.com/watch?v=123abc"}]},
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_bare_minimum_preset(self, config_file, output_options, download_value):
|
def test_bare_minimum_preset(self, config_file, output_options, download_value):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue