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-11-21 20:57:26 +00:00
|
|
|
|
2013-04-25 19:38:18 +00:00
|
|
|
from re import compile, escape
|
2012-06-20 19:58:13 +00:00
|
|
|
|
2012-10-11 10:03:12 +00:00
|
|
|
from ..scraper import _BasicScraper
|
|
|
|
from ..helpers import bounceStarter, indirectStarter
|
2012-12-04 06:02:40 +00:00
|
|
|
from ..util import getQueryParams, tagre
|
2012-11-20 17:53:53 +00:00
|
|
|
|
2014-02-20 11:54:40 +00:00
|
|
|
class Underling(_BasicScraper):
|
|
|
|
url = 'http://underlingcomic.com/'
|
2014-03-04 19:53:19 +00:00
|
|
|
stripUrl = url
|
2014-02-20 11:54:40 +00:00
|
|
|
rurl = escape(url)
|
|
|
|
firstStripUrl = stripUrl + 'page-one/'
|
|
|
|
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]*)' % rurl))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'([^"]+)', after = r'class="[^"]*navi-prev'))
|
|
|
|
help = 'Index format: nnn'
|
|
|
|
|
2012-11-20 17:53:53 +00:00
|
|
|
|
2012-06-20 19:58:13 +00:00
|
|
|
class Undertow(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://undertow.dreamshards.org/'
|
|
|
|
stripUrl = url + '%s'
|
2012-12-04 06:02:40 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'([^"]+\.jpg)'))
|
2012-06-20 19:58:13 +00:00
|
|
|
prevSearch = compile(r'href="(.+?)".+?teynpoint')
|
|
|
|
help = 'Index format: good luck !'
|
2013-02-04 20:00:26 +00:00
|
|
|
starter = indirectStarter(url,
|
2012-06-20 19:58:13 +00:00
|
|
|
compile(r'href="(.+?)".+?Most recent page'))
|
|
|
|
|
|
|
|
|
|
|
|
class UnicornJelly(_BasicScraper):
|
2013-04-14 07:02:14 +00:00
|
|
|
description = u'UNICORN JELLY anime manga comic strip by Jennifer Diane Reitz'
|
2013-04-13 18:58:00 +00:00
|
|
|
baseUrl = 'http://unicornjelly.com/'
|
|
|
|
url = baseUrl + 'uni666.html'
|
|
|
|
stripUrl = baseUrl + 'uni%s.html'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '001'
|
2012-06-20 19:58:13 +00:00
|
|
|
imageSearch = compile(r'</TABLE>(?:<FONT COLOR="BLACK">)?<IMG SRC="(images/[^"]+)" WIDTH=')
|
|
|
|
prevSearch = compile(r'<A HREF="(uni\d{3}[bcs]?\.html)">(<FONT COLOR="BLACK">)?<IMG SRC="images/back00\.gif"')
|
|
|
|
help = 'Index format: nnn'
|
|
|
|
|
|
|
|
|
2013-04-25 19:38:18 +00:00
|
|
|
class Unsounded(_BasicScraper):
|
|
|
|
description = u'Some dead men tell tales, and some little girls have tails...'
|
|
|
|
url = 'http://www.casualvillain.com/Unsounded/'
|
|
|
|
stripUrl = url + 'comic/ch%s/ch%s_%s.html'
|
|
|
|
firstStripUrl = stripUrl % ('01', '01', '01')
|
|
|
|
rurl = escape(url)
|
2013-07-18 18:39:53 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(pageart/[^"]*)'))
|
2013-04-25 19:38:18 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'([^"]*)', after='class="back'))
|
|
|
|
starter = indirectStarter(url,
|
|
|
|
compile(tagre("a", "href", r'(%scomic/[^"]*)' % rurl) +
|
2013-05-25 21:24:33 +00:00
|
|
|
tagre("img", "src", r"%simages/newpages\.png" % rurl)))
|
2013-04-25 19:38:18 +00:00
|
|
|
help = 'Index format: chapter-number'
|
|
|
|
|
|
|
|
def getIndexStripUrl(self, index):
|
|
|
|
"""Get comic strip URL from index."""
|
|
|
|
chapter, num = index.split('-')
|
|
|
|
return self.stripUrl % (chapter, chapter, num)
|
|
|
|
|
|
|
|
|
2012-12-13 20:05:27 +00:00
|
|
|
# XXX disallowed by robots.txt
|
|
|
|
class _UserFriendly(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://ars.userfriendly.org/cartoons/?mode=classic'
|
|
|
|
stripUrl = url + '&id=%s'
|
|
|
|
starter = bounceStarter(url, compile(r'<area shape="rect" href="(/cartoons/\?id=\d{8}&mode=classic)" coords="[\d, ]+?" alt="">'))
|
2012-12-07 23:45:18 +00:00
|
|
|
imageSearch = compile(r'<img border="0" src="\s*(http://www.userfriendly.org/cartoons/archives/\d{2}\w{3}/.+?\.gif)"')
|
2012-06-20 19:58:13 +00:00
|
|
|
prevSearch = compile(r'<area shape="rect" href="(/cartoons/\?id=\d{8}&mode=classic)" coords="[\d, ]+?" alt="Previous Cartoon">')
|
|
|
|
help = 'Index format: yyyymmdd'
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def namer(cls, imageUrl, pageUrl):
|
|
|
|
return 'uf%s' % (getQueryParams(pageUrl)['id'][0][2:],)
|