From 4a783c11eca5d2947df095fc77d0a1cd75cf3136 Mon Sep 17 00:00:00 2001 From: Techwolf Date: Thu, 20 Jun 2019 23:51:39 -0700 Subject: [PATCH] Add NotAVillain --- dosagelib/plugins/n.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dosagelib/plugins/n.py b/dosagelib/plugins/n.py index 94838e23a..e35911e99 100644 --- a/dosagelib/plugins/n.py +++ b/dosagelib/plugins/n.py @@ -131,6 +131,25 @@ class NoNeedForBushido(_ParserScraper): help = 'Index format: nnn' +class NotAVillain(_ParserScraper): + url = 'http://navcomic.com/' + stripUrl = url + 'not-a-villain/%s/' + firstStripUrl = stripUrl % 'v1-001' + imageSearch = '//div[@class="webcomic-image"]//img' + prevSearch = '//a[contains(@class, "previous-webcomic-link")]' + + def namer(self, imageUrl, pageUrl): + filename = imageUrl.rsplit('/', 1)[-1] + # Fix filenames missing "Page" + if filename[2].isdigit(): + filename = filename[0] + '-Page' + filename[2:] + # Fix filenames of early comics + filename = filename.replace('Page-', '1-Page') + if filename.startswith('0-Page'): + filename = '1' + filename[1:] + return filename + + class NotInventedHere(_ParserScraper): url = 'http://notinventedhe.re/' stripUrl = url + 'on/%s'