dosage/dosagelib/plugins/n.py

175 lines
6.7 KiB
Python
Raw Normal View History

# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2013-02-05 18:51:46 +00:00
# Copyright (C) 2012-2013 Bastian Kleineidam
2012-06-20 19:58:13 +00:00
from re import compile, escape
2012-10-11 10:03:12 +00:00
from ..scraper import _BasicScraper
2012-12-04 06:02:40 +00:00
from ..helpers import indirectStarter, bounceStarter
2012-11-21 20:57:26 +00:00
from ..util import tagre
2012-06-20 19:58:13 +00:00
2013-03-03 21:41:11 +00:00
class Namesake(_BasicScraper):
url = 'http://namesakecomic.com/'
2013-04-10 21:57:09 +00:00
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % 'prologue-cover-3'
2013-03-03 21:41:11 +00:00
imageSearch = compile(tagre("img", "src", r'([^"]*/wp-content/uploads/[^"]+)', after='title='))
prevSearch = compile(tagre("a", "href", r'([^"]*/comic/[^"]+)', after='navi-prev'))
help = 'Index format: name'
@classmethod
def namer(cls, imageUrl, pageUrl):
imgmatch = compile(r'uploads/(\d+)/(\d+)/(.+)$').search(imageUrl)
return '-'.join(imgmatch.groups())
2012-06-20 19:58:13 +00:00
class NamirDeiter(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'Namir Deiter, by Isabel Marks'
url = 'http://www.namirdeiter.com/'
rurl = escape(url)
stripUrl = url + 'comics/index.php?date=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '19991128'
imageSearch = compile(tagre("img", "src", r"'?(%scomics/\d+\.jpg)'?" % rurl, quote=""))
prevSearch = compile(tagre("a", "href", r'(%scomics/index\.php\?date=\d+)' % rurl, quote="'")+"Previous")
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyymmdd'
2013-07-10 16:43:53 +00:00
class NatalieDee(_BasicScraper):
description = u"America's Favorite Cracker"
url = 'http://www.nataliedee.com/'
rurl = escape(url)
2013-07-18 18:39:53 +00:00
stripUrl = url + '%s'
2013-07-10 16:43:53 +00:00
firstStripUrl = stripUrl % '022806'
imageSearch = compile(tagre("img", "src", r'(%s\d+/[^"]+)' % rurl, before="overflow"))
prevSearch = compile(tagre("a", "href", r'([^"]+)') + "<< Yesterday")
help = 'Index format: mmddyy'
@classmethod
def namer(cls, imageUrl, pageUrl):
unused, date, filename = imageUrl.rsplit('/', 2)
return '%s-%s' % (date, filename)
2013-02-06 06:03:29 +00:00
class Nedroid(_BasicScraper):
url = 'http://nedroid.com/'
rurl = escape(url)
2013-02-06 06:03:29 +00:00
stripUrl = url + '%s/'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '2005/09/2210-whee'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s\d+/\d+/[^"]+)' % rurl, after="prev"))
2013-02-06 06:03:29 +00:00
help = 'Index format: yyyy/mm/dd/name'
2012-06-20 19:58:13 +00:00
class NeoEarth(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'Neo-Earth - Web comic by Bryan King - Updated Every Monday'
url = 'http://www.neo-earth.com/NE/'
stripUrl = url + 'index.php?date=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '2007-03-23'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(strips/.+?)"')
prevSearch = compile(r'<a href="(.+?)">Previous</a>')
help = 'Index format: yyyy-mm-dd'
class NewAdventuresOfBobbin(_BasicScraper):
url = 'http://www.bobbin-comic.com/bobbin_strips/'
2012-11-21 20:57:26 +00:00
imageSearch = compile(tagre("a", "href", r'(\d+\.gif)'))
2012-12-07 23:45:18 +00:00
multipleImagesPerStrip = True
2012-11-21 20:57:26 +00:00
help = 'Index format: none'
2012-06-20 19:58:13 +00:00
class NewWorld(_BasicScraper):
url = 'http://www.tfsnewworld.com/'
2013-04-10 21:57:09 +00:00
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2007/08/30/63'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(http://www.tfsnewworld.com/comics/.+?)"')
prevSearch = compile(r'<div class="nav-previous"><a href="([^"]+)" rel="prev">')
help = 'Index format: yyyy/mm/dd/stripn'
class Nicky510(_BasicScraper):
url = 'http://www.nickyitis.com/'
rurl = escape(url)
stripUrl = url + '%s/'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % 'close-enough'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%scomic/[^"]+)' % rurl, after="Previous"))
2012-11-21 20:57:26 +00:00
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class NekkoAndJoruba(_BasicScraper):
url = 'http://www.nekkoandjoruba.com/'
stripUrl = url + '?p=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '7'
imageSearch = compile(r'<img src="(http://www\.nekkoandjoruba\.com/comics/.+?)"')
2013-03-06 19:21:10 +00:00
prevSearch = compile(r'<a href="(.+?)">&lsaquo;</a>')
help = 'Index format: nnn'
2012-06-20 19:58:13 +00:00
2012-12-04 06:02:40 +00:00
class NekoTheKitty(_BasicScraper):
url = 'http://www.nekothekitty.net/'
rurl = escape(url)
stripUrl = url + 'comics/%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '936393/001-video-games'
starter = bounceStarter(url, compile(tagre("a", "href", r'(%scomics/[^"]+)' % rurl) +
tagre("img", "src", r'%sfiles/smallnext\.png' % rurl)))
2012-12-04 06:02:40 +00:00
imageSearch = compile(tagre("img", "src", r'(http://(?:img\d+|www)\.smackjeeves\.com/images/uploaded/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(%scomics/[^"]+)' % rurl) +
tagre("img", "src", r'%sfiles/smallprev\.png' % rurl))
2012-12-04 06:02:40 +00:00
help = 'Index format: n/n-name'
2012-06-20 19:58:13 +00:00
class NichtLustig(_BasicScraper):
url = 'http://www.nichtlustig.de/main.html'
2012-12-04 06:02:40 +00:00
stripUrl = 'http://static.nichtlustig.de/toondb/%s.html'
2013-03-08 21:33:05 +00:00
lang = 'de'
2012-11-21 20:57:26 +00:00
imageSearch = compile('background-image:url\((http://static\.nichtlustig\.de/comics/full/\d+\.jpg)')
prevSearch = compile(tagre("a", "href", r'(http://static\.nichtlustig\.de/toondb/\d+\.html)'))
2012-06-20 19:58:13 +00:00
help = 'Index format: yymmdd'
starter = indirectStarter(url,
2012-11-21 20:57:26 +00:00
compile(tagre("a", "href", r'([^"]*toondb/\d+\.html)')))
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class Nnewts(_BasicScraper):
url = 'http://nnewts.com/'
rurl = escape(url)
2013-03-06 19:21:10 +00:00
stripUrl = url + '%s/'
firstStripUrl = stripUrl % 'nnewts-page-1'
imageSearch = compile(tagre("img", "src", r'(%snewty/comics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s(?:nnewts-)?page-\d+/)' % rurl, after="navi-prev"))
2013-03-06 19:21:10 +00:00
help = 'Index format: page-number'
2012-06-20 19:58:13 +00:00
class NobodyScores(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'Nobody Scores! A little comic about inevitable disaster'
url = 'http://nobodyscores.loosenutstudio.com/'
rurl = escape(url)
stripUrl = url + 'index.php?id=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '4'
imageSearch = compile(tagre("img", "src", r'(%scomix/[^"]+)' % rurl))
2012-12-04 06:02:40 +00:00
multipleImagesPerStrip = True
prevSearch = compile(r'<a href="(%sindex.php.+?)">the one before </a>' % rurl)
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'
2013-03-06 19:21:10 +00:00
class NoNeedForBushido(_BasicScraper):
2013-11-12 17:33:14 +00:00
url = 'http://nn4b.com/'
rurl = escape(url)
stripUrl = url + '?webcomic1=%s'
imageSearch = compile(
tagre("a", "rel", "next") +
tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/[^"]+)' % rurl,
after="attachment-full"))
prevSearch = compile(tagre("a", "href", r'(%s\?webcomic1=[^"]+)' % rurl, after="previous-webcomic"))
help = 'Index format: nnn'
starter = indirectStarter(url,
compile(tagre("a", "href", r'(%s\?webcomic1=[^"]+)' % rurl, after="last-webcomic")))
2013-03-06 19:21:10 +00:00
class Nukees(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'Nukees, The Atomic Comic Strip'
2013-03-06 19:21:10 +00:00
url = 'http://www.nukees.com/'
stripUrl = url + 'd/%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '19970121'
2013-03-06 19:21:10 +00:00
imageSearch = compile(r'"comic".+?"(/comics/.+?)"')
prevSearch = compile(r'"(/d/.+?)".+?previous')
help = 'Index format: yyyymmdd.html'