1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

change 'extension-map' default

Replace all JPEG filename extensions with 'jpg'.
This commit is contained in:
Mike Fährmann 2020-11-14 22:40:31 +01:00
parent e5438b8a29
commit 9b1bd09454
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
4 changed files with 12 additions and 6 deletions

View File

@ -1,5 +1,7 @@
# Changelog # Changelog
## Unreleased
## 1.15.3 - 2020-11-13 ## 1.15.3 - 2020-11-13
### Additions ### Additions
- [sankakucomplex] extract videos and embeds ([#308](https://github.com/mikf/gallery-dl/issues/308)) - [sankakucomplex] extract videos and embeds ([#308](https://github.com/mikf/gallery-dl/issues/308))

View File

@ -188,8 +188,6 @@ extractor.*.extension-map
Type Type
``object`` ``object``
Default Default
``null``
Example
.. code:: json .. code:: json
{ {
@ -200,7 +198,7 @@ Example
"jfi" : "jpg" "jfi" : "jpg"
} }
Description Description
A JSON ``object`` mapping filename extensions to alternatives. A JSON ``object`` mapping filename extensions to their replacements.
extractor.*.skip extractor.*.skip

View File

@ -717,6 +717,13 @@ class Formatter():
class PathFormat(): class PathFormat():
EXTENSION_MAP = {
"jpeg": "jpg",
"jpe" : "jpg",
"jfif": "jpg",
"jif" : "jpg",
"jfi" : "jpg",
}
def __init__(self, extractor): def __init__(self, extractor):
filename_fmt = extractor.config("filename", extractor.filename_fmt) filename_fmt = extractor.config("filename", extractor.filename_fmt)
@ -725,8 +732,7 @@ class PathFormat():
extension_map = extractor.config("extension-map") extension_map = extractor.config("extension-map")
if extension_map is None: if extension_map is None:
# TODO: better default value in 1.16.0 extension_map = self.EXTENSION_MAP
extension_map = {}
self.extension_map = extension_map.get self.extension_map = extension_map.get
try: try:

View File

@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as # it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation. # published by the Free Software Foundation.
__version__ = "1.15.3" __version__ = "1.16.0-dev"