mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
add 'path-extended' option (#3021)
This commit is contained in:
parent
bc9d291c13
commit
7f30a0d7a7
@ -263,6 +263,17 @@ Description
|
||||
* ``"windows"``: ``". "``
|
||||
|
||||
|
||||
extractor.*.path-extended
|
||||
-------------------------
|
||||
Type
|
||||
``bool``
|
||||
Default
|
||||
``true``
|
||||
Description
|
||||
On Windows, use `extended-length paths <https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation>`__
|
||||
prefixed with ``\\?\`` to work around the 260 characters path length limit.
|
||||
|
||||
|
||||
extractor.*.extension-map
|
||||
-------------------------
|
||||
Type
|
||||
|
@ -24,6 +24,8 @@
|
||||
"path-replace": "_",
|
||||
"path-remove": "\\u0000-\\u001f\\u007f",
|
||||
"path-strip": "auto",
|
||||
"path-extended": true,
|
||||
|
||||
"extension-map": {
|
||||
"jpeg": "jpg",
|
||||
"jpe" : "jpg",
|
||||
|
@ -105,6 +105,9 @@ class PathFormat():
|
||||
strip = ". "
|
||||
self.strip = strip
|
||||
|
||||
if WINDOWS:
|
||||
self.extended = config("path-extended", True)
|
||||
|
||||
basedir = extractor._parentdir
|
||||
if not basedir:
|
||||
basedir = config("base-directory")
|
||||
@ -178,7 +181,7 @@ class PathFormat():
|
||||
else:
|
||||
self.directory = directory = self.basedirectory
|
||||
|
||||
if WINDOWS:
|
||||
if WINDOWS and self.extended:
|
||||
# Enable longer-than-260-character paths
|
||||
directory = os.path.abspath(directory)
|
||||
if directory.startswith("\\\\"):
|
||||
|
Loading…
Reference in New Issue
Block a user