From 9b1bd094543570c65cc23299161ea5ec9f912bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 14 Nov 2020 22:40:31 +0100 Subject: [PATCH] change 'extension-map' default Replace all JPEG filename extensions with 'jpg'. --- CHANGELOG.md | 2 ++ docs/configuration.rst | 4 +--- gallery_dl/util.py | 10 ++++++++-- gallery_dl/version.py | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59ee36ab..308c1dbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## Unreleased + ## 1.15.3 - 2020-11-13 ### Additions - [sankakucomplex] extract videos and embeds ([#308](https://github.com/mikf/gallery-dl/issues/308)) diff --git a/docs/configuration.rst b/docs/configuration.rst index 88af600e..33823c1e 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -188,8 +188,6 @@ extractor.*.extension-map Type ``object`` Default - ``null`` -Example .. code:: json { @@ -200,7 +198,7 @@ Example "jfi" : "jpg" } Description - A JSON ``object`` mapping filename extensions to alternatives. + A JSON ``object`` mapping filename extensions to their replacements. extractor.*.skip diff --git a/gallery_dl/util.py b/gallery_dl/util.py index a334b6ed..4c0d17b7 100644 --- a/gallery_dl/util.py +++ b/gallery_dl/util.py @@ -717,6 +717,13 @@ class Formatter(): class PathFormat(): + EXTENSION_MAP = { + "jpeg": "jpg", + "jpe" : "jpg", + "jfif": "jpg", + "jif" : "jpg", + "jfi" : "jpg", + } def __init__(self, extractor): filename_fmt = extractor.config("filename", extractor.filename_fmt) @@ -725,8 +732,7 @@ class PathFormat(): extension_map = extractor.config("extension-map") if extension_map is None: - # TODO: better default value in 1.16.0 - extension_map = {} + extension_map = self.EXTENSION_MAP self.extension_map = extension_map.get try: diff --git a/gallery_dl/version.py b/gallery_dl/version.py index 605865ff..8376f6da 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.15.3" +__version__ = "1.16.0-dev"