Small fix to the WLP module.
This commit is contained in:
parent
bc755d09a3
commit
f7f4e130bf
1 changed files with 17 additions and 2 deletions
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
from ..scraper import _ParserScraper
|
from ..scraper import _ParserScraper
|
||||||
from ..helpers import bounceStarter
|
from ..helpers import bounceStarter
|
||||||
|
|
||||||
|
@ -24,7 +26,7 @@ class _WLPComics(_ParserScraper):
|
||||||
image_url.rsplit('/', 1)[-1])
|
image_url.rsplit('/', 1)[-1])
|
||||||
|
|
||||||
def getIndexStripUrl(self, index):
|
def getIndexStripUrl(self, index):
|
||||||
return self.url + '%s.html'
|
return self.url + '%s.html' % index
|
||||||
|
|
||||||
|
|
||||||
class ChichiChan(_WLPComics):
|
class ChichiChan(_WLPComics):
|
||||||
|
@ -34,9 +36,22 @@ class ChichiChan(_WLPComics):
|
||||||
|
|
||||||
class ChocolateMilkMaid(_WLPComics):
|
class ChocolateMilkMaid(_WLPComics):
|
||||||
# Newer pages seem to be broken
|
# Newer pages seem to be broken
|
||||||
url = 'http://www.wlpcomics.com/adult/cm/262.html'
|
baseurl = 'http://www.wlpcomics.com/adult/cm/'
|
||||||
|
url = baseurl + '264.html'
|
||||||
adult = True
|
adult = True
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
class MaidAttack(_WLPComics):
|
class MaidAttack(_WLPComics):
|
||||||
url = 'http://www.wlpcomics.com/general/maidattack/'
|
url = 'http://www.wlpcomics.com/general/maidattack/'
|
||||||
|
|
Loading…
Reference in a new issue