2016-04-10 23:07:21 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
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
|
2016-04-10 23:07:21 +00:00
|
|
|
# Copyright (C) 2015-2016 Tobias Gruetzmacher
|
2012-11-26 06:13:32 +00:00
|
|
|
|
2016-04-10 23:07:21 +00:00
|
|
|
from __future__ import absolute_import, division, print_function
|
2012-11-26 06:13:32 +00:00
|
|
|
|
2016-11-01 01:27:29 +00:00
|
|
|
import re
|
|
|
|
|
2016-04-10 23:07:21 +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
|
|
|
|
2016-04-10 23:07:21 +00:00
|
|
|
class _WLPComics(_ParserScraper):
|
|
|
|
imageSearch = '//center/*/img[contains(@alt, " Comic")]'
|
|
|
|
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):
|
|
|
|
super(_WLPComics, self).__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])
|
|
|
|
|
|
|
|
def getIndexStripUrl(self, index):
|
2016-11-01 01:27:29 +00:00
|
|
|
return self.url + '%s.html' % index
|
2016-04-10 23:07:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ChichiChan(_WLPComics):
|
|
|
|
url = 'http://www.wlpcomics.com/adult/chichi/'
|
|
|
|
adult = True
|
|
|
|
|
|
|
|
|
|
|
|
class ChocolateMilkMaid(_WLPComics):
|
|
|
|
# Newer pages seem to be broken
|
2016-11-01 01:27:29 +00:00
|
|
|
baseurl = 'http://www.wlpcomics.com/adult/cm/'
|
|
|
|
url = baseurl + '264.html'
|
2016-04-10 23:07:21 +00:00
|
|
|
adult = True
|
|
|
|
|
2016-11-01 01:27:29 +00:00
|
|
|
def getIndexStripUrl(self, index):
|
|
|
|
return self.baseurl + '%s.html' % index
|
|
|
|
|
|
|
|
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:
|
|
|
|
return self.baseurl + '264.html'
|
|
|
|
return tourl
|
|
|
|
|
2016-04-10 23:07:21 +00:00
|
|
|
|
|
|
|
class MaidAttack(_WLPComics):
|
|
|
|
url = 'http://www.wlpcomics.com/general/maidattack/'
|
|
|
|
|
|
|
|
|
|
|
|
class PeterIsTheWolfAdult(_WLPComics):
|
|
|
|
url = 'http://www.peteristhewolf.com/adult/home.html'
|
|
|
|
adult = True
|
|
|
|
|
|
|
|
|
|
|
|
class PeterIsTheWolfGeneral(_WLPComics):
|
|
|
|
url = 'http://www.peteristhewolf.com/general/'
|
|
|
|
|
|
|
|
|
|
|
|
class Stellar(_WLPComics):
|
|
|
|
url = 'http://www.wlpcomics.com/adult/stellar/'
|
|
|
|
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
|