From 9cca10b0b7b6801509d08e93202162ca2999cfa4 Mon Sep 17 00:00:00 2001 From: Techwolf Date: Fri, 5 Jul 2019 22:24:07 -0700 Subject: [PATCH] Add Ryugou --- dosagelib/plugins/r.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dosagelib/plugins/r.py b/dosagelib/plugins/r.py index ad315ce5c..56149f8e0 100644 --- a/dosagelib/plugins/r.py +++ b/dosagelib/plugins/r.py @@ -136,3 +136,24 @@ class Ruthe(_BasicScraper): prevSearch = compile(tagre("a", "href", r'(/cartoon/\d+/datum/asc/)') + 'vorheriger') help = 'Index format: number' + + +class Ryugou(_ParserScraper): + url = 'http://ryugou.swashbuckledcomics.com/' + stripUrl = url + 'comic/%s/' + firstStripUrl = 'ryugou-chapter-1-cover' + imageSearch = '//div[@class="webcomic-image"]//img' + prevSearch = '//a[contains(@class, "previous-webcomic-link")]' + nextSearch = '//a[contains(@class, "next-webcomic-link")]' + starter = bounceStarter + + def namer(self, imageUrl, pageUrl): + title = pageUrl.rstrip('/').rsplit('/', 1)[-1] + ext = imageUrl.rsplit('.', 1)[-1] + return title + '.' + ext + + def fetchUrls(self, url, data, urlSearch): + imageUrls = super(Ryugou, self).fetchUrls(url, data, urlSearch) + if url == self.stripUrl % '1-3': + imageUrls = [imageUrls[1]] + return imageUrls