@@ -135,9 +135,10 @@ Type ``string`` or ``object``
|
|||||||
Default ``"auto"``
|
Default ``"auto"``
|
||||||
Example | ``"/!? (){}"``
|
Example | ``"/!? (){}"``
|
||||||
| ``{" ": "_", "/": "-", "|": "-", ":": "-", "*": "+"}``
|
| ``{" ": "_", "/": "-", "|": "-", ":": "-", "*": "+"}``
|
||||||
Description | String of characters to be replaced with underscores (``_``)
|
Description | A string of characters to be replaced with the value of
|
||||||
| or an object mapping specific characters to others
|
`path-replace <extractor.*.path-replace>`__
|
||||||
| in generated path segment names.
|
| or an object mapping invalid/unwanted characters to their replacements
|
||||||
|
| for generated path segment names.
|
||||||
|
|
||||||
Special values:
|
Special values:
|
||||||
|
|
||||||
@@ -151,6 +152,16 @@ Description | String of characters to be replaced with underscores (``_``)
|
|||||||
=========== =====
|
=========== =====
|
||||||
|
|
||||||
|
|
||||||
|
extractor.*.path-replace
|
||||||
|
------------------------
|
||||||
|
=========== =====
|
||||||
|
Type ``string``
|
||||||
|
Default ``"_"``
|
||||||
|
Description The replacement character(s) for
|
||||||
|
`path-restrict <extractor.*.path-restrict>`__
|
||||||
|
=========== =====
|
||||||
|
|
||||||
|
|
||||||
extractor.*.path-remove
|
extractor.*.path-remove
|
||||||
-----------------------
|
-----------------------
|
||||||
=========== =====
|
=========== =====
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
"skip": true,
|
"skip": true,
|
||||||
"sleep": 0,
|
"sleep": 0,
|
||||||
"path-restrict": "auto",
|
"path-restrict": "auto",
|
||||||
|
"path-replace": "_",
|
||||||
"path-remove": "\\u0000-\\u001f\\u007f",
|
"path-remove": "\\u0000-\\u001f\\u007f",
|
||||||
"user-agent": "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0",
|
"user-agent": "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0",
|
||||||
|
|
||||||
|
|||||||
@@ -725,16 +725,17 @@ class PathFormat():
|
|||||||
self.basedirectory = basedir
|
self.basedirectory = basedir
|
||||||
|
|
||||||
restrict = extractor.config("path-restrict", "auto")
|
restrict = extractor.config("path-restrict", "auto")
|
||||||
|
replace = extractor.config("path-replace", "_")
|
||||||
|
|
||||||
if restrict == "auto":
|
if restrict == "auto":
|
||||||
restrict = "\\\\|/<>:\"?*" if WINDOWS else "/"
|
restrict = "\\\\|/<>:\"?*" if WINDOWS else "/"
|
||||||
elif restrict == "unix":
|
elif restrict == "unix":
|
||||||
restrict = "/"
|
restrict = "/"
|
||||||
elif restrict == "windows":
|
elif restrict == "windows":
|
||||||
restrict = "\\\\|/<>:\"?*"
|
restrict = "\\\\|/<>:\"?*"
|
||||||
|
self.clean_segment = self._build_cleanfunc(restrict, replace)
|
||||||
|
|
||||||
remove = extractor.config("path-remove", "\x00-\x1f\x7f")
|
remove = extractor.config("path-remove", "\x00-\x1f\x7f")
|
||||||
|
|
||||||
self.clean_segment = self._build_cleanfunc(restrict, "_")
|
|
||||||
self.clean_path = self._build_cleanfunc(remove, "")
|
self.clean_path = self._build_cleanfunc(remove, "")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user