2016-03-31 21:13:54 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2012-06-20 20:41:04 +00:00
|
|
|
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
|
2014-01-05 15:50:57 +00:00
|
|
|
# Copyright (C) 2012-2014 Bastian Kleineidam
|
2016-03-31 21:13:54 +00:00
|
|
|
# Copyright (C) 2015-2016 Tobias Gruetzmacher
|
2012-06-20 19:58:13 +00:00
|
|
|
|
2016-03-31 21:13:54 +00:00
|
|
|
from __future__ import absolute_import, division, print_function
|
2016-04-10 21:04:34 +00:00
|
|
|
|
2013-04-10 16:19:11 +00:00
|
|
|
from re import compile, escape
|
2016-04-10 21:04:34 +00:00
|
|
|
|
2015-04-16 23:20:14 +00:00
|
|
|
from ..scraper import _BasicScraper, _ParserScraper
|
2012-11-21 20:57:26 +00:00
|
|
|
from ..helpers import bounceStarter, queryNamer, indirectStarter
|
2014-07-23 18:53:59 +00:00
|
|
|
from ..util import tagre
|
2016-04-10 21:04:34 +00:00
|
|
|
from .common import _ComicControlScraper, _WordPressScraper, xpath_class
|
2016-04-01 22:14:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PandyLand(_WordPressScraper):
|
|
|
|
url = 'http://pandyland.net/'
|
|
|
|
firstStripUrl = 'http://pandyland.net/1/'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2013-02-07 22:55:41 +00:00
|
|
|
class ParadigmShift(_BasicScraper):
|
|
|
|
url = 'http://www.paradigmshiftmanga.com/'
|
2016-04-13 18:01:51 +00:00
|
|
|
starter = indirectStarter
|
2013-02-18 19:55:54 +00:00
|
|
|
stripUrl = url + 'ps/%s.html'
|
2013-02-07 22:55:41 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'([^"]*comics/ps/[^"]*)'))
|
2016-03-31 21:13:54 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'([^"]+)',
|
|
|
|
after="previous-comic-link"))
|
2016-04-12 21:11:39 +00:00
|
|
|
latestSearch = compile(tagre("a", "href", r'([^"]+)',
|
|
|
|
after="next-comic-link"))
|
2013-02-07 22:55:41 +00:00
|
|
|
help = 'Index format: custom'
|
|
|
|
|
|
|
|
|
2013-03-20 16:39:49 +00:00
|
|
|
class ParallelUniversum(_BasicScraper):
|
|
|
|
url = 'http://www.paralleluniversum.net/'
|
2013-04-10 16:19:11 +00:00
|
|
|
rurl = escape(url)
|
2013-03-20 16:39:49 +00:00
|
|
|
stripUrl = url + '%s/'
|
|
|
|
firstStripUrl = stripUrl % '001-der-comic-ist-tot'
|
2016-03-31 21:13:54 +00:00
|
|
|
imageSearch = compile(tagre("img", "src",
|
|
|
|
r'(%scomics/\d+-\d+-\d+[^"]+)' % rurl))
|
2013-04-10 16:19:11 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(%s[^"]+/)' % rurl) +
|
2016-03-31 21:13:54 +00:00
|
|
|
tagre("span", "class", "prev"))
|
2013-03-20 16:39:49 +00:00
|
|
|
help = 'Index format: number-stripname'
|
|
|
|
lang = 'de'
|
|
|
|
|
|
|
|
|
2016-04-10 21:04:34 +00:00
|
|
|
class PartiallyClips(_WordPressScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://partiallyclips.com/'
|
2016-04-10 21:04:34 +00:00
|
|
|
firstStripUrl = url + 'comic/screaming-woman/'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PastelDefender(_BasicScraper):
|
2013-04-13 18:58:00 +00:00
|
|
|
baseUrl = 'http://www.pasteldefender.com/'
|
|
|
|
url = baseUrl + 'coverbackcover.html'
|
|
|
|
stripUrl = baseUrl + '%s.html'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % 'cover'
|
2012-06-20 19:58:13 +00:00
|
|
|
imageSearch = compile(r'<IMG SRC="(images/.+?)" WIDTH="742"')
|
|
|
|
prevSearch = compile(r'<A HREF="([^"]+)"><IMG SRC="images/back\.gif"')
|
|
|
|
help = 'Index format: nnn'
|
|
|
|
|
|
|
|
|
2015-05-14 10:33:46 +00:00
|
|
|
class PebbleVersion(_ParserScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.pebbleversion.com/'
|
|
|
|
stripUrl = url + 'Archives/Strip%s.html'
|
2015-05-14 10:33:46 +00:00
|
|
|
imageSearch = "//table/tr[2]//img"
|
|
|
|
prevSearch = '//a[text()="Previous Comic"]'
|
2012-06-20 19:58:13 +00:00
|
|
|
help = 'Index format: n (unpadded)'
|
|
|
|
|
|
|
|
|
|
|
|
class PennyAndAggie(_BasicScraper):
|
2013-04-11 16:27:43 +00:00
|
|
|
url = 'http://pennyandaggie.com/'
|
2013-04-10 16:19:11 +00:00
|
|
|
rurl = escape(url)
|
2013-02-04 20:00:26 +00:00
|
|
|
stripUrl = url + 'index.php?p=%s'
|
2013-04-11 16:27:43 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(http://www\.pennyandaggie\.com/comics/[^"]+)'))
|
|
|
|
prevSearch = compile(tagre("a", "href", r"(index\.php\?p\=\d+)", quote="'") +
|
2013-04-10 16:19:11 +00:00
|
|
|
tagre("img", "src", r'%simages/previous_day\.gif' % rurl, quote=""))
|
2012-06-20 19:58:13 +00:00
|
|
|
help = 'Index format: n (unpadded)'
|
|
|
|
|
|
|
|
|
2016-05-05 18:55:14 +00:00
|
|
|
class PennyArcade(_ParserScraper):
|
|
|
|
url = 'http://www.penny-arcade.com/comic/'
|
2013-04-10 16:19:11 +00:00
|
|
|
rurl = escape(url)
|
2013-02-04 20:00:26 +00:00
|
|
|
stripUrl = url + '%s'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '1998/11/18'
|
2016-05-05 18:55:14 +00:00
|
|
|
imageSearch = '//div[@id="comicFrame"]//img'
|
|
|
|
prevSearch = '//a[%s]' % xpath_class('btnPrev')
|
|
|
|
nextSearch = '//a[%s]' % xpath_class('btnNext')
|
2016-04-13 18:01:51 +00:00
|
|
|
starter = bounceStarter
|
2016-05-05 18:55:14 +00:00
|
|
|
help = 'Index format: yyyy/mm/dd'
|
2014-03-26 18:59:42 +00:00
|
|
|
|
2016-04-21 06:20:49 +00:00
|
|
|
def namer(self, image_url, page_url):
|
|
|
|
p = page_url.split('/')
|
2014-10-24 21:42:32 +00:00
|
|
|
return '%04d%02d%02d' % (int(p[4]), int(p[5]), int(p[6]))
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PeppermintSaga(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.pepsaga.com/'
|
2013-04-10 16:19:11 +00:00
|
|
|
rurl = escape(url)
|
2013-02-04 20:00:26 +00:00
|
|
|
stripUrl = url + '?p=%s'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '3'
|
2013-04-10 16:19:11 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
|
2016-03-31 21:13:54 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(%s\?p=\d+)' % rurl,
|
|
|
|
after="prev"))
|
2012-11-21 20:57:26 +00:00
|
|
|
help = 'Index format: number'
|
2013-04-14 07:02:14 +00:00
|
|
|
adult = True
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2016-05-05 18:55:14 +00:00
|
|
|
class PHDComics(_ParserScraper):
|
2013-04-13 18:58:00 +00:00
|
|
|
baseUrl = 'http://phdcomics.com/'
|
|
|
|
url = baseUrl + 'comics.php'
|
|
|
|
stripUrl = baseUrl + 'comics/archive.php?comicid=%s'
|
2013-03-06 19:00:30 +00:00
|
|
|
firstStripUrl = stripUrl % '1'
|
2016-05-05 18:55:14 +00:00
|
|
|
imageSearch = '//img[@id="comic"]'
|
|
|
|
prevSearch = '//a[img[contains(@src, "prev_button")]]'
|
|
|
|
nextSearch = '//a[img[contains(@src, "next_button")]]'
|
|
|
|
help = 'Index format: n (unpadded)'
|
2013-03-06 19:00:30 +00:00
|
|
|
|
2014-02-10 20:58:09 +00:00
|
|
|
def shouldSkipUrl(self, url, data):
|
2014-01-06 07:20:58 +00:00
|
|
|
"""Skip pages without images."""
|
|
|
|
return url in (
|
2016-03-31 21:13:54 +00:00
|
|
|
self.stripUrl % '1669', # video
|
2014-01-06 07:20:58 +00:00
|
|
|
)
|
|
|
|
|
2013-03-06 19:00:30 +00:00
|
|
|
|
2016-04-03 22:12:53 +00:00
|
|
|
class Picklewhistle(_ComicControlScraper):
|
|
|
|
url = 'http://www.picklewhistle.com/'
|
|
|
|
|
|
|
|
|
2012-12-08 20:30:51 +00:00
|
|
|
class PicPakDog(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.picpak.net/'
|
2013-04-10 16:19:11 +00:00
|
|
|
rurl = escape(url)
|
2013-02-22 18:43:33 +00:00
|
|
|
stripUrl = url + 'comic/%s/'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % 'dogs-cant-spell'
|
2013-04-10 16:19:11 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/\d+-\d+-\d+-[^"]+\.png)' % rurl))
|
2016-03-31 21:13:54 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(%scomic/[^"]+)' % rurl,
|
|
|
|
after="nav-prev"))
|
2013-02-21 18:47:37 +00:00
|
|
|
help = 'Index format: stripname'
|
2012-12-08 20:30:51 +00:00
|
|
|
|
|
|
|
|
2016-05-05 18:55:14 +00:00
|
|
|
# Keep, because naming is different to PHDComics...
|
|
|
|
class PiledHigherAndDeeper(PHDComics):
|
2016-04-13 18:01:51 +00:00
|
|
|
starter = bounceStarter
|
2016-04-21 06:20:49 +00:00
|
|
|
namer = queryNamer('comicid', use_page_url=True)
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2015-05-31 10:57:25 +00:00
|
|
|
class Pimpette(_ParserScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://pimpette.ca/'
|
|
|
|
stripUrl = url + 'index.php?date=%s'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '20030905'
|
2015-05-31 10:57:25 +00:00
|
|
|
imageSearch = '//div[@id="strip"]/img'
|
|
|
|
prevSearch = '//a[text()="previous"]'
|
2012-12-08 20:30:51 +00:00
|
|
|
help = 'Index format: yyyymmdd'
|
|
|
|
|
|
|
|
|
2016-03-31 21:13:54 +00:00
|
|
|
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'
|
|
|
|
|
|
|
|
|
2015-07-17 23:21:29 +00:00
|
|
|
class PlanescapeSurvival(_BasicScraper):
|
2013-03-06 19:21:10 +00:00
|
|
|
url = 'http://planescapecomic.com/'
|
|
|
|
stripUrl = url + '%s.html'
|
|
|
|
imageSearch = compile(r'src="(comics/.+?)"')
|
|
|
|
prevSearch = compile(r'<a href="(.+?)"><img alt="Previous" ')
|
|
|
|
help = 'Index format: nnn'
|
|
|
|
|
|
|
|
|
2015-05-26 10:31:43 +00:00
|
|
|
class PokeyThePenguin(_ParserScraper):
|
|
|
|
url = 'http://www.yellow5.com/pokey/archive/'
|
|
|
|
stripUrl = url + 'index%s.html'
|
2013-03-06 19:00:30 +00:00
|
|
|
firstStripUrl = stripUrl % '1'
|
2015-05-26 10:31:43 +00:00
|
|
|
imageSearch = '//p/img'
|
2016-04-12 21:11:39 +00:00
|
|
|
latestSearch = '(//a)[last()]'
|
2013-03-06 19:00:30 +00:00
|
|
|
multipleImagesPerStrip = True
|
2016-04-13 18:01:51 +00:00
|
|
|
starter = indirectStarter
|
2013-03-06 19:00:30 +00:00
|
|
|
help = 'Index format: number'
|
|
|
|
|
2015-05-26 10:31:43 +00:00
|
|
|
def getPrevUrl(self, url, data):
|
2013-03-06 19:00:30 +00:00
|
|
|
"""Decrease index.html number."""
|
|
|
|
mo = compile(r"index(\d+)\.html").search(url)
|
|
|
|
num = int(mo.group(1)) - 1
|
|
|
|
prefix = url.rsplit('/', 1)[0]
|
|
|
|
return "%s/index%d.html" % (prefix, num)
|
|
|
|
|
|
|
|
|
2014-01-11 06:25:22 +00:00
|
|
|
class PoorlyDrawnLines(_BasicScraper):
|
|
|
|
url = 'http://poorlydrawnlines.com/comic/'
|
|
|
|
rurl = escape(url)
|
|
|
|
stripUrl = url + '%s'
|
|
|
|
firstStripUrl = stripUrl % 'campus-characters/'
|
|
|
|
imageSearch = compile(tagre("img", "src", r'(http://poorlydrawnlines\.com/wp-content/uploads/\d+/\d+/[^"]+)'))
|
2016-03-31 21:13:54 +00:00
|
|
|
prevSearch = compile(tagre("li", "class", r'previous') +
|
|
|
|
tagre("a", "href", r'(%s[^"]+)' % rurl))
|
2014-01-11 06:25:22 +00:00
|
|
|
help = 'Index Format: name'
|
|
|
|
|
|
|
|
|
2012-06-20 19:58:13 +00:00
|
|
|
class Precocious(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.precociouscomic.com/'
|
2016-04-13 18:01:51 +00:00
|
|
|
starter = indirectStarter
|
2013-02-04 20:00:26 +00:00
|
|
|
stripUrl = url + 'archive/comic/%s'
|
2013-04-04 16:30:02 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(/comics/\d+[^"]*\.(?:jpg|gif))'))
|
2012-11-21 20:57:26 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(/archive/comic/[^"]+)') + tagre("img", "src", r"/templates/precocious_main/images/back_arrow\.png"))
|
2016-04-12 21:11:39 +00:00
|
|
|
latestSearch = compile(tagre("a", "href", r'(/archive/comic/[^"]+)') +
|
|
|
|
tagre("img", "src", r"/templates/precocious_main/images/next_arrow\.png"))
|
2012-11-21 20:57:26 +00:00
|
|
|
help = 'Index format: yyyy/mm/dd'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2015-04-16 23:20:14 +00:00
|
|
|
class PS238(_ParserScraper):
|
|
|
|
url = 'http://ps238.nodwick.com/'
|
2016-05-05 18:55:14 +00:00
|
|
|
stripUrl = url + 'comic/%s/'
|
2015-04-16 23:20:14 +00:00
|
|
|
imageSearch = '//div[@id="comic"]//img'
|
|
|
|
prevSearch = '//a[@class="comic-nav-base comic-nav-previous"]'
|
|
|
|
help = 'Index format: yyyy-mm-dd'
|
|
|
|
|
|
|
|
|
2016-04-10 21:04:34 +00:00
|
|
|
class PunksAndNerds(_WordPressScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.punksandnerds.com/'
|
|
|
|
stripUrl = url + '?p=%s'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '15'
|
2016-04-10 21:04:34 +00:00
|
|
|
prevSearch = '//a[%s]' % xpath_class('navi-prev')
|
2012-06-20 19:58:13 +00:00
|
|
|
help = 'Index format: nnn'
|
|
|
|
|
|
|
|
|
2013-04-10 16:36:33 +00:00
|
|
|
class PvPonline(_BasicScraper):
|
|
|
|
url = 'http://pvponline.com/comic'
|
|
|
|
stripUrl = url + '%s'
|
|
|
|
imageSearch = compile(tagre("img", "src", r'(http://s3[^"]+\.amazonaws\.com/pvponlinenew/img/comic/\d+/\d+/pvp[^"]+\.jpg)'))
|
2016-03-31 21:13:54 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(/comic/[^"]+)',
|
|
|
|
after="left divider"))
|
2013-04-10 16:36:33 +00:00
|
|
|
help = 'Index format: yyyy/mm/dd/stripname'
|