mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-08-26 22:03:43 +03:00
Remove --filesystem-encoding option
This commit is contained in:
+2
-2
@@ -13,6 +13,7 @@ import locale
|
||||
import operator
|
||||
import os
|
||||
from pathlib import Path
|
||||
import platform
|
||||
import random
|
||||
import re
|
||||
import shutil
|
||||
@@ -267,7 +268,6 @@ class YoutubeDL:
|
||||
outtmpl_na_placeholder: Placeholder for unavailable meta fields.
|
||||
restrictfilenames: Do not allow "&" and spaces in file names
|
||||
trim_file_name: Limit length of filename (extension excluded)
|
||||
filesystem_encoding: Encoding to use when calculating filename length in bytes
|
||||
windowsfilenames: True: Force filenames to be Windows compatible
|
||||
False: Sanitize filenames only minimally
|
||||
This option has no effect when running on Windows
|
||||
@@ -1449,7 +1449,7 @@ class YoutubeDL:
|
||||
# no maximum
|
||||
return filename + suffix
|
||||
|
||||
encoding = self.params.get('filesystem_encoding') or sys.getfilesystemencoding()
|
||||
encoding = sys.getfilesystemencoding() if platform.system() != 'Windows' else 'utf-16-le'
|
||||
|
||||
def trim_filename(name: str):
|
||||
if mode == 'b':
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import codecs
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
@@ -432,12 +431,6 @@ def validate_options(opts):
|
||||
# Other options
|
||||
validate_regex('trim filenames', opts.trim_file_name, r'(?:\d+[bc]?|notrim)')
|
||||
|
||||
if opts.filesystem_encoding is not None:
|
||||
try:
|
||||
codecs.lookup(opts.filesystem_encoding)
|
||||
except LookupError:
|
||||
raise ValueError(f'Invalid filesystem encoding: {opts.filesystem_encoding}')
|
||||
|
||||
if opts.playlist_items is not None:
|
||||
try:
|
||||
tuple(PlaylistEntries.parse_playlist_items(opts.playlist_items))
|
||||
@@ -895,7 +888,6 @@ def parse_options(argv=None):
|
||||
'max_downloads': opts.max_downloads,
|
||||
'prefer_free_formats': opts.prefer_free_formats,
|
||||
'trim_file_name': opts.trim_file_name,
|
||||
'filesystem_encoding': opts.filesystem_encoding,
|
||||
'verbose': opts.verbose,
|
||||
'dump_intermediate_pages': opts.dump_intermediate_pages,
|
||||
'write_pages': opts.write_pages,
|
||||
|
||||
Reference in New Issue
Block a user