mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-08-20 14:16:46 +00:00
@@ -396,6 +396,7 @@ banned-from = [
|
||||
"yt_dlp.utils.intlist_to_bytes".msg = "Use `bytes` instead."
|
||||
"yt_dlp.utils.jwt_encode_hs256".msg = "Use `yt_dlp.utils.jwt_encode` instead."
|
||||
"yt_dlp.utils.make_dir".msg = "Use `yt_dlp.utils.make_parent_dirs` instead."
|
||||
"yt_dlp.utils.number_of_digits".msg = "Do not use"
|
||||
"yt_dlp.utils.decodeArgument".msg = "Do not use"
|
||||
"yt_dlp.utils.decodeFilename".msg = "Do not use"
|
||||
"yt_dlp.utils.encodeFilename".msg = "Do not use"
|
||||
|
||||
+2
-3
@@ -140,7 +140,6 @@ from .utils import (
|
||||
locked_file,
|
||||
make_archive_id,
|
||||
make_parent_dirs,
|
||||
number_of_digits,
|
||||
orderedSet,
|
||||
orderedSet_from_options,
|
||||
parse_filesize,
|
||||
@@ -1286,8 +1285,8 @@ class YoutubeDL:
|
||||
# For fields playlist_index, playlist_autonumber and autonumber convert all occurrences
|
||||
# of %(field)s to %(field)0Nd for backward compatibility
|
||||
field_size_compat_map = {
|
||||
'playlist_index': number_of_digits(info_dict.get('__last_playlist_index') or 0),
|
||||
'playlist_autonumber': number_of_digits(info_dict.get('n_entries') or 0),
|
||||
'playlist_index': len(str(info_dict.get('__last_playlist_index') or 0)),
|
||||
'playlist_autonumber': len(str(info_dict.get('n_entries') or 0)),
|
||||
'autonumber': self.params.get('autonumber_size') or 5,
|
||||
}
|
||||
|
||||
|
||||
@@ -58,4 +58,8 @@ def make_dir(path, to_screen=None):
|
||||
return False
|
||||
|
||||
|
||||
def number_of_digits(number):
|
||||
return len('%d' % number)
|
||||
|
||||
|
||||
compiled_regex_type = type(re.compile(''))
|
||||
|
||||
@@ -4864,10 +4864,6 @@ def remove_terminal_sequences(string):
|
||||
return _terminal_sequences_re.sub('', string)
|
||||
|
||||
|
||||
def number_of_digits(number):
|
||||
return len('%d' % number)
|
||||
|
||||
|
||||
def join_nonempty(*values, delim='-', from_dict=None):
|
||||
if from_dict is not None:
|
||||
values = (traversal.traverse_obj(from_dict, variadic(v)) for v in values)
|
||||
|
||||
Reference in New Issue
Block a user