# -*- coding: utf-8 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2016 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from re import compile, escape, IGNORECASE
from ..scraper import _BasicScraper, _ParserScraper
from ..helpers import indirectStarter
from ..util import tagre
from .common import _WordPressScraper
class TheBrads(_BasicScraper):
url = 'http://bradcolbow.com/archive/C4/'
stripUrl = url + '%s/'
firstStripUrl = stripUrl % 'P125'
imageSearch = compile(tagre("img", "src", r'(http://s3\.amazonaws\.com/the_brads/the-?brads[-_][^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://bradcolbow\.com/archive/C4/[^"]+)', before="prev"))
multipleImagesPerStrip = True
help = 'Index format: a letter and a number'
class TheDevilsPanties(_BasicScraper):
url = 'http://thedevilspanties.com/'
stripUrl = url + 'archives/%s'
firstStripUrl = stripUrl % '300'
imageSearch = compile(tagre("img", "src", r'(http://cdn\.thedevilspanties\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(/archives/\d+)',
after="Previous"))
help = 'Index format: number'
class TheDreamlandChronicles(_WordPressScraper):
url = 'http://www.thedreamlandchronicles.com/'
class TheGamerCat(_ParserScraper):
url = "http://www.thegamercat.com/"
stripUrl = url + "comic/%s/"
firstStripUrl = stripUrl % "06102011"
css = True
imageSearch = '#comic img'
prevSearch = '.comic-nav-previous'
help = 'Index format: stripname'
class TheGentlemansArmchair(_WordPressScraper):
url = 'http://thegentlemansarmchair.com/'
class TheLandscaper(_BasicScraper):
url = 'http://landscaper.visual-assault.net/comic/latest'
rurl = escape(url)
stripUrl = url + 'comic/%s'
firstStripUrl = stripUrl % '1'
imageSearch = compile(tagre("img", "src",
r'(/comics/comic/comic_page/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(/comic/[^"]+)') +
'‹ Previous')
help = 'Index format: name'
class TheMelvinChronicles(_WordPressScraper):
url = 'http://melvin.jeaniebottle.com/'
class TheNoob(_BasicScraper):
url = 'http://www.thenoobcomic.com/index.php'
stripUrl = url + '?pos=%s'
firstStripUrl = stripUrl % '1'
imageSearch = compile(tagre("img", "src", r'(/headquarters/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(\?pos=\d+)',
before="comic_nav_previous_button"))
help = 'Index format: nnnn'
class TheOrderOfTheStick(_BasicScraper):
url = 'http://www.giantitp.com/'
stripUrl = url + 'comics/oots%s.html'
firstStripUrl = stripUrl % '0001'
imageSearch = compile(r'')
prevSearch = compile(r'')
multipleImagesPerStrip = True
prevSearch = compile(r'\d{4} -\s+\d{4}')
help = 'Index format: nnn'
class TheThinHLine(_BasicScraper):
url = 'http://thinhline.tumblr.com/'
rurl = escape(url)
stripUrl = url + 'post/%s'
firstStripUrl = stripUrl % '3517345105'
imageSearch = compile(tagre('img', 'data-src',
r'([^"]+media.tumblr.com/[^"]+)',
before='content-image'))
prevSearch = compile(tagre("a", "href", r'([^"]+)') + '>')
latestSearch = compile(tagre("a", "href", r'([^"]+)',
after='class="timestamp"'))
starter = indirectStarter
adult = True
indirectImageSearch = compile(tagre('a', 'href', r'(%simage/\d+)' % rurl))
def getComicStrip(self, url, data):
"""The comic strip image is in a separate page."""
pageUrl = self.fetchUrl(url, data, self.indirectImageSearch)
pageData = self.getPage(pageUrl)
return super(TheThinHLine, self).getComicStrip(pageUrl, pageData)
def namer(self, image_url, page_url):
"""Use page URL sequence which is apparently increasing."""
num = page_url.split('/')[-1]
ext = image_url.rsplit('.', 1)[1]
return "thethinhline-%s.%s" % (num, ext)
class TheWhiteboard(_BasicScraper):
url = 'http://www.the-whiteboard.com/'
stripUrl = url + 'auto%s.html'
imageSearch = compile(r'', IGNORECASE)
prevSearch = compile(r' previous', IGNORECASE)
help = 'Index format: twb or wb + n wg. twb1000'
class TheWotch(_BasicScraper):
url = 'http://www.thewotch.com/'
stripUrl = url + '?date=%s'
firstStripUrl = stripUrl % '2002-11-21'
imageSearch = compile(r"