[BACKEND] Add warning for using deprecated youtube.channel date range (#200)

This commit is contained in:
Jesse Bannon 2022-08-28 11:26:43 -07:00 committed by GitHub
parent 73be77c500
commit 99925836f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ from typing import Optional
from yt_dlp import DateRange
from ytdl_sub.config.preset_options import Overrides
from ytdl_sub.utils.logger import Logger
from ytdl_sub.validators.string_datetime import StringDatetimeValidator
@ -26,6 +27,13 @@ def to_date_range_hack(
end = before.apply_formatter(variable_dict={})
if start or end:
logger = Logger.get(name="youtube-channel")
logger.warning(
"DEPRECATED: youtube.before/after will are deprecated and will be removed in v0.0.5. "
"Use the 'date_range' plugin instead: "
"https://ytdl-sub.readthedocs.io/en/latest/config.html#date-range"
)
return DateRange(start=start, end=end)
return None