dosage/dosagelib/plugins/webcomicnation.py

32 lines
1.1 KiB
Python
Raw Normal View History

2012-11-26 06:13:32 +00:00
# -*- 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-11-26 06:13:32 +00:00
from re import compile, IGNORECASE, DOTALL
from ..scraper import make_scraper
_imageSearch = compile(r'<a name="strip\d*?">.*?<img[^>]+?src="([^"]*?memberimages/.+?)"', IGNORECASE + DOTALL)
_prevSearch = compile(r'href="([^"]*?whichbutton=prev[^"]*?)"', IGNORECASE)
2012-11-26 06:13:32 +00:00
def add(name, subpath):
baseUrl = 'http://www.webcomicsnation.com/'
classname = 'WebcomicsNation_%s' % name
globals()[classname] = make_scraper(classname,
name = 'WebcomicsNation/' + name,
url = baseUrl + subpath,
2012-11-26 06:13:32 +00:00
stripUrl = baseUrl + '?view=archive&amp;chapter=%s',
imageSearch = _imageSearch,
2012-12-05 20:52:52 +00:00
multipleImagesPerStrip = True,
prevSearch = _prevSearch,
2012-12-05 20:52:52 +00:00
# the prevSearch is a redirect
prevUrlMatchesStripUrl = False,
2012-11-26 06:13:32 +00:00
help = 'Index format: nnnn (non-contiguous)',
)
add('AgnesQuill', 'daveroman/agnes/')
add('MyMuse', 'gc/muse/')
add('NekkoAndJoruba', 'nekkoandjoruba/nekkoandjoruba/')
add('ClownSamurai', 'qsamurai/clownsamurai/')