ytdl-sub 2025.12.31.post1__py3-none-any.whl → 2025.12.31.post2__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 CHANGED
@@ -1 +1 @@
1
- __pypi_version__ = "2025.12.31.post1";__local_version__ = "2025.12.31+d373935"
1
+ __pypi_version__ = "2025.12.31.post2";__local_version__ = "2025.12.31+7ac525f"
ytdl_sub/script/script.py CHANGED
@@ -288,6 +288,14 @@ class Script:
288
288
  unresolvable=unresolvable,
289
289
  )
290
290
 
291
+ for lambda_func in current_var.lambdas:
292
+ if lambda_func.value in self._functions:
293
+ subset_to_resolve |= self._recursive_get_unresolved_output_filter_variables(
294
+ current_var=self._functions[lambda_func.value],
295
+ subset_to_resolve=subset_to_resolve,
296
+ unresolvable=unresolvable,
297
+ )
298
+
291
299
  return subset_to_resolve
292
300
 
293
301
  def _get_unresolved_output_filter(
@@ -114,7 +114,6 @@ class VariableDependency(ABC):
114
114
  output.add(ParsedCustomFunction(name=arg.name, num_input_args=len(arg.args)))
115
115
  if isinstance(arg, VariableDependency):
116
116
  output.update(arg.custom_functions)
117
- # if isinstance(arg, Lambda)
118
117
 
119
118
  return output
120
119
 
@@ -160,6 +159,20 @@ class VariableDependency(ABC):
160
159
 
161
160
  raise UNREACHABLE
162
161
 
162
+ @final
163
+ def _custom_function_dependencies(
164
+ self, custom_function_definitions: Dict[str, "VariableDependency"]
165
+ ) -> Set[ParsedCustomFunction]:
166
+ custom_functions = self.custom_functions
167
+ for lambda_func in self.lambdas:
168
+ if lambda_func.value in custom_function_definitions:
169
+ custom_functions.add(
170
+ ParsedCustomFunction(
171
+ name=lambda_func.value, num_input_args=lambda_func.num_input_args()
172
+ )
173
+ )
174
+ return custom_functions
175
+
163
176
  @final
164
177
  def is_subset_of(
165
178
  self,
@@ -171,7 +184,8 @@ class VariableDependency(ABC):
171
184
  -------
172
185
  True if it contains all input variables as a dependency. False otherwise.
173
186
  """
174
- for custom_function in self.custom_functions:
187
+ # If there are lambdas, see if they are custom functions. If so, check them
188
+ for custom_function in self._custom_function_dependencies(custom_function_definitions):
175
189
  if not custom_function_definitions[custom_function.name].is_subset_of(
176
190
  variables=variables, custom_function_definitions=custom_function_definitions
177
191
  ):
@@ -191,16 +205,7 @@ class VariableDependency(ABC):
191
205
  True if it contains any of the input variables. False otherwise.
192
206
  """
193
207
  # If there are lambdas, see if they are custom functions. If so, check them
194
- custom_functions_to_check = self.custom_functions
195
- for lambda_func in self.lambdas:
196
- if lambda_func.value in custom_function_definitions:
197
- custom_functions_to_check.add(
198
- ParsedCustomFunction(
199
- name=lambda_func.value, num_input_args=lambda_func.num_input_args()
200
- )
201
- )
202
-
203
- for custom_function in custom_functions_to_check:
208
+ for custom_function in self._custom_function_dependencies(custom_function_definitions):
204
209
  if custom_function_definitions[custom_function.name].contains(
205
210
  variables=variables, custom_function_definitions=custom_function_definitions
206
211
  ):
@@ -241,6 +241,11 @@ def _validate_formatter(
241
241
  variable_names = {var.name for var in parsed.variables}
242
242
  custom_function_names = {f"%{func.name}" for func in parsed.custom_functions}
243
243
 
244
+ # Add lambda functions to custom function names, if it's custom
245
+ for lambda_func in parsed.lambdas:
246
+ if lambda_func in mock_script.function_names:
247
+ custom_function_names.add(lambda_func.value)
248
+
244
249
  if not variable_names.issubset(mock_script.variable_names):
245
250
  raise StringFormattingVariableNotFoundException(
246
251
  "contains the following variables that do not exist: "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ytdl-sub
3
- Version: 2025.12.31.post1
3
+ Version: 2025.12.31.post2
4
4
  Summary: Automate downloading metadata generation with YoutubeDL
5
5
  Author: Jesse Bannon
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -1,4 +1,4 @@
1
- ytdl_sub/__init__.py,sha256=WrW7vK-7xEGvZMFgyjkq_NA4CjXzPSZv3q1IzcatKCI,79
1
+ ytdl_sub/__init__.py,sha256=HxJKWoK917bwDiKevLduTUXIl0jiNh_iIIW46HIsIVI,79
2
2
  ytdl_sub/main.py,sha256=4Rf9wXxSKW7IPnWqG5YtTZ814PjP1n9WtoFDivaainE,1004
3
3
  ytdl_sub/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  ytdl_sub/cli/entrypoint.py,sha256=XXjUH4HiOP_BB2ZA_bNcyt5-o6YLAdZmj0EP3xtOtD8,9496
@@ -93,7 +93,7 @@ ytdl_sub/prebuilt_presets/tv_show/tv_show_by_date.yaml,sha256=0OgIOzxSPNVqwcZnL6
93
93
  ytdl_sub/prebuilt_presets/tv_show/tv_show_collection.yaml,sha256=XCtt4i4-zAgyfh-p4SXSGd0FI56lWCrPOMmB6mdf-AE,238393
94
94
  ytdl_sub/script/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
95
  ytdl_sub/script/parser.py,sha256=LUvmUIxg346njE8-uDx06nOW6ZDX5QS6aUtp4lsgwpk,22115
96
- ytdl_sub/script/script.py,sha256=4fP5leu1GQdbbOQLzrWGEo_zaIUeZwGY0btFqdpQmpI,26582
96
+ ytdl_sub/script/script.py,sha256=EK4L4l8OTao_SPuB9uBrWEfOGwh-pMYdnQ61_OKj5ss,26967
97
97
  ytdl_sub/script/script_output.py,sha256=5SIamnI-1D3xMA0qQzjf9xrIy8j6BVhGCKrl_Q1d2M8,1381
98
98
  ytdl_sub/script/functions/__init__.py,sha256=rzl6O5G0IEqFYHQECIM9bRvcuQj-ytC_p-Xl2TTa6j0,2932
99
99
  ytdl_sub/script/functions/array_functions.py,sha256=yg9rcZP67-aVzhu4oZZzUu3-AHiHltbQDWEs8GW1DJ4,7193
@@ -114,7 +114,7 @@ ytdl_sub/script/types/map.py,sha256=Y3zlm__IHcnycGFv0xbU_P7wgiQgtgddatPLQypjCvU,
114
114
  ytdl_sub/script/types/resolvable.py,sha256=OinvpfKsVjgU_mnE0uYONQftUxNLa1zY2jA74bywwBQ,5302
115
115
  ytdl_sub/script/types/syntax_tree.py,sha256=4xWluTMPJqA6yYuQ4XCcncSFt5cDZ9ZIT2AIOOH4bT0,2336
116
116
  ytdl_sub/script/types/variable.py,sha256=aVJ3ocUr3WpDoolOq6y3NV71b3EQQYPAGrIT0FtIqc4,813
117
- ytdl_sub/script/types/variable_dependency.py,sha256=J9XzVVrkyt-Ae2acHbb6xFnl6NIeOcL6wLOH9SvzKcA,6796
117
+ ytdl_sub/script/types/variable_dependency.py,sha256=IaHg9CFIxGf2Ce2xTz1T1IMlrspj46cZ_J8_dOabvvk,7094
118
118
  ytdl_sub/script/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
119
119
  ytdl_sub/script/utils/exception_formatters.py,sha256=hZDX2w90vU4lY2xiEM-qxQofQz2dmqPwhkSeWaJRsQ4,4645
120
120
  ytdl_sub/script/utils/exceptions.py,sha256=cag5ZLM6as1w-RsrOwO-oe4YFpwlFu_8U0QNGv_jQ68,2774
@@ -153,14 +153,14 @@ ytdl_sub/validators/regex_validator.py,sha256=jS8No927eg3zcpYEOv5g0gykePV0DCZaIr
153
153
  ytdl_sub/validators/source_variable_validator.py,sha256=ziG4PVIyzj5ky-Okle0FB2d2P5DWs3-jYF81hMvBTEQ,922
154
154
  ytdl_sub/validators/strict_dict_validator.py,sha256=RduK_3pOEbEQQuugAUeKKqM0Tv5x2vxSSb7vROyo2vQ,1661
155
155
  ytdl_sub/validators/string_datetime.py,sha256=GpbBiZH1FHTMeo0Zk134-uMdTMk2JD3Re3TnvuPx2OU,1125
156
- ytdl_sub/validators/string_formatter_validators.py,sha256=dQ_8l1wl101vPkaOlfJuXprYI5EnfHQ6jLWjGk92raA,11858
156
+ ytdl_sub/validators/string_formatter_validators.py,sha256=q_3Bn0y5id5Y8mcV1MlVrMHpQEDXOdqRLQ4i46_lvJc,12077
157
157
  ytdl_sub/validators/string_select_validator.py,sha256=KFXNKWX2J80WGt08m5gVYphPMHYxhHlgfcoXAQMq6zw,1086
158
158
  ytdl_sub/validators/validators.py,sha256=JC3-c9fSrozFADUY5jqZEhXpM2q3sfserlooQxT2DK8,9133
159
159
  ytdl_sub/ytdl_additions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  ytdl_sub/ytdl_additions/enhanced_download_archive.py,sha256=Lsc0wjHdx9d8dYJCskZYAUGDAQ_QzQ-_xbQlyrBSzfk,24884
161
- ytdl_sub-2025.12.31.post1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
162
- ytdl_sub-2025.12.31.post1.dist-info/METADATA,sha256=aCbLYK2DK2szieUQ05O-SzJc0r5erfgVXBjnTGKrW0k,51426
163
- ytdl_sub-2025.12.31.post1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
164
- ytdl_sub-2025.12.31.post1.dist-info/entry_points.txt,sha256=K3T5235NlAI-WLmHCg5tzLZHqc33OLN5IY5fOGc9t10,48
165
- ytdl_sub-2025.12.31.post1.dist-info/top_level.txt,sha256=6z-JWazl6jXspC2DNyxOnGnEqYyGzVbgcBDoXfbkUhI,9
166
- ytdl_sub-2025.12.31.post1.dist-info/RECORD,,
161
+ ytdl_sub-2025.12.31.post2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
162
+ ytdl_sub-2025.12.31.post2.dist-info/METADATA,sha256=5UMswbJAxaE7_3pFboKmQ66RiJDV3aPoV1DkOX3d6e8,51426
163
+ ytdl_sub-2025.12.31.post2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
164
+ ytdl_sub-2025.12.31.post2.dist-info/entry_points.txt,sha256=K3T5235NlAI-WLmHCg5tzLZHqc33OLN5IY5fOGc9t10,48
165
+ ytdl_sub-2025.12.31.post2.dist-info/top_level.txt,sha256=6z-JWazl6jXspC2DNyxOnGnEqYyGzVbgcBDoXfbkUhI,9
166
+ ytdl_sub-2025.12.31.post2.dist-info/RECORD,,