dosage/dosagelib/plugins/n.py

141 lines
4.7 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2016-10-28 22:21:41 +00:00
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
2014-01-05 15:50:57 +00:00
# Copyright (C) 2012-2014 Bastian Kleineidam
2017-02-13 21:41:17 +00:00
# Copyright (C) 2015-2017 Tobias Gruetzmacher
2012-06-20 19:58:13 +00:00
from __future__ import absolute_import, division, print_function
from re import compile, escape
2016-05-05 18:55:14 +00:00
from ..scraper import _BasicScraper, _ParserScraper
2017-05-21 23:17:05 +00:00
from ..helpers import indirectStarter
2012-11-21 20:57:26 +00:00
from ..util import tagre
2017-05-21 23:17:05 +00:00
from .common import _ComicControlScraper, _WordPressScraper, _WPNavi, WP_LATEST_SEARCH
2012-06-20 19:58:13 +00:00
class Namesake(_ComicControlScraper):
2013-03-03 21:41:11 +00:00
url = 'http://namesakecomic.com/'
2016-05-05 18:55:14 +00:00
class NamirDeiter(_ParserScraper):
baseUrl = 'http://www.namirdeiter.com/comics/'
stripUrl = baseUrl + 'index.php?date=%s'
url = stripUrl % '20150410'
firstStripUrl = baseUrl
imageSearch = '//a/img'
prevSearch = '//a[text()="Previous"]'
endOfLife = True
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyymmdd'
2013-07-10 16:43:53 +00:00
class NatalieDee(_BasicScraper):
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"))
2013-07-10 16:43:53 +00:00
prevSearch = compile(tagre("a", "href", r'([^"]+)') + "<< Yesterday")
help = 'Index format: mmddyy'
def namer(self, image_url, page_url):
unused, date, filename = image_url.rsplit('/', 2)
2013-07-10 16:43:53 +00:00
return '%s-%s' % (date, filename)
class Nedroid(_WordPressScraper):
url = 'http://nedroid.com/'
prevSearch = '//a[@rel="prev"]'
2012-06-20 19:58:13 +00:00
class NeoEarth(_BasicScraper):
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 NerfNow(_WordPressScraper):
url = 'https://www.nerfnow.com/'
prevSearch = '//li[@id="nav_previous"]/a'
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 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)'))
latestSearch = compile(tagre("a", "href", r'([^"]*toondb/\d+\.html)'))
2012-06-20 19:58:13 +00:00
help = 'Index format: yymmdd'
starter = indirectStarter
2012-06-20 19:58:13 +00:00
2017-05-21 23:17:05 +00:00
class Nicky510(_WPNavi):
url = 'http://www.nickyitis.com/'
2014-12-08 13:28:37 +00:00
class Nimona(_BasicScraper):
url = 'http://gingerhaze.com/nimona/'
2016-05-05 18:55:14 +00:00
stripUrl = url + 'comic/%s'
firstStripUrl = stripUrl % "page-1"
2014-12-08 13:28:37 +00:00
imageSearch = compile(tagre("img", "src", r'(http://gingerhaze\.com/sites/default/files/nimona-pages/.+?)'))
prevSearch = compile(r'<a href="(/nimona/comic/[^"]+)"><img src="http://gingerhaze\.com/sites/default/files/comicdrop/comicdrop_prev_label_file\.png"')
help = 'Index format: stripname'
endOfLife = True
2012-06-20 19:58:13 +00:00
class NobodyScores(_BasicScraper):
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 NoMoreSavePoints(_WordPressScraper):
url = 'http://www.flowerlarkstudios.com/comic/no-more-save-points/mushroom-hopping/'
firstStripUrl = url
latestSearch = WP_LATEST_SEARCH
starter = indirectStarter
2016-05-05 18:55:14 +00:00
class NoNeedForBushido(_ParserScraper):
2013-11-12 17:33:14 +00:00
url = 'http://nn4b.com/'
2016-05-05 18:55:14 +00:00
stripUrl = url + 'comic/%s'
imageSearch = '//div[@id="comic-image"]//img'
prevSearch = '//a[@rel="prev"]'
2013-11-12 17:33:14 +00:00
help = 'Index format: nnn'
2013-03-06 19:21:10 +00:00
2016-05-05 18:55:14 +00:00
class NotInventedHere(_ParserScraper):
url = 'http://notinventedhe.re/'
2016-05-05 18:55:14 +00:00
stripUrl = url + 'on/%s'
firstStripUrl = stripUrl % '2009-9-21'
imageSearch = '//div[@id="comic-content"]//img'
prevSearch = '//a[@id="nav-previous"]'
help = 'Index format: yyyy-m-d'
2013-03-06 19:21:10 +00:00
2013-03-06 19:21:10 +00:00
class Nukees(_BasicScraper):
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'