1
0
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:
Mike Fährmann 2022-10-07 18:23:06 +02:00
parent bc9d291c13
commit 7f30a0d7a7
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -24,6 +24,8 @@
"path-replace": "_",
"path-remove": "\\u0000-\\u001f\\u007f",
"path-strip": "auto",
"path-extended": true,
"extension-map": {
"jpeg": "jpg",
"jpe" : "jpg",

View File

@ -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("\\\\"):