2020-04-18 11:45:44 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2016-10-28 22:21:41 +00:00
|
|
|
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
|
2014-01-05 15:50:57 +00:00
|
|
|
# Copyright (C) 2012-2014 Bastian Kleineidam
|
2022-06-06 10:08:32 +00:00
|
|
|
# Copyright (C) 2015-2022 Tobias Gruetzmacher
|
2020-01-13 06:34:05 +00:00
|
|
|
# Copyright (C) 2019-2020 Daniel Ring
|
2016-11-01 01:27:29 +00:00
|
|
|
import re
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
from ..scraper import ParserScraper
|
2016-04-12 23:24:13 +00:00
|
|
|
from ..helpers import bounceStarter
|
2012-11-26 06:13:32 +00:00
|
|
|
|
2012-11-28 17:15:12 +00:00
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class WLPComics(ParserScraper):
|
2020-04-06 11:23:23 +00:00
|
|
|
imageSearch = '//img[contains(@alt, " Comic")]'
|
2016-04-10 23:07:21 +00:00
|
|
|
prevSearch = '//a[contains(text(), "Previous ")]'
|
|
|
|
nextSearch = '//a[contains(text(), "Next ")]'
|
2016-04-13 18:01:51 +00:00
|
|
|
starter = bounceStarter
|
2016-04-10 23:07:21 +00:00
|
|
|
help = 'Index format: nnn'
|
2012-11-28 17:15:12 +00:00
|
|
|
|
2016-05-20 23:18:42 +00:00
|
|
|
def __init__(self, name):
|
2022-06-06 10:08:32 +00:00
|
|
|
super().__init__('WLP/' + name)
|
2016-04-10 23:07:21 +00:00
|
|
|
|
2016-04-21 06:20:49 +00:00
|
|
|
def namer(self, image_url, page_url):
|
2016-04-10 23:07:21 +00:00
|
|
|
return (page_url.rsplit('/', 1)[-1].split('.')[0] + '_' +
|
|
|
|
image_url.rsplit('/', 1)[-1])
|
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class ChichiChan(WLPComics):
|
2016-04-10 23:07:21 +00:00
|
|
|
url = 'http://www.wlpcomics.com/adult/chichi/'
|
2020-04-06 11:23:23 +00:00
|
|
|
stripUrl = url + '%s.html'
|
2016-04-10 23:07:21 +00:00
|
|
|
adult = True
|
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class ChocolateMilkMaid(WLPComics):
|
2016-04-10 23:07:21 +00:00
|
|
|
# Newer pages seem to be broken
|
2020-04-06 11:23:23 +00:00
|
|
|
stripUrl = 'http://www.wlpcomics.com/adult/cm/%s.html'
|
|
|
|
url = stripUrl % '264'
|
2016-04-10 23:07:21 +00:00
|
|
|
adult = True
|
|
|
|
|
2016-11-01 01:27:29 +00:00
|
|
|
def link_modifier(self, fromurl, tourl):
|
|
|
|
"""Bugfix for self-referencing pages..."""
|
|
|
|
if tourl == fromurl:
|
|
|
|
return re.sub(r'/(\d+)\.ht',
|
|
|
|
lambda m: '/%03i.ht' % (int(m.group(1)) - 1), tourl)
|
|
|
|
if '263.html' in fromurl and '265.html' in tourl:
|
2021-03-20 00:20:09 +00:00
|
|
|
return self.stripUrl % '264'
|
2016-11-01 01:27:29 +00:00
|
|
|
return tourl
|
|
|
|
|
2016-04-10 23:07:21 +00:00
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class MaidAttack(WLPComics):
|
2016-04-10 23:07:21 +00:00
|
|
|
url = 'http://www.wlpcomics.com/general/maidattack/'
|
2020-04-06 11:23:23 +00:00
|
|
|
stripUrl = url + '%s.html'
|
2016-04-10 23:07:21 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class PeterIsTheWolfAdult(WLPComics):
|
2019-12-17 09:33:48 +00:00
|
|
|
stripUrl = 'http://www.peteristhewolf.com/adult/%s.html'
|
2021-03-20 00:20:09 +00:00
|
|
|
# navigation to newest page is broken
|
|
|
|
url = stripUrl % '427'
|
2019-12-17 09:33:48 +00:00
|
|
|
firstStripUrl = stripUrl % '001'
|
|
|
|
multipleImagesPerStrip = True
|
2016-04-10 23:07:21 +00:00
|
|
|
adult = True
|
2021-03-20 00:20:09 +00:00
|
|
|
endOfLife = True
|
2016-04-10 23:07:21 +00:00
|
|
|
|
2019-06-27 04:19:24 +00:00
|
|
|
def namer(self, imageUrl, pageUrl):
|
|
|
|
name = pageUrl.rsplit('/', 1)[-1].split('.')[0] + '_' + imageUrl.rsplit('/', 1)[-1]
|
|
|
|
if 'adult' in imageUrl:
|
|
|
|
name = name.split('.')
|
|
|
|
return name[0] + '_adult.' + name[1]
|
|
|
|
return name
|
|
|
|
|
2019-12-17 09:33:48 +00:00
|
|
|
def getPrevUrl(self, url, data):
|
|
|
|
# Fix loop in site navigation
|
|
|
|
if url == self.stripUrl % '194':
|
|
|
|
return self.stripUrl % '193'
|
|
|
|
return super(PeterIsTheWolfAdult, self).getPrevUrl(url, data)
|
|
|
|
|
2016-04-10 23:07:21 +00:00
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class PeterIsTheWolfGeneral(WLPComics):
|
2021-03-20 00:20:09 +00:00
|
|
|
stripUrl = 'http://www.peteristhewolf.com/general/%s.html'
|
|
|
|
# navigation to newest page is broken
|
|
|
|
url = stripUrl % '427'
|
2019-12-17 09:33:48 +00:00
|
|
|
firstStripUrl = stripUrl % '001'
|
2021-03-20 00:20:09 +00:00
|
|
|
endOfLife = True
|
2019-12-17 09:33:48 +00:00
|
|
|
|
|
|
|
def getPrevUrl(self, url, data):
|
|
|
|
# Fix loops in site navigation
|
|
|
|
if url == self.stripUrl % '406':
|
|
|
|
return self.stripUrl % '405'
|
|
|
|
if url == self.stripUrl % '230':
|
|
|
|
return self.stripUrl % '229'
|
|
|
|
if url == self.stripUrl % '229':
|
|
|
|
return self.stripUrl % '228'
|
|
|
|
if url == self.stripUrl % '153':
|
|
|
|
return self.stripUrl % '152'
|
|
|
|
return super(PeterIsTheWolfGeneral, self).getPrevUrl(url, data)
|
2016-04-10 23:07:21 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class Stellar(WLPComics):
|
2016-04-10 23:07:21 +00:00
|
|
|
url = 'http://www.wlpcomics.com/adult/stellar/'
|
2020-04-06 11:23:23 +00:00
|
|
|
stripUrl = url + '%s.html'
|
2016-04-10 23:07:21 +00:00
|
|
|
adult = True
|
2012-11-26 06:13:32 +00:00
|
|
|
|
2016-11-01 00:12:16 +00:00
|
|
|
def link_modifier(self, fromurl, tourl):
|
2016-04-10 23:07:21 +00:00
|
|
|
"""Bugfix for empty page..."""
|
2016-11-01 00:12:16 +00:00
|
|
|
if tourl == self.url + '075.html':
|
2016-04-21 21:52:31 +00:00
|
|
|
return self.url + '074.html'
|
2016-11-01 00:12:16 +00:00
|
|
|
return tourl
|