[dl] improve maximum 'rate' detection (#7638)

This commit is contained in:
Mike Fährmann
2025-06-09 12:15:39 +02:00
parent 5f41ac4257
commit 7a48b696a6
3 changed files with 9 additions and 9 deletions

View File

@@ -54,7 +54,8 @@ def construct_YoutubeDL(module, obj, user_opts, system_opts=None):
rate = config("rate")
if rate:
func = util.build_selection_func(rate, 0, text.parse_bytes)
opts["ratelimit"] = func() or None
rmax = func.args[1] if hasattr(func, "args") else func()
opts["ratelimit"] = rmax or None
else:
opts["ratelimit"] = None
if opts.get("min_filesize") is None: