diff --git a/CHANGELOG.md b/CHANGELOG.md index a2b51092..847ce7f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## Unreleased + ## 1.10.3 - 2019-08-30 ### Additions - Provide `filename` metadata for all `deviantart` files ([#392](https://github.com/mikf/gallery-dl/issues/392), [#400](https://github.com/mikf/gallery-dl/issues/400)) diff --git a/docs/configuration.rst b/docs/configuration.rst index d69406d6..e384f2c0 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -486,6 +486,18 @@ Description Try to follow external URLs of embedded players. =========== ===== +extractor.danbooru.ugoira +------------------------- +=========== ===== +Type ``bool`` +Default ``true`` +Description Controls the download target for Ugoira posts. + + * ``true``: Original ZIP archives + * ``false``: Converted video files +=========== ===== + + extractor.deviantart.extra -------------------------- =========== ===== diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 64394374..eff6da1b 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -19,7 +19,8 @@ "danbooru": { "username": null, - "password": null + "password": null, + "ugoira": true }, "deviantart": { diff --git a/gallery_dl/extractor/booru.py b/gallery_dl/extractor/booru.py index 54a88787..ac45e0bc 100644 --- a/gallery_dl/extractor/booru.py +++ b/gallery_dl/extractor/booru.py @@ -27,6 +27,7 @@ class BooruExtractor(SharedConfigMixin, Extractor): page_start = 1 page_limit = None sort = False + ugoira = True def __init__(self, match): super().__init__(match) @@ -51,7 +52,11 @@ class BooruExtractor(SharedConfigMixin, Extractor): for image in images: try: - url = image["file_url"] + if "pixiv_ugoira_frame_data" in image and \ + "large_file_url" in image and not self.ugoira: + url = image["large_file_url"] + else: + url = image["file_url"] except KeyError: continue if url.startswith("/"): diff --git a/gallery_dl/extractor/danbooru.py b/gallery_dl/extractor/danbooru.py index 211c340e..e8d3abf9 100644 --- a/gallery_dl/extractor/danbooru.py +++ b/gallery_dl/extractor/danbooru.py @@ -28,6 +28,7 @@ class DanbooruExtractor(booru.DanbooruPageMixin, booru.BooruExtractor): self.scheme = "https" if self.subdomain == "danbooru" else "http" self.api_url = "{scheme}://{subdomain}.donmai.us/posts.json".format( scheme=self.scheme, subdomain=self.subdomain) + self.ugoira = self.config("ugoira", True) username, api_key = self._get_auth_info() if username: @@ -63,9 +64,15 @@ class DanbooruPoolExtractor(booru.PoolMixin, DanbooruExtractor): class DanbooruPostExtractor(booru.PostMixin, DanbooruExtractor): """Extractor for single images from danbooru""" pattern = BASE_PATTERN + r"/posts/(?P\d+)" - test = ("https://danbooru.donmai.us/posts/294929", { - "content": "5e255713cbf0a8e0801dc423563c34d896bb9229", - }) + test = ( + ("https://danbooru.donmai.us/posts/294929", { + "content": "5e255713cbf0a8e0801dc423563c34d896bb9229", + }), + ("https://danbooru.donmai.us/posts/3613024", { + "pattern": r"https?://.+\.webm$", + "options": (("ugoira", False),) + }) + ) class DanbooruPopularExtractor(booru.PopularMixin, DanbooruExtractor): diff --git a/gallery_dl/version.py b/gallery_dl/version.py index cbb8fe79..5a94858a 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.10.3" +__version__ = "1.10.4-dev"