1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-20 01:42:50 +01:00

style: fix invalid styling

This commit is contained in:
NiChrosia 2023-10-28 14:05:41 -05:00
parent 5982686f86
commit 773b554bf5
2 changed files with 5 additions and 5 deletions

View File

@ -203,7 +203,7 @@ def test_sanitize_filename_restricted(self):
self.assertEqual('abc_de', sanitize_filename('abc/<>\\*|de', use_win_filenames=True, restricted=True))
self.assertEqual('xxx', sanitize_filename('xxx/<>\\*|', use_win_filenames=True, restricted=True))
self.assertEqual('yes_no', sanitize_filename('yes? no', use_win_filenames=True, restricted=True))
self.assertEqual('this_-_that', sanitize_filename('this: that', use_win_filenames=True ,restricted=True))
self.assertEqual('this_-_that', sanitize_filename('this: that', use_win_filenames=True, restricted=True))
tests = 'aäb\u4e2d\u56fd\u7684c'
self.assertEqual(sanitize_filename(tests, use_win_filenames=True, restricted=True), 'aab_c')
@ -222,7 +222,7 @@ def test_sanitize_filename_restricted(self):
self.assertTrue(sanitize_filename(':', use_win_filenames=True, restricted=True) != '')
self.assertEqual(sanitize_filename(
'ÂÃÄÀÁÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖŐØŒÙÚÛÜŰÝÞßàáâãäåæçèéêëìíîïðñòóôõöőøœùúûüűýþÿ', use_win_filenames=True ,restricted=True),
'ÂÃÄÀÁÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖŐØŒÙÚÛÜŰÝÞßàáâãäåæçèéêëìíîïðñòóôõöőøœùúûüűýþÿ', use_win_filenames=True, restricted=True),
'AAAAAAAECEEEEIIIIDNOOOOOOOOEUUUUUYTHssaaaaaaaeceeeeiiiionooooooooeuuuuuythy')
def test_sanitize_ids(self):

View File

@ -1256,9 +1256,9 @@ def get_value(mdict):
def filename_sanitizer(key, value, restricted=self.params.get('restrictfilenames')):
return sanitize_filename(
str(value), self.params["windowsfilenames"], restricted=restricted, is_id=(
bool(re.search(r'(^|[_.])id(\.|$)', key))
if 'filename-sanitization' in self.params['compat_opts']
else NO_DEFAULT))
bool(re.search(r'(^|[_.])id(\.|$)', key))
if 'filename-sanitization' in self.params['compat_opts']
else NO_DEFAULT))
sanitizer = sanitize if callable(sanitize) else filename_sanitizer
sanitize = bool(sanitize)