From de3b396d117f7cdc983ea130e116d3a49d3fbb95 Mon Sep 17 00:00:00 2001 From: Techwolf Date: Wed, 20 May 2020 23:08:43 -0700 Subject: [PATCH] Add RayFox --- dosagelib/plugins/r.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/dosagelib/plugins/r.py b/dosagelib/plugins/r.py index e74830e4f..a883352d5 100644 --- a/dosagelib/plugins/r.py +++ b/dosagelib/plugins/r.py @@ -9,13 +9,36 @@ from urllib.parse import urljoin from ..helpers import bounceStarter from ..scraper import _BasicScraper, _ParserScraper from ..util import tagre -from .common import _WordPressScraper, _WPWebcomic +from .common import _WordPressScraper, _WPNavi, _WPWebcomic class RalfTheDestroyer(_WordPressScraper): url = 'http://ralfthedestroyer.com/' +class RayFox(_WPNavi): + url = 'https://www.rayfoxthecomic.com/' + stripUrl = url + 'comic/%s/' + firstStripUrl = stripUrl % 'not-a-super-hero/it-begins' + + def namer(self, imageUrl, pageUrl): + filename = imageUrl.rsplit('/', 1)[-1].split('.', 1)[0] + ext = imageUrl.rsplit('.', 1)[-1] + if filename == 'j': + filename = 'RF_E3_P52' + elif filename == '46' or filename == '55' or filename == '61': + filename = 'RF_E3_P' + filename + elif 'chapter-3-cover' in filename: + filename = 'RF_E3_Cover' + elif 'Cover2' in filename: + filename = 'RF_E1_' + filename + elif 'Volume-1-Cover' in filename: + filename = filename.replace('Ray-Fox-Volume-1-', 'RF_E1_') + elif filename[0] == '0': + filename = 'RF_E1_P' + filename + return filename + '.' + ext + + class RaynaOnTheRiver(_WordPressScraper): url = 'http://www.catomix.com/rayna/' firstStripUrl = url + 'archives/comic/teaser-poster'