From 52d9f38793078e1c86236bfb463fc85d8fe1af2a Mon Sep 17 00:00:00 2001 From: Typhonragewind Date: Tue, 13 Jun 2023 22:46:23 +0100 Subject: [PATCH] Add Comics (#269) * add DarkLegacy comic * add Awaken comic * add Vibe comic * add SwordComic comic --- dosagelib/plugins/a.py | 16 ++++++++++++---- dosagelib/plugins/c.py | 2 +- dosagelib/plugins/d.py | 14 +++++++++++++- dosagelib/plugins/s.py | 9 +++++++++ dosagelib/plugins/v.py | 13 +++++++++++++ 5 files changed, 48 insertions(+), 6 deletions(-) diff --git a/dosagelib/plugins/a.py b/dosagelib/plugins/a.py index 283c48858..32a5b42ce 100644 --- a/dosagelib/plugins/a.py +++ b/dosagelib/plugins/a.py @@ -377,13 +377,21 @@ class ATaleOfTails(WordPressScraper): adult = True -class AwkwardZombie(BasicScraper): +class Awaken(ParserScraper): + url = "https://www.awakencomic.com/" + stripUrl = url + 'comic/%s' + firstStripUrl = stripUrl % 'comic-cover' + imageSearch = '//div[@id="cc-comicbody"]//img' + prevSearch = '//a[@rel="prev"]' + help = 'Index format: chapter-n-page-n (unpadded)' + + +class AwkwardZombie(ParserScraper): url = 'https://www.awkwardzombie.com/' - rurl = escape(url) stripUrl = url + 'awkward-zombie/%s' firstStripUrl = stripUrl % 'coin-battle' - imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl)) - prevSearch = compile(tagre("a", "href", r'(%sawkward-zombie/[a-zA-Z-]+)' % rurl, before="prev")) + imageSearch = '//div[@id="cc-comicbody"]//img' + prevSearch = '//a[@rel="prev"]' help = 'Index format: variable :(' diff --git a/dosagelib/plugins/c.py b/dosagelib/plugins/c.py index c731f375c..ababfcb93 100644 --- a/dosagelib/plugins/c.py +++ b/dosagelib/plugins/c.py @@ -6,7 +6,7 @@ from re import compile, escape from typing import List -from ..scraper import _BasicScraper, _ParserScraper +from ..scraper import _BasicScraper, _ParserScraper, ParserScraper from ..helpers import bounceStarter, indirectStarter, joinPathPartsNamer from ..util import tagre from .common import WordPressScraper, WordPressNavi, WordPressWebcomic diff --git a/dosagelib/plugins/d.py b/dosagelib/plugins/d.py index fd53b440f..f7a2e1933 100644 --- a/dosagelib/plugins/d.py +++ b/dosagelib/plugins/d.py @@ -5,7 +5,7 @@ # Copyright (C) 2019-2020 Daniel Ring from re import compile, escape -from ..scraper import _BasicScraper, _ParserScraper +from ..scraper import _BasicScraper, _ParserScraper, ParserScraper from ..helpers import indirectStarter, bounceStarter from ..util import tagre from .common import (ComicControlScraper, WordPressScraper, WordPressNavi, @@ -27,6 +27,18 @@ class DangerouslyChloe(ComicControlScraper): firstStripUrl = url + 'strips-dc/Chapter_1_-_That_damned_girl' +class DarkLegacy(ParserScraper): + starter = indirectStarter + url = "https://www.darklegacycomics.com" + stripUrl = url + '%s' + firstStripUrl = stripUrl % '1' + imageSearch = '//div[@class="comic narrow"]//img' + prevSearch = ('//a[@title="Previous - A"]', + '//a[@title="Previous"]') + latestSearch = '//div[@class="comic narrow feed"]//a' + help = 'Index format: n (unpadded)' + + class DarkWhite(WordPressScraper): url = 'https://www.darkwhitecomic.com/' stripUrl = url + 'comic/%s/' diff --git a/dosagelib/plugins/s.py b/dosagelib/plugins/s.py index b1516b16e..0f8e3f305 100644 --- a/dosagelib/plugins/s.py +++ b/dosagelib/plugins/s.py @@ -709,3 +709,12 @@ class SwordsAndSausages(_ParserScraper): imageSearch = '//img[d:class("comic-image")]' prevSearch = '//a[./span[contains(text(), "Previous")]]' multipleImagesPerStrip = True + + +class SwordsComic(ParserScraper): + url = 'https://swordscomic.com/' + stripUrl = url + 'comic/%s' + firstStripUrl = stripUrl % 'cover' + imageSearch = '//div[@class="page-image-wrapper"]//img' + prevSearch = '//a[@class="navigation-button navigation-previous"]' + help = 'Index format: Swordsnnn (unpadded)' \ No newline at end of file diff --git a/dosagelib/plugins/v.py b/dosagelib/plugins/v.py index cc0e1777b..33e26b317 100644 --- a/dosagelib/plugins/v.py +++ b/dosagelib/plugins/v.py @@ -3,6 +3,7 @@ # Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2015-2020 Tobias Gruetzmacher # Copyright (C) 2019-2020 Daniel Ring + from ..scraper import ParserScraper, _ParserScraper from ..helpers import bounceStarter, indirectStarter @@ -31,6 +32,18 @@ class VGCats(_ParserScraper): help = 'Index format: n (unpadded)' +class Vibe(ParserScraper): + starter = indirectStarter + url = 'http://www.vibecomic.com/vibe/' + stripUrl = url + '%s' + firstStripUrl = stripUrl % '' + imageSearch = '//div[@id="cc-comicbody"]//img' + prevSearch = '//a[@rel="prev"]' + nextSearch = '//a[@rel="next"]' + latestSearch = '//a[@class="last"]' + help = 'Index format: VIBEnnn (padded)' + + class VickiFox(_ParserScraper): url = 'http://www.vickifox.com/comic/strip' stripUrl = url + '?id=%s'