Remove control characters from filesystem paths

- add 'path-remove' option to specify the set of characters that
 should be removed
- rename 'restrict-filenames' to 'path-restrict'
- #348, #380
This commit is contained in:
Mike Fährmann
2019-08-16 21:13:49 +02:00
parent c50d60a53d
commit 5a210991b6
3 changed files with 46 additions and 23 deletions

View File

@@ -108,21 +108,36 @@ Description Directory path used as the base for all download destinations.
=========== =====
extractor.*.restrict-filenames
------------------------------
extractor.*.path-restrict
-------------------------
=========== =====
Type ``string``
Default ``"auto"``
Example ``"/!? ()[]{}"``
Description Characters to replace with underscores (``_``) when generating
directory and file names.
Example ``"/!? (){}"``
Description Set of characters to replace with underscores (``_``)
in generated path segment names.
Special values:
* ``"auto"``: Use characters from ``"unix"`` or ``"windows"``
depending on the local operating system
* ``"unix"``: ``"/"``
* ``"windows"``: ``"<>:\"\\|/?*"``
* ``"windows"``: ``"\\\\|/<>:\"?*"``
Note: In a set with 2 or more characters, ``[]^-\`` need to be
escaped with backslashes, e.g. ``"\\[\\]"``
=========== =====
extractor.*.path-remove
-----------------------
=========== =====
Type ``string``
Default ``"\\u0000-\\u001f\\u007f"`` (ASCII control characters)
Description Set of characters to remove from generated path names.
Note: In a set with 2 or more characters, ``[]^-\`` need to be
escaped with backslashes, e.g. ``"\\[\\]"``
=========== =====

View File

@@ -8,8 +8,9 @@
"proxy": null,
"skip": true,
"sleep": 0,
"path-restrict": "auto",
"path-remove": "\\u0000-\\u001f\\u007f",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0",
"restrict-filenames": "auto",
"artstation":
{