Add Sleepless Domain.
This commit is contained in:
parent
0b6d7425e1
commit
88e387ad15
1 changed files with 26 additions and 1 deletions
|
@ -3,7 +3,8 @@
|
|||
# Copyright (C) 2012-2014 Bastian Kleineidam
|
||||
|
||||
from re import compile, escape, IGNORECASE, sub
|
||||
from os.path import splitext
|
||||
from os.path import splitext, basename
|
||||
from datetime import datetime
|
||||
from ..scraper import _BasicScraper, _ParserScraper
|
||||
from ..helpers import indirectStarter, bounceStarter
|
||||
from ..util import tagre, getPageContent
|
||||
|
@ -256,6 +257,30 @@ class SkinDeep(_BasicScraper):
|
|||
help = 'Index format: custom'
|
||||
|
||||
|
||||
class SleeplessDomain(_ParserScraper):
|
||||
url = 'http://www.sleeplessdomain.com/'
|
||||
stripUrl = url + 'comic/%s'
|
||||
firstStripUrl = stripUrl % 'chapter-1-cover'
|
||||
css = True
|
||||
imageSearch = 'img#cc-comic'
|
||||
prevSearch = 'div.nav a.prev'
|
||||
starter = bounceStarter(url, 'div.nav a.next')
|
||||
help = 'Index format: chapter-X-page-Y (unpadded)'
|
||||
|
||||
@classmethod
|
||||
def namer(cls, imageUrl, pageUrl):
|
||||
"""Image file name is UNIX time stamp & something for most of the comics..."""
|
||||
start = ''
|
||||
tsmatch = compile(r'/(\d+)-').search(imageUrl)
|
||||
if tsmatch:
|
||||
start = datetime.utcfromtimestamp(int(tsmatch.group(1))).strftime("%Y-%m-%d")
|
||||
else:
|
||||
# There were only chapter 1, page 4 and 5 not matching when writing
|
||||
# this...
|
||||
start = '2015-04-11x'
|
||||
return start + "-" + pageUrl.rsplit('/', 1)[-1]
|
||||
|
||||
|
||||
class SluggyFreelance(_BasicScraper):
|
||||
url = 'http://www.sluggy.com/'
|
||||
stripUrl = url + 'comics/archives/daily/%s'
|
||||
|
|
Loading…
Reference in a new issue