2012-06-20 20:41:04 +00:00
|
|
|
# -*- coding: iso-8859-1 -*-
|
|
|
|
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
|
2014-01-05 15:50:57 +00:00
|
|
|
# Copyright (C) 2012-2014 Bastian Kleineidam
|
2012-06-20 19:58:13 +00:00
|
|
|
|
2013-04-10 16:19:11 +00:00
|
|
|
from re import compile, escape
|
2012-10-11 10:03:12 +00:00
|
|
|
from ..scraper import _BasicScraper
|
2012-11-21 20:57:26 +00:00
|
|
|
from ..helpers import bounceStarter, queryNamer, indirectStarter
|
2014-03-26 18:59:42 +00:00
|
|
|
from ..util import tagre, fetchUrl, getPageContent
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2012-12-28 04:37:08 +00:00
|
|
|
class PandyLand(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://pandyland.net/'
|
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 % '1'
|
2013-04-10 16:19:11 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'(%s\d+/)' % rurl, after="prev"))
|
2012-12-28 04:37:08 +00:00
|
|
|
help = 'Index format: number'
|
|
|
|
|
|
|
|
|
2013-02-07 22:55:41 +00:00
|
|
|
class ParadigmShift(_BasicScraper):
|
2013-04-14 07:02:14 +00:00
|
|
|
description = u'A Paranormal Graphic Novel by Dirk I. Tiede'
|
2013-02-07 22:55:41 +00:00
|
|
|
url = 'http://www.paradigmshiftmanga.com/'
|
|
|
|
starter = indirectStarter(url, compile(tagre("a", "href", r'([^"]+)', after="next-comic-link")))
|
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/[^"]*)'))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'([^"]+)', after="previous-comic-link"))
|
|
|
|
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'
|
2013-04-10 16:19:11 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(%scomics/\d+-\d+-\d+[^"]+)' % rurl))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'(%s[^"]+/)' % rurl) +
|
2013-03-20 16:39:49 +00:00
|
|
|
tagre("span", "class", "prev"))
|
|
|
|
help = 'Index format: number-stripname'
|
|
|
|
lang = 'de'
|
|
|
|
|
|
|
|
|
2012-06-20 19:58:13 +00:00
|
|
|
class PartiallyClips(_BasicScraper):
|
2013-04-14 07:02:14 +00:00
|
|
|
description = u'PartiallyClips - The true stories behind your favorite clip art.'
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://partiallyclips.com/'
|
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 % '2001/10/28/screaming-woman'
|
2013-04-10 16:19:11 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="prev"))
|
2012-11-21 20:57:26 +00:00
|
|
|
help = 'Index format: yyyy/mm/dd/stripname'
|
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'
|
|
|
|
|
|
|
|
|
|
|
|
class PebbleVersion(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.pebbleversion.com/'
|
|
|
|
stripUrl = url + 'Archives/Strip%s.html'
|
2012-06-20 19:58:13 +00:00
|
|
|
imageSearch = compile(r'<img src="(ComicStrips/.+?|../ComicStrips/.+?)"')
|
|
|
|
prevSearch = compile(r'<a href="((?!.+?">First Comic)Archives/Strip.+?|(?=.+?">Previous Comic)(?!.+?">First Comic)Strip.+?)"')
|
|
|
|
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=""))
|
2013-02-04 20:00:26 +00:00
|
|
|
starter = indirectStarter(url, prevSearch)
|
2012-06-20 19:58:13 +00:00
|
|
|
help = 'Index format: n (unpadded)'
|
|
|
|
|
|
|
|
|
|
|
|
class PennyArcade(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://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'
|
2012-11-21 20:57:26 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(http://art\.penny-arcade\.com/photos/[^"]+)'))
|
2013-04-10 16:19:11 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, before="btnPrev"))
|
2014-03-26 18:59:42 +00:00
|
|
|
nextSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, before="btnNext"))
|
|
|
|
help = 'Index format: yyyy/mm/dd/'
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def prevUrlModifier(cls, prevUrl):
|
|
|
|
if prevUrl:
|
|
|
|
dummy, yyyy, mm, dd = prevUrl.rsplit('/', 3)
|
|
|
|
try:
|
|
|
|
int(dd)
|
|
|
|
except ValueError:
|
|
|
|
# URL has form yyyy/mm/dd/stripname
|
|
|
|
prevUrl = "%s/%s/%s" % (dummy, yyyy, mm)
|
|
|
|
return prevUrl
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def starter(cls):
|
|
|
|
"""Get bounced start URL."""
|
|
|
|
data, baseUrl = getPageContent(cls.url, cls.session)
|
|
|
|
url1 = fetchUrl(cls.url, data, baseUrl, cls.prevSearch)
|
|
|
|
data, baseUrl = getPageContent(url1, cls.session)
|
|
|
|
url2 = fetchUrl(url1, data, baseUrl, cls.nextSearch)
|
|
|
|
return cls.prevUrlModifier(url2)
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def namer(cls, imageUrl, pageUrl):
|
2014-10-24 21:42:32 +00:00
|
|
|
p = pageUrl.split('/')
|
|
|
|
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-04-14 07:02:14 +00:00
|
|
|
description = u'Sexy Fucking Fantasy Adventure Webcomic - NSFW'
|
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))
|
|
|
|
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
|
|
|
|
|
|
|
|
2013-03-06 19:00:30 +00:00
|
|
|
class PHDComics(_BasicScraper):
|
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'
|
|
|
|
imageSearch = compile(tagre("img", "src", r'(http://www\.phdcomics\.com/comics/archive/phd[^ ]+)', quote=""))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'((?:comics/)?archive\.php\?comicid=\d+)', quote="") +
|
|
|
|
tagre("img", "src", r'(?:comics/)?images/prev_button\.gif', quote=""))
|
|
|
|
help = 'Index format: number'
|
|
|
|
|
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 (
|
|
|
|
self.stripUrl % '1669', # video
|
|
|
|
)
|
|
|
|
|
2013-03-06 19:00:30 +00:00
|
|
|
|
2012-12-08 20:30:51 +00:00
|
|
|
class PicPakDog(_BasicScraper):
|
2013-04-14 07:02:14 +00:00
|
|
|
description = u'A comic by Kim Belding'
|
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))
|
2013-05-25 21:24:33 +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
|
|
|
|
|
|
|
|
2012-06-20 19:58:13 +00:00
|
|
|
class Pixel(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://pixelcomic.net/'
|
2013-04-10 16:19:11 +00:00
|
|
|
rurl = escape(url)
|
2013-04-10 21:57:09 +00:00
|
|
|
stripUrl = url + '%s'
|
|
|
|
firstStripUrl = stripUrl % '000.shtml'
|
2012-11-21 20:57:26 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(\d+\.png)'))
|
2013-04-10 21:57:09 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(%s\d+\.(?:php|shtml))' % rurl, before="prev"))
|
2012-06-20 19:58:13 +00:00
|
|
|
help = 'Index format: nnn'
|
|
|
|
|
|
|
|
|
|
|
|
class PiledHigherAndDeeper(_BasicScraper):
|
2015-01-16 18:06:17 +00:00
|
|
|
url = 'http://www.phdcomics.com/comics.php'
|
|
|
|
starter = bounceStarter(url, compile(r'<a href=(archive\.php\?comicid=\d+)>.*<img [^>]*next_button\.gif'))
|
2013-02-04 20:00:26 +00:00
|
|
|
stripUrl = url + '?comicid=%s'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '1'
|
2015-01-16 18:06:17 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(http://www\.phdcomics\.com/comics/archive/phd\d+s\d?\.\w{3,4})', quote=""))
|
|
|
|
prevSearch = compile(r'<a href=((comics/)?archive\.php\?comicid=\d+)>.*<img [^>]*prev_button\.gif')
|
2012-06-20 19:58:13 +00:00
|
|
|
help = 'Index format: n (unpadded)'
|
|
|
|
namer = queryNamer('comicid', usePageUrl=True)
|
|
|
|
|
|
|
|
|
2012-12-08 20:30:51 +00:00
|
|
|
class Pimpette(_BasicScraper):
|
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'
|
2012-12-08 20:30:51 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(strips/[^"]+)'))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'(index\.php\?date=\d+)') + "Previous")
|
|
|
|
help = 'Index format: yyyymmdd'
|
|
|
|
|
|
|
|
|
2013-03-06 19:21:10 +00:00
|
|
|
# Broken navigation: prev link at http://planescapecomic.com/201.html points to same URL.
|
|
|
|
class _PlanescapeSurvival(_BasicScraper):
|
|
|
|
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'
|
|
|
|
|
|
|
|
|
2013-03-06 19:00:30 +00:00
|
|
|
class PokeyThePenguin(_BasicScraper):
|
2013-04-13 18:58:00 +00:00
|
|
|
baseUrl = 'http://www.yellow5.com/pokey/archive/'
|
|
|
|
url = baseUrl + 'index558.html'
|
|
|
|
stripUrl = baseUrl + 'index%s.html'
|
2013-03-06 19:00:30 +00:00
|
|
|
firstStripUrl = stripUrl % '1'
|
|
|
|
imageSearch = compile(tagre("img", "src", r'(pokey\d+[^"]+)'))
|
2013-03-06 19:23:43 +00:00
|
|
|
prevSearch = True
|
2013-03-06 19:00:30 +00:00
|
|
|
multipleImagesPerStrip = True
|
|
|
|
help = 'Index format: number'
|
|
|
|
|
|
|
|
def getPrevUrl(self, url, data, baseUrl):
|
|
|
|
"""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+/[^"]+)'))
|
|
|
|
prevSearch = compile(tagre("li", "class", r'previous') + tagre("a", "href", r'(%s[^"]+)' % rurl))
|
|
|
|
help = 'Index Format: name'
|
|
|
|
description = u'A thrice-weekly webcomic written and illustrated by Reza Farazmand. New comics every Monday, Wednesday, and Friday.'
|
|
|
|
|
|
|
|
|
2012-06-20 19:58:13 +00:00
|
|
|
class Precocious(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.precociouscomic.com/'
|
|
|
|
starter = indirectStarter(url,
|
2012-11-21 20:57:26 +00:00
|
|
|
compile(tagre("a", "href", r'(/archive/comic/[^"]+)') + tagre("img", "src", r"/templates/precocious_main/images/next_arrow\.png"))
|
|
|
|
)
|
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"))
|
|
|
|
help = 'Index format: yyyy/mm/dd'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProperBarn(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.nitrocosm.com/go/gag/'
|
|
|
|
stripUrl = url + '%s/'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '1'
|
2012-12-04 06:02:40 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(http://content\.nitrocosm\.com/gag/\d+\.[^"]+)'))
|
2012-11-21 20:57:26 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(http://www\.nitrocosm\.com/go/gag/\d+/)', after="nav_btn_previous"))
|
2012-06-20 19:58:13 +00:00
|
|
|
help = 'Index format: nnn'
|
|
|
|
|
|
|
|
|
|
|
|
class PunksAndNerds(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.punksandnerds.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 % '15'
|
2013-04-10 16:19:11 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'(%s\?p=\d+)' % rurl, after="navi-prev"))
|
2012-06-20 19:58:13 +00:00
|
|
|
help = 'Index format: nnn'
|
|
|
|
|
|
|
|
|
|
|
|
class PunksAndNerdsOld(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://original.punksandnerds.com/'
|
|
|
|
stripUrl = url + 'd/%s.html'
|
2012-06-20 19:58:13 +00:00
|
|
|
imageSearch = compile(r' src="(/comics/.+?)"')
|
|
|
|
prevSearch = compile(r'><strong><a href="(.+?)"[^>]+?><img[^>]+?src="/previouscomic.gif">')
|
|
|
|
help = 'Index format: yyyymmdd'
|
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)'))
|
2014-10-24 21:42:32 +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'
|