dosage/dosagelib/plugins/m.py

238 lines
7 KiB
Python
Raw Normal View History

# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: © 2004 Tristan Seligmann and Jonathan Jacobs
# SPDX-FileCopyrightText: © 2012 Bastian Kleineidam
# SPDX-FileCopyrightText: © 2015 Tobias Gruetzmacher
# SPDX-FileCopyrightText: © 2019 Daniel Ring
2019-08-03 07:52:24 +00:00
import json
2024-02-14 23:50:33 +00:00
from re import compile, IGNORECASE
2012-06-20 19:58:13 +00:00
from ..helpers import indirectStarter
from ..scraper import ParserScraper, _BasicScraper, _ParserScraper
from ..util import tagre
from .common import ComicControlScraper, WordPressScraper, WordPressWebcomic
2012-06-20 19:58:13 +00:00
2024-02-14 23:50:33 +00:00
class MacHall(ComicControlScraper):
url = 'https://www.machall.com/'
stripUrl = url + 'comic/%s'
firstStripUrl = stripUrl % 'moving-in'
2013-04-10 21:57:09 +00:00
2013-04-25 19:09:42 +00:00
class MadamAndEve(_BasicScraper):
url = 'http://www.madamandeve.co.za/'
stripUrl = None
imageSearch = compile(tagre('img', 'src', r'(/cartoons/me\d{6}\.(gif|jpg))'))
2013-04-25 19:09:42 +00:00
multipleImagesPerStrip = True
2012-06-20 19:58:13 +00:00
2015-04-29 15:36:12 +00:00
class Magellan(WordPressScraper):
2022-05-27 17:38:31 +00:00
url = 'https://magellanverse.com/'
firstStripUrl = url + 'comic/20040307wannabe/'
2012-06-20 19:58:13 +00:00
class MagickChicks(ComicControlScraper):
url = 'https://pixietrixcomix.com/magick-chicks/'
stripUrl = url + '%s'
firstStripUrl = stripUrl % 'tis-but-a-trifle-2'
help = 'Index format: name'
endOfLife = True
2015-04-26 11:47:38 +00:00
class ManlyGuysDoingManlyThings(_ParserScraper):
2013-02-13 16:52:49 +00:00
url = 'http://thepunchlineismachismo.com/'
stripUrl = url + 'archives/comic/%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '02222010'
2015-04-26 11:47:38 +00:00
css = True
imageSearch = "#comic img"
prevSearch = ".comic-nav-previous"
2013-02-13 16:52:49 +00:00
help = 'Index format: ddmmyyyy'
class MareInternum(WordPressScraper):
2019-07-13 06:37:43 +00:00
url = 'https://www.marecomic.com/'
2016-04-29 23:59:28 +00:00
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % 'intro-page-1'
2015-04-29 15:36:12 +00:00
2024-02-14 23:50:33 +00:00
class Marilith(ParserScraper):
url = 'https://web.archive.org/web/20170619193143/http://www.marilith.com/'
stripUrl = url + 'archive.php?date=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '20041215'
2024-02-14 23:50:33 +00:00
imageSearch = '//img[contains(@src, "comics/")]'
prevSearch = '//a[img[@name="previous_day"]]'
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyymmdd'
2017-02-12 01:16:38 +00:00
class MarriedToTheSea(_ParserScraper):
2017-02-12 19:15:25 +00:00
url = 'http://marriedtothesea.com/'
2013-07-18 18:39:53 +00:00
stripUrl = url + '%s'
2013-07-10 16:43:53 +00:00
firstStripUrl = stripUrl % '022806'
imageSearch = '//div[d:class("jumbotron")]//p/img'
2017-02-12 01:16:38 +00:00
prevSearch = '//a[contains(text(), "Yesterday")]'
2013-07-10 16:43:53 +00:00
help = 'Index format: mmddyy'
def namer(self, image_url, page_url):
unused, date, filename = image_url.rsplit('/', 2)
2013-07-10 16:43:53 +00:00
return '%s-%s' % (date, filename)
2024-02-14 23:50:33 +00:00
class MarryMe(ParserScraper):
stripUrl = 'http://marryme.keenspot.com/d/%s.html'
url = stripUrl % '20191001'
2021-02-02 09:55:04 +00:00
firstStripUrl = stripUrl % '20120730'
imageSearch = '//img[@class="ksc"]'
prevSearch = '//a[@rel="prev"]'
endOfLife = True
2024-02-14 23:50:33 +00:00
help = 'Index format: yyyymmdd'
2013-07-10 16:43:53 +00:00
2012-06-20 19:58:13 +00:00
class Meek(WordPressScraper):
2019-12-30 10:12:53 +00:00
url = 'https://www.meekcomic.com/'
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % 'chapter-1-cover'
2012-06-20 19:58:13 +00:00
class MegaTokyo(_BasicScraper):
url = 'https://megatokyo.com/'
stripUrl = url + 'strip/%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '1'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'"(strips/.+?)"', IGNORECASE)
prevSearch = compile(r'"(./strip/\d+?)">Prev')
help = 'Index format: nnnn'
class Meiosis(WordPressScraper):
url = 'http://meiosiswebcomic.com/'
class Melonpool(WordPressScraper):
url = 'http://www.melonpool.com/'
2017-04-15 23:06:41 +00:00
allow_errors = (500,)
class MenageA3(ComicControlScraper):
adult = True
2022-05-27 17:30:27 +00:00
url = 'https://pixietrixcomix.com/menage-a-3/'
firstStripUrl = url + 'for-new-readers'
endOfLife = True
2018-04-21 00:25:55 +00:00
class Metacarpolis(ComicControlScraper):
url = 'http://www.metacarpolis.com'
class Misfile(ComicControlScraper):
2019-07-03 04:43:45 +00:00
url = 'http://www.misfile.com/misfile/'
stripUrl = url + '%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '2004-02-22'
2019-07-03 04:43:45 +00:00
endOfLife = True
help = 'Index format: yyyy-mm-dd'
class MisfileHellHigh(Misfile):
name = 'Misfile/HellHigh'
url = 'http://www.misfile.com/hell-high/'
stripUrl = url + '%s'
firstStripUrl = stripUrl % '2019-08-29'
2012-11-21 20:57:26 +00:00
help = 'Index format: yyyy-mm-dd'
2012-06-20 19:58:13 +00:00
2024-02-14 23:50:33 +00:00
class MistyTheMouse(ParserScraper):
url = 'http://www.mistythemouse.com/'
2024-02-14 23:50:33 +00:00
imageSearch = '//center/p/img'
prevSearch = '//a[img[contains(@src, "Previous")]]'
firstStripUrl = url + 'The_Live_In.html'
2024-02-14 23:50:33 +00:00
class MonkeyUser(ParserScraper):
2018-08-28 10:13:48 +00:00
url = 'https://www.monkeyuser.com/'
2021-01-31 23:29:36 +00:00
imageSearch = '//div[d:class("content")]/p/img'
2024-02-14 23:50:33 +00:00
prevSearch = '//a[text()="Prev"]'
multipleImagesPerStrip = True
2021-01-31 23:29:36 +00:00
def shouldSkipUrl(self, url, data):
# videos
2024-03-17 20:44:46 +00:00
return self.match(data, '//div[d:class("video-container")]')
2018-08-28 10:13:48 +00:00
class MonsieurLeChien(ParserScraper):
url = ('https://web.archive.org/web/20210311002403/'
'http:/www.monsieur-le-chien.fr/')
2014-02-27 16:45:29 +00:00
stripUrl = url + 'index.php?planche=%s'
firstStripUrl = stripUrl % '2'
2014-02-27 21:30:02 +00:00
lang = 'fr'
imageSearch = '//img[contains(@src,"i/planches/")]'
prevSearch = '//a[img[contains(@src,"i/precedent.gif")]]'
endOfLife = True
2014-02-27 16:45:29 +00:00
help = 'Index format: n'
class MonsterSoup(WordPressScraper):
2021-11-08 09:03:13 +00:00
url = 'https://monstersoupcomic.com/'
stripUrl = url + '?comic=%s'
firstStripUrl = stripUrl % 'chapter-1-cover'
class Moonlace(WordPressWebcomic):
2021-01-21 04:19:59 +00:00
url = 'https://moonlace.darkbluecomics.com/'
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % 'page-0-1'
2019-06-29 21:39:13 +00:00
adult = True
def starter(self):
# Set age-gate cookie
2021-01-21 04:19:59 +00:00
self.session.cookies.set('age_gate', '1', domain='moonlace.darkblueworkshop.com')
2019-06-29 21:39:13 +00:00
return indirectStarter(self)
2024-02-14 23:50:33 +00:00
class Moonsticks(ParserScraper):
url = "https://moonsticks.org/"
imageSearch = "//div[d:class('entry-content')]//img"
prevSearch = ('//a[@rel="prev"]', "//a[text()='\u00AB Prev']")
2013-03-20 20:42:04 +00:00
class MyLifeWithFel(ParserScraper):
2019-08-03 07:52:24 +00:00
baseUrl = 'https://www.mylifewithfel.com/'
stripUrl = baseUrl + 'api/posts/%s'
firstStripUrl = stripUrl % '1'
url = firstStripUrl
adult = True
def starter(self):
# Retrieve comic metadata from API
data = self.session.get(self.url)
data.raise_for_status()
return self.stripUrl % data.json()['last']['id']
def getPrevUrl(self, url, data):
return self.stripUrl % json.loads(data.text_content())['previous']['id']
def extract_image_urls(self, url, data):
2019-08-03 07:52:24 +00:00
return [self.baseUrl + json.loads(data.text_content())['post']['image']]
def namer(self, imageUrl, pageUrl):
return pageUrl.rsplit('/', 1)[-1]
2019-07-11 04:56:32 +00:00
class MynarskiForest(_ParserScraper):
stripUrl = 'http://mynarskiforest.purrsia.com/xsl%s.htm'
url = stripUrl % '09_36'
firstStripUrl = stripUrl % '97_01'
imageSearch = '//img[not(contains(@src, "arrow"))]'
prevSearch = '//a[./img[contains(@src, "arrowbk")]]'
multipleImagesPerStrip = True
endOfLife = True
2015-05-31 11:39:04 +00:00
class MysteriesOfTheArcana(_ParserScraper):
url = 'http://mysteriesofthearcana.com/'
2015-05-31 11:39:04 +00:00
imageSearch = '//div[@id="comic"]//img'
prevSearch = '//a[@class="navprevious"]'
2017-02-12 01:16:38 +00:00
class MonsterUnderTheBed(WordPressScraper):
2017-02-12 01:16:38 +00:00
url = 'http://themonsterunderthebed.net/'
2019-12-17 06:38:36 +00:00
stripUrl = url + '?comic=%s'
firstStripUrl = stripUrl % 'test-post'
adult = True