Skip to content

Commit

Permalink
Fix some more comic modules
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiX committed Feb 14, 2024
1 parent aa50afd commit ea2bad5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 66 deletions.
90 changes: 24 additions & 66 deletions dosagelib/plugins/m.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-FileCopyrightText: © 2015 Tobias Gruetzmacher
# SPDX-FileCopyrightText: © 2019 Daniel Ring
import json
from re import compile, escape, IGNORECASE
from re import compile, IGNORECASE

from ..helpers import indirectStarter
from ..scraper import ParserScraper, _BasicScraper, _ParserScraper
Expand All @@ -13,13 +13,10 @@
from .common import ComicControlScraper, WordPressScraper, WordPressWebcomic


class MacHall(_BasicScraper):
url = 'http://www.machall.com/'
stripUrl = url + 'view.php?date=%s'
firstStripUrl = stripUrl % '2000-11-07'
imageSearch = compile(r'<img src="(comics/.+?)"')
prevSearch = compile(r'<a href="(.+?)"><img[^>]+?src=\'drop_shadow/previous.gif\'>')
help = 'Index format: yyyy-mm-dd'
class MacHall(ComicControlScraper):
url = 'https://www.machall.com/'
stripUrl = url + 'comic/%s'
firstStripUrl = stripUrl % 'moving-in'


class MadamAndEve(_BasicScraper):
Expand Down Expand Up @@ -58,12 +55,12 @@ class MareInternum(WordPressScraper):
firstStripUrl = stripUrl % 'intro-page-1'


class Marilith(_BasicScraper):
url = 'http://www.marilith.com/'
class Marilith(ParserScraper):
url = 'https://web.archive.org/web/20170619193143/http://www.marilith.com/'
stripUrl = url + 'archive.php?date=%s'
firstStripUrl = stripUrl % '20041215'
imageSearch = compile(r'<img src="(comics/.+?)" border')
prevSearch = compile(r'<a href="(archive\.php\?date=.+?)"><img border=0 name=previous_day')
imageSearch = '//img[contains(@src, "comics/")]'
prevSearch = '//a[img[@name="previous_day"]]'
help = 'Index format: yyyymmdd'


Expand All @@ -80,22 +77,14 @@ def namer(self, image_url, page_url):
return '%s-%s' % (date, filename)


class MarryMe(_ParserScraper):
url = 'http://marryme.keenspot.com/'
stripUrl = url + 'd/%s.html'
class MarryMe(ParserScraper):
stripUrl = 'http://marryme.keenspot.com/d/%s.html'
url = stripUrl % '20191001'
firstStripUrl = stripUrl % '20120730'
imageSearch = '//img[@class="ksc"]'
prevSearch = '//a[@rel="prev"]'
endOfLife = True


class MaxOveracts(_ParserScraper):
url = 'http://occasionalcomics.com/'
stripUrl = url + '%s/'
css = True
imageSearch = '#comic img'
prevSearch = '.nav-previous > a'
help = 'Index format: nnn'
help = 'Index format: yyyymmdd'


class Meek(WordPressScraper):
Expand Down Expand Up @@ -149,16 +138,18 @@ class MisfileHellHigh(Misfile):
help = 'Index format: yyyy-mm-dd'


class MistyTheMouse(WordPressScraper):
class MistyTheMouse(ParserScraper):
url = 'http://www.mistythemouse.com/'
prevSearch = '//a[@rel="prev"]'
firstStripUrl = 'http://www.mistythemouse.com/?p=12'
imageSearch = '//center/p/img'
prevSearch = '//a[img[contains(@src, "Previous")]]'
firstStripUrl = url + 'The_Live_In.html'


class MonkeyUser(_ParserScraper):
class MonkeyUser(ParserScraper):
url = 'https://www.monkeyuser.com/'
prevSearch = '//div[@title="previous"]/a'
imageSearch = '//div[d:class("content")]/p/img'
prevSearch = '//a[text()="Prev"]'
multipleImagesPerStrip = True

def shouldSkipUrl(self, url, data):
# videos
Expand Down Expand Up @@ -195,43 +186,10 @@ def starter(self):
return indirectStarter(self)


class Moonsticks(_ParserScraper):
url = "http://moonsticks.org/"
imageSearch = "//div[@class='entry']//img"
prevSearch = u"//a[text()='\u00AB Prev']"


class MrLovenstein(_BasicScraper):
url = 'http://www.mrlovenstein.com/'
stripUrl = url + 'comic/%s'
firstStripUrl = stripUrl % '1'
imageSearch = (
# captures rollover comic
compile(tagre("div", "class", r'comic_image') + r'\s*.*\s*' +
tagre("div", "style", r'display: none;') + r'\s*.*\s' +
tagre("img", "src", r'(/images/comics/[^"]+)')),
# captures standard comic
compile(tagre("img", "src", r'(/images/comics/[^"]+)',
before="comic_main_image")),
)
prevSearch = compile(tagre("a", "href", r'([^"]+)') +
tagre("img", "src", "/images/nav_left.png"))
textSearch = compile(r'<meta name="description" content="(.+?)" />')
help = 'Index Format: n'


class MyCartoons(_BasicScraper):
url = 'http://mycartoons.de/'
rurl = escape(url)
stripUrl = url + 'page/%s'
imageSearch = (
compile(tagre("img", "src", r'(%swp-content/cartoons/(?:[^"]+/)?\d+-\d+-\d+[^"]+)' % rurl)),
compile(tagre("img", "src", r'(%scartoons/[^"]+/\d+-\d+-\d+[^"]+)' % rurl)),
)
prevSearch = compile(tagre("a", "href", r'(%spage/[^"]+)' % rurl) +
"&laquo;")
help = 'Index format: number'
lang = 'de'
class Moonsticks(ParserScraper):
url = "https://moonsticks.org/"
imageSearch = "//div[d:class('entry-content')]//img"
prevSearch = ('//a[@rel="prev"]', "//a[text()='\u00AB Prev']")


class MyLifeWithFel(ParserScraper):
Expand Down
6 changes: 6 additions & 0 deletions dosagelib/plugins/o.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
from .common import WordPressScraper, WordPressNavi


class OccasionalComicsDisorder(WordPressScraper):
url = 'https://occasionalcomics.com/'
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % 'latest-comic-2'


class OctopusPie(_ParserScraper):
url = 'http://www.octopuspie.com/'
rurl = escape(url)
Expand Down
3 changes: 3 additions & 0 deletions dosagelib/plugins/old.py
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,8 @@ def getmodules(cls): # noqa: CFQ001
cls('KemonoCafe/PrincessBunny'),
cls('Lackadaisy', 'block'),
cls('MangaDex/ImTheMaxLevelNewbie', 'legal'),
cls('MrLovenstein', 'jsh'),
cls('MyCartoons'),
cls('StudioKhimera/Mousechevious'),
cls('TalesAndTactics'),
cls('VampireHunterBoyfriends'),
Expand Down Expand Up @@ -1716,5 +1718,6 @@ def getmodules(cls):

# Renamed in 3.1
cls('Exiern', 'ComicFury/Exiern'),
cls('MaxOveracts', 'OccasionalComicsDisorder'),
cls('SafelyEndangered', 'WebToons/SafelyEndangered'),
)

0 comments on commit ea2bad5

Please sign in to comment.