dosage/dosagelib/plugins/l.py

102 lines
3.7 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2014-01-05 15:50:57 +00:00
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2016 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
2012-06-20 19:58:13 +00:00
from re import compile, escape
from ..scraper import _BasicScraper, _ParserScraper
2013-04-25 19:06:12 +00:00
from ..helpers import bounceStarter, indirectStarter
2012-11-21 20:57:26 +00:00
from ..util import tagre
from .common import _ComicControlScraper, _WordPressScraper, WP_LATEST_SEARCH
2012-06-20 19:58:13 +00:00
2013-04-25 19:06:12 +00:00
class Lackadaisy(_BasicScraper):
baseUrl = 'http://lackadaisy.foxprints.com/'
url = baseUrl + 'comic.php'
stripUrl = baseUrl + 'comic.php?comicid=%s'
firstStripUrl = stripUrl % '1'
imageSearch = compile(tagre("img", "src", r'(http://www\.lackadaisycats\.com/comic/[^"]*)'))
prevSearch = compile(tagre("a", "href", r"(/comic\.php\?comicid=[0-9]+)") +
"< Previous")
nextSearch = compile(tagre("a", "href", r"(/comic.php\?comicid=[0-9]+)") +
"Next")
2013-04-25 19:06:12 +00:00
help = 'Index format: n'
starter = bounceStarter
2013-04-25 19:06:12 +00:00
def namer(self, image_url, page_url):
2013-04-25 19:06:12 +00:00
"""Use comic id for filename."""
num = page_url.rsplit('=', 1)[-1]
ext = image_url.rsplit('.', 1)[-1]
2013-04-25 19:06:12 +00:00
return 'lackadaisy_%s.%s' % (num, ext)
class Laiyu(_WordPressScraper):
url = 'http://www.flowerlarkstudios.com/comic/preliminary-concepts/welcome/'
firstStripUrl = url
latestSearch = WP_LATEST_SEARCH
starter = indirectStarter
2012-06-20 19:58:13 +00:00
class LasLindas(_BasicScraper):
url = 'http://laslindas.katbox.net/'
rurl = escape(url)
2013-02-19 19:58:04 +00:00
stripUrl = url + 'comic/%s/'
imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/[^"]+)' % rurl, after="attachment-full"))
2013-04-04 16:30:02 +00:00
multipleImagesPerStrip = True
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
2016-01-03 01:16:58 +00:00
class LastNerdsOnEarth(_ParserScraper):
url = 'http://www.lastnerdsonearth.com/latest/'
imageSearch = '//div[@id="content"]/a/img'
prevSearch = '//div[@id="comicnav"]/a[last()-2]'
2013-03-06 19:21:10 +00:00
class LeastICouldDo(_BasicScraper):
url = 'http://www.leasticoulddo.com/'
rurl = escape(url)
2013-03-06 19:21:10 +00:00
stripUrl = url + 'comic/%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '20130109'
2013-11-12 17:33:14 +00:00
imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/\d{8,9}\.\w{1,4})' % rurl))
prevSearch = compile(tagre("a", "href", r'(%scomic/\d+/)' % rurl,
after="Previous"))
latestSearch = compile(tagre("a", "href", r'(%scomic/\d+/)' % rurl,
after="feature-comic"))
starter = indirectStarter
2013-03-06 19:21:10 +00:00
help = 'Index format: yyyymmdd'
class LetsSpeakEnglish(_ComicControlScraper):
url = 'http://www.marycagle.com'
2013-03-06 19:21:10 +00:00
class LittleGamers(_BasicScraper):
url = 'http://www.little-gamers.com/'
stripUrl = url + '%s/'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '2000/12/01/99'
2013-03-06 19:21:10 +00:00
imageSearch = compile(tagre("img", "src", r'(http://little-gamers\.com/comics/[^"]+)'))
2013-03-26 16:36:06 +00:00
prevSearch = compile(tagre("a", "href", r'(http://www\.little-gamers\.com/[^"]+)', before="comic-nav-prev-link"))
2013-03-06 19:21:10 +00:00
help = 'Index format: yyyy/mm/dd/name'
2015-05-31 23:33:50 +00:00
class LoadingArtist(_ParserScraper):
url = 'http://www.loadingartist.com/comic/new-update/'
imageSearch = '//div[@class="comic"]//img'
prevSearch = "//a[contains(concat(' ', @class, ' '), ' prev ')]"
class LookingForGroup(_ParserScraper):
2013-02-12 16:55:13 +00:00
url = 'http://www.lfgcomic.com/'
stripUrl = url + 'page/%s/'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '1'
css = True
imageSearch = '#comic img'
prevSearch = '#comic-left > a'
latestSearch = '#header-dropdown-comic-lfg > a:nth-of-type(2)'
starter = indirectStarter
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'