From 01bc7adadc7d8dc9dd45eb0ada1ca4d31f7ba240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 14 Sep 2019 22:31:57 +0200 Subject: [PATCH] [deviantart] improve journal detection (#419) Some journal-like posts are not reported to be journals (isJournal is set to False), even though they have a textContent field. https://www.deviantart.com/gliitchlord/art/brashstrokes-812942668 --- gallery_dl/extractor/deviantart.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index 69bb26cd..27eb47ef 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -620,7 +620,7 @@ class DeviantartExtractorV2(DeviantartExtractor): # extract download target target = files[-1] - if deviation["isJournal"] and self.commit_journal: + if "textContent" in deviation and self.commit_journal: journal = deviation["textContent"] journal["html"] = journal["html"]["markup"] target["src"] = self.commit_journal(deviation, journal)[1] @@ -729,6 +729,16 @@ class DeviantartDeviationExtractor(DeviantartExtractorV2): ("https://www.deviantart.com/ikatxfruti/art/Bang-Bang-528130222", { "pattern": r"https://images-wixmp-.*wixmp.com/f/.*\.swf", }), + # journal + ("https://www.deviantart.com/shimoda7/journal/ARTility-583755752", { + "url": "f33f8127ab71819be7de849175b6d5f8b37bb629", + "pattern": "text:\n", + }), + # journal-like post with isJournal == False (#419) + ("https://www.deviantart.com/gliitchlord/art/brashstrokes-812942668", { + "url": "1534d6ea0561247ab921d07505e57a9d663a833b", + "pattern": "text:\n", + }), # old-style URLs ("https://shimoda7.deviantart.com" "/art/For-the-sake-of-a-memory-10073852"),