dosage/dosagelib/plugins/k.py

77 lines
3.1 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
2012-11-21 20:57:26 +00:00
from re import compile, IGNORECASE
2012-10-11 10:03:12 +00:00
from ..scraper import _BasicScraper
2012-12-04 06:02:40 +00:00
from ..util import tagre
2012-06-20 19:58:13 +00:00
class Key(_BasicScraper):
url = 'http://key.shadilyn.com/latestpage.html'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://key.shadilyn.com/pages/%s.html'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'"((?:images/.+?)|(?:pages/images/.+?))"')
prevSearch = compile(r'</a><a href="(.+?html)".+?prev')
help = 'Index format: nnn'
class Krakow(_BasicScraper):
url = 'http://www.krakow.krakowstudios.com/'
stripUrl = url + 'archive.php?date=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(comics/.+?)"')
prevSearch = compile(r'<a href="(archive\.php\?date=.+?)"><img border=0 name=previous_day')
help = 'Index format: yyyymmdd'
class Kukuburi(_BasicScraper):
url = 'http://www.kukuburi.com/current/'
2012-11-21 20:57:26 +00:00
stripUrl = 'http://www.kukuburi.com/v2/%s/'
2012-12-04 06:02:40 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.kukuburi\.com/v2/comics/[^"]+)', after='alt="[^"]'))
2012-06-20 19:58:13 +00:00
prevSearch = compile(r'nav-previous.+?"(http.+?)"')
2012-11-21 20:57:26 +00:00
help = 'Index format: yyyy/mm/dd/stripname'
2012-06-20 19:58:13 +00:00
class KevinAndKell(_BasicScraper):
url = 'http://www.kevinandkell.com/'
stripUrl = url + '%s/kk%s%s.html'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img.+?src="(/?(\d+/)?strips/kk\d+.gif)"', IGNORECASE)
prevSearch = compile(r'<a.+?href="(/?(\.\./)?\d+/kk\d+\.html)"[^>]*><span>Previous Strip', IGNORECASE)
help = 'Index format: yyyy-mm-dd'
def setStrip(self, index):
2012-11-13 18:10:19 +00:00
self.currentUrl = self.stripUrl % tuple(map(int, index.split('-')))
2012-06-20 19:58:13 +00:00
2012-12-08 20:30:51 +00:00
class KhaosKomix(_BasicScraper):
adult = True
url = 'http://www.khaoskomix.com/'
stripUrl = url + 'komix/%s'
2012-12-08 20:30:51 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.khaoskomix\.com/komiximg/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.khaoskomix\.com/komix/[^"]+)', after="Prev"))
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
class KillerKomics(_BasicScraper):
url = 'http://www.killerkomics.com/web-comics/index_ang.cfm'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://www.killerkomics.com/web-comics/%s.cfm'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(http://www.killerkomics.com/FichiersUpload/Comics/.+?)"')
prevSearch = compile(r'<div id="precedent"><a href="(.+?)"')
help = 'Index format: strip-name'
2012-12-08 20:30:51 +00:00
2012-12-13 20:05:27 +00:00
# XXX disallowed by robots.txt
class _Kofightclub(_BasicScraper):
url = 'http://www.kofightclub.com/'
stripUrl = url + 'd/%s.html'
2012-12-08 20:30:51 +00:00
imageSearch = compile(tagre("img", "src", r'(\.\./images/\d+[^"]+)'))
prevSearch = compile(tagre("a", "href", r'((?:http://www\.kofightclub\.com)?/d/\d+\.html)')
+ tagre("img", "alt", "Previous comic"))
help = 'Index format: yyyymmdd'
2012-12-13 20:05:27 +00:00
class KuroShouri(_BasicScraper):
url = 'http://kuroshouri.com/'
stripUrl = url + '?webcomic_post=%s'
2012-12-13 20:05:27 +00:00
imageSearch = compile(tagre("img", "src", r"(http://kuroshouri\.com/wp-content/webcomic/kuroshouri/[^'\"]+)", quote="['\"]"))
prevSearch = compile(tagre("a", "href", r'(http://kuroshouri\.com/\?webcomic_post=[^"]+)', after="previous"))
help = 'Index format: chapter-n-page-m'