diff --git a/CHANGELOG.md b/CHANGELOG.md index 1235802d..92cb6515 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## Unreleased + ## 1.16.2 - 2021-01-09 ### Additions - [derpibooru] add `search` and `gallery` extractors ([#862](https://github.com/mikf/gallery-dl/issues/862)) diff --git a/gallery_dl/postprocessor/metadata.py b/gallery_dl/postprocessor/metadata.py index 27f9c034..71a67c17 100644 --- a/gallery_dl/postprocessor/metadata.py +++ b/gallery_dl/postprocessor/metadata.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2019-2020 Mike Fährmann +# Copyright 2019-2021 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -86,7 +86,8 @@ class MetadataPP(PostProcessor): return (pathfmt.filename or "metadata") + "." + self.extension def _filename_custom(self, pathfmt): - return self._filename_fmt(pathfmt.kwdict) + return pathfmt.clean_path(pathfmt.clean_segment( + self._filename_fmt(pathfmt.kwdict))) def _filename_extfmt(self, pathfmt): kwdict = pathfmt.kwdict diff --git a/gallery_dl/version.py b/gallery_dl/version.py index c899f397..f1754b98 100644 --- a/gallery_dl/version.py +++ b/gallery_dl/version.py @@ -6,4 +6,4 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -__version__ = "1.16.2" +__version__ = "1.16.3-dev" diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py index 74e87427..4e98a97c 100644 --- a/test/test_postprocessor.py +++ b/test/test_postprocessor.py @@ -306,14 +306,14 @@ class MetadataTest(BasePostprocessorTest): def test_metadata_filename(self): self._create({ - "filename" : "{category}_{filename}_meta.data", + "filename" : "{category}_{filename}_/meta/\n\r.data", "extension-format": "json", }) with patch("builtins.open", mock_open()) as m: self._trigger() - path = self.pathfmt.realdirectory + "test_file_meta.data" + path = self.pathfmt.realdirectory + "test_file__meta_.data" m.assert_called_once_with(path, "w", encoding="utf-8") @staticmethod