From 561646c9c4668e6c6cdbe88dc57f2582a2d56c8b Mon Sep 17 00:00:00 2001 From: Techwolf Date: Sat, 13 Jul 2019 02:15:14 -0700 Subject: [PATCH] Add Delve --- dosagelib/plugins/d.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dosagelib/plugins/d.py b/dosagelib/plugins/d.py index 6e70d54dd..7e03a6432 100644 --- a/dosagelib/plugins/d.py +++ b/dosagelib/plugins/d.py @@ -95,6 +95,26 @@ class DeepFried(_BasicScraper): help = 'Index format: none' +class Delve(_WordPressScraper): + url = 'http://thisis.delvecomic.com/NewWP/' + stripUrl = url + 'comic/%s/' + firstStripUrl = stripUrl % 'in-too-deep' + adult = True + maxLen = len('episode999') + + def namer(self, imageUrl, pageUrl): + # Fix inconsistent filenames + filename = imageUrl.rsplit('/', 1)[-1].rsplit('?', 1)[0] + if (pageUrl == self.stripUrl % 'engagement' or + pageUrl == self.stripUrl % 'losing-it'): + self.maxLen = self.maxLen - 1 + if ('episode' in filename and + len(filename) - len('.jpg') > self.maxLen and + filename[self.maxLen] != '-'): + filename = filename[:self.maxLen] + '-' + filename[self.maxLen:] + return filename + + class DemolitionSquad(_ParserScraper): url = 'http://www.demolitionsquad.de/' stripUrl = url + '?comicbeitrag=%s'