ytdl-sub 2025.11.28__py3-none-any.whl → 2025.12.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ytdl_sub/__init__.py +1 -1
- ytdl_sub/config/config_validator.py +8 -0
- ytdl_sub/config/preset_options.py +17 -2
- ytdl_sub/prebuilt_presets/tv_show/tv_show_collection.yaml +5206 -644
- ytdl_sub/subscriptions/base_subscription.py +8 -0
- ytdl_sub/utils/exceptions.py +4 -0
- ytdl_sub/utils/file_handler.py +30 -0
- {ytdl_sub-2025.11.28.dist-info → ytdl_sub-2025.12.6.dist-info}/METADATA +1 -1
- {ytdl_sub-2025.11.28.dist-info → ytdl_sub-2025.12.6.dist-info}/RECORD +13 -13
- {ytdl_sub-2025.11.28.dist-info → ytdl_sub-2025.12.6.dist-info}/WHEEL +0 -0
- {ytdl_sub-2025.11.28.dist-info → ytdl_sub-2025.12.6.dist-info}/entry_points.txt +0 -0
- {ytdl_sub-2025.11.28.dist-info → ytdl_sub-2025.12.6.dist-info}/licenses/LICENSE +0 -0
- {ytdl_sub-2025.11.28.dist-info → ytdl_sub-2025.12.6.dist-info}/top_level.txt +0 -0
ytdl_sub/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__pypi_version__ = "2025.
|
|
1
|
+
__pypi_version__ = "2025.12.06";__local_version__ = "2025.12.06+a5ae695"
|
|
@@ -12,6 +12,8 @@ from ytdl_sub.config.defaults import DEFAULT_FFPROBE_PATH
|
|
|
12
12
|
from ytdl_sub.config.defaults import DEFAULT_LOCK_DIRECTORY
|
|
13
13
|
from ytdl_sub.config.defaults import MAX_FILE_NAME_BYTES
|
|
14
14
|
from ytdl_sub.prebuilt_presets import PREBUILT_PRESETS
|
|
15
|
+
from ytdl_sub.utils.exceptions import SubscriptionPermissionError
|
|
16
|
+
from ytdl_sub.utils.file_handler import FileHandler
|
|
15
17
|
from ytdl_sub.validators.file_path_validators import FFmpegFileValidator
|
|
16
18
|
from ytdl_sub.validators.file_path_validators import FFprobeFileValidator
|
|
17
19
|
from ytdl_sub.validators.strict_dict_validator import StrictDictValidator
|
|
@@ -147,6 +149,12 @@ class ConfigOptions(StrictDictValidator):
|
|
|
147
149
|
key="file_name_max_bytes", validator=IntValidator, default=MAX_FILE_NAME_BYTES
|
|
148
150
|
)
|
|
149
151
|
|
|
152
|
+
if not FileHandler.is_path_writable(self.working_directory):
|
|
153
|
+
raise SubscriptionPermissionError(
|
|
154
|
+
"ytdl-sub does not have permissions to the working directory: "
|
|
155
|
+
f"{self.working_directory}"
|
|
156
|
+
)
|
|
157
|
+
|
|
150
158
|
@property
|
|
151
159
|
def working_directory(self) -> str:
|
|
152
160
|
"""
|
|
@@ -8,6 +8,9 @@ from ytdl_sub.config.overrides import Overrides
|
|
|
8
8
|
from ytdl_sub.config.plugin.plugin_operation import PluginOperation
|
|
9
9
|
from ytdl_sub.config.validators.options import OptionsDictValidator
|
|
10
10
|
from ytdl_sub.entries.script.variable_definitions import VARIABLES as v
|
|
11
|
+
from ytdl_sub.utils.exceptions import SubscriptionPermissionError
|
|
12
|
+
from ytdl_sub.utils.exceptions import ValidationException
|
|
13
|
+
from ytdl_sub.utils.file_handler import FileHandler
|
|
11
14
|
from ytdl_sub.validators.file_path_validators import OverridesStringFormatterFilePathValidator
|
|
12
15
|
from ytdl_sub.validators.file_path_validators import StringFormatterFileNameValidator
|
|
13
16
|
from ytdl_sub.validators.string_datetime import StringDatetimeValidator
|
|
@@ -57,12 +60,24 @@ class YTDLOptions(UnstructuredOverridesDictFormatterValidator):
|
|
|
57
60
|
def to_native_dict(self, overrides: Overrides) -> Dict:
|
|
58
61
|
"""
|
|
59
62
|
Materializes the entire ytdl-options dict from OverrideStringFormatters into
|
|
60
|
-
native python
|
|
63
|
+
native python.
|
|
61
64
|
"""
|
|
62
|
-
|
|
65
|
+
out = {
|
|
63
66
|
key: overrides.apply_overrides_formatter_to_native(val)
|
|
64
67
|
for key, val in self.dict.items()
|
|
65
68
|
}
|
|
69
|
+
if "cookiefile" in out:
|
|
70
|
+
if not FileHandler.is_file_existent(out["cookiefile"]):
|
|
71
|
+
raise ValidationException(
|
|
72
|
+
f"Specified cookiefile {out['cookiefile']} but it does not exist as a file."
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
if not FileHandler.is_file_readable(out["cookiefile"]):
|
|
76
|
+
raise SubscriptionPermissionError(
|
|
77
|
+
f"Cannot read cookiefile {out['cookiefile']} due to permissions issue."
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return out
|
|
66
81
|
|
|
67
82
|
|
|
68
83
|
# Disable for proper docstring formatting
|