# -*- coding: utf-8 -*- # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2015-2020 Tobias Gruetzmacher from __future__ import absolute_import, division, print_function from re import compile from six.moves.urllib.parse import urljoin from ..helpers import bounceStarter, xpath_class from ..scraper import _BasicScraper, _ParserScraper from ..util import tagre from .common import _WordPressScraper class RadioactivePanda(_BasicScraper): url = 'http://www.radioactivepanda.com/' stripUrl = url + 'comic/%s' imageSearch = compile(r' 2 and self.chapter == 1 and name != 'through-the-woods': page[0] = page[0][:2] + '-' + page[0][2:] name = '%d-%s-%s.%s' % (self.chapter, page[0], name, page[1]) if pageUrl in self.startOfChapter: self.chapter -= 1 return name class RiversideExtras(_ParserScraper): url = 'https://riversidecomics.com/' imageSearch = '//div[{}]//img'.format(xpath_class('webcomic-image')) prevSearch = '//a[{}]'.format(xpath_class('previous-webcomic-link')) class RomanticallyApocalyptic(_ParserScraper): url = 'http://romanticallyapocalyptic.com/' stripUrl = url + '%s' firstStripUrl = stripUrl % '0' imageSearch = '//div[%s]/center//img' % xpath_class('comicpanel') prevSearch = '//a[@accesskey="p"]' help = 'Index format: n' adult = True class Roza(_ParserScraper): url = 'http://www.junglestudio.com/roza/index.php' stripUrl = url + '?date=%s' firstStripUrl = stripUrl % '2007-05-01' imageSearch = '//img[contains(@src, "pages/")]' prevSearch = '//a[img[contains(@src, "navtable_01.gif")]]' help = 'Index format: yyyy-mm-dd' class Ruthe(_BasicScraper): url = 'http://ruthe.de/' stripUrl = url + 'cartoon/%s/datum/asc/' firstStripUrl = stripUrl % '1' lang = 'de' imageSearch = compile(tagre("img", "src", r'(/?cartoons/strip_\d+[^"]+)')) 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