# -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
from __future__ import absolute_import, division, print_function
from re import compile, escape
from ..scraper import _BasicScraper, _ParserScraper
from ..helpers import bounceStarter, queryNamer, indirectStarter, xpath_class
from ..util import tagre
from .common import _ComicControlScraper, _WordPressScraper, _WPNavi
class PandyLand(_WordPressScraper):
url = 'http://pandyland.net/'
firstStripUrl = 'http://pandyland.net/1/'
class ParadigmShift(_BasicScraper):
url = 'http://www.paradigmshiftmanga.com/'
starter = indirectStarter
stripUrl = url + 'ps/%s.html'
imageSearch = compile(tagre("img", "src", r'([^"]*comics/ps/[^"]*)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)',
after="previous-comic-link"))
latestSearch = compile(tagre("a", "href", r'([^"]+)',
after="next-comic-link"))
help = 'Index format: custom'
class ParallelUniversum(_BasicScraper):
url = 'http://www.paralleluniversum.net/'
rurl = escape(url)
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '001-der-comic-ist-tot'
imageSearch = compile(tagre("img", "src",
r'(%scomics/\d+-\d+-\d+[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+/)' % rurl) +
tagre("span", "class", "prev"))
help = 'Index format: number-stripname'
lang = 'de'
class PartiallyClips(_WordPressScraper):
url = ('https://web.archive.org/web/20180509161332/'
'http://partiallyclips.com/')
firstStripUrl = url + 'comic/screaming-woman/'
endOfLife = True
class PastelDefender(_BasicScraper):
baseUrl = 'http://www.pasteldefender.com/'
url = baseUrl + 'coverbackcover.html'
stripUrl = baseUrl + '%s.html'
firstStripUrl = stripUrl % 'cover'
imageSearch = compile(r'')
baseUrl = 'http://phdcomics.com/'
url = baseUrl + 'comics.php'
stripUrl = baseUrl + 'comics/archive.php?comicid=%s'
firstStripUrl = stripUrl % '1'
imageSearch = '//img[@id="comic2"]'
prevSearch = '//a[img[contains(@src, "prev_button")]]'
nextSearch = '//a[img[contains(@src, "next_button")]]'
help = 'Index format: n (unpadded)'
# Ugly hack :(
def _parse_page(self, data):
data = self.BROKEN_COMMENT_END.sub('-->', data)
return super(PHDComics, self)._parse_page(data)
def shouldSkipUrl(self, url, data):
"""Skip pages without images."""
return url in (
# video
self.stripUrl % '1880',
self.stripUrl % '1669',
)
class Picklewhistle(_ComicControlScraper):
url = 'http://www.picklewhistle.com/'
class PicPakDog(_WordPressScraper):
url = 'http://www.picpak.net/'
firstStripUrl = url + 'comic/dogs-cant-spell/'
# Keep, because naming is different to PHDComics...
class PiledHigherAndDeeper(PHDComics):
starter = bounceStarter
namer = queryNamer('comicid', use_page_url=True)
class Pixel(_BasicScraper):
url = 'http://pixelcomic.net/'
rurl = escape(url)
stripUrl = url + '%s'
firstStripUrl = stripUrl % '000.shtml'
imageSearch = compile(tagre("img", "src", r'(\d+\.png)'))
prevSearch = compile(tagre("a", "href", r'(%s\d+\.(?:php|shtml))' % rurl,
before="prev"))
help = 'Index format: nnn'
class PlanescapeSurvival(_BasicScraper):
url = 'http://planescapecomic.com/'
stripUrl = url + '%s.html'
imageSearch = compile(r'src="(comics/.+?)"')
prevSearch = compile(r'= 9 and filename[8].isdigit():
filename = filename[:8] + '-' + filename[8:]
return filename
class Prototype(_ParserScraper):
stripUrl = 'http://planetprototype.com/%s/'
firstStripUrl = stripUrl % '2018/03/30/vol-1-ch-1-front-cover'
url = firstStripUrl
imageSearch = '//img[contains(@class, "wp-post-image")]'
prevSearch = '//a[.//text()="Previous"]'
latestSearch = '//a[.//text()="Latest"]'
starter = indirectStarter
class PS238(_ParserScraper):
url = 'http://ps238.nodwick.com/'
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % '12072006'
imageSearch = '//div[@id="comic"]//img'
prevSearch = '//a[@class="comic-nav-base comic-nav-previous"]'
help = 'Index format: yyyy-mm-dd'
class PvPOnline(_ParserScraper):
url = 'http://pvponline.com/comic/'
stripUrl = url + '%s'
firstStripUrl = stripUrl % 'mon-may-04'
imageSearch = '//section[@class="comic-art"]/img'
prevSearch = '//div[contains(@class, "comic-nav")]/a[contains(text(), "Prev")]'