Skip to content

Commit

Permalink
[deviantart] add 'intermediary' option (#4955)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Dec 21, 2023
1 parent 75fa1a5 commit fbebc58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,17 @@ Description
It is possible to use ``"all"`` instead of listing all values separately.


extractor.deviantart.intermediary
---------------------------------
Type
``bool``
Default
``true``
Description
For older non-downloadable images,
download a higher-quality ``/intermediary/`` version.


extractor.deviantart.journals
-----------------------------
Type
Expand Down
3 changes: 2 additions & 1 deletion gallery_dl/extractor/deviantart.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def _init(self):
self.quality = self.config("quality", "100")
self.original = self.config("original", True)
self.comments = self.config("comments", False)
self.intermediary = self.config("intermediary", True)

self.api = DeviantartOAuthAPI(self)
self.group = False
Expand Down Expand Up @@ -136,7 +137,7 @@ def items(self):
elif self.jwt:
self._update_token(deviation, content)
elif content["src"].startswith("https://images-wixmp-"):
if deviation["index"] <= 790677560:
if self.intermediary and deviation["index"] <= 790677560:
# https://github.com/r888888888/danbooru/issues/4069
intermediary, count = re.subn(
r"(/f/[^/]+/[^/]+)/v\d+/.*",
Expand Down

0 comments on commit fbebc58

Please sign in to comment.