dosage/dosagelib/plugins/keenspot.py

118 lines
4.5 KiB
Python
Raw Normal View History

# SPDX-License-Identifier: MIT
2016-10-28 22:21:41 +00:00
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
2014-01-05 15:50:57 +00:00
# Copyright (C) 2012-2014 Bastian Kleineidam
2020-01-09 17:04:09 +00:00
# Copyright (C) 2015-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
2016-10-13 22:14:53 +00:00
from ..scraper import _ParserScraper
2012-06-20 19:58:13 +00:00
2016-10-13 22:14:53 +00:00
class KeenSpot(_ParserScraper):
multipleImagesPerStrip = True
imageSearch = (
'//img[contains(@src, "/comics/")]',
# Shockwave Darkside
'//img[contains(@src, "/comics2D/")]',
'//img[contains(@src, "com/shockwave")]',
# Sore Thumbs
'//img[contains(@src, "com/st2")]',
# Wayward Sons
'//img[contains(@src, "com/2")]',
)
prevSearch = (
2016-10-13 22:14:53 +00:00
'//link[@rel="prev"]',
'//a[@rel="prev"]',
# Exposure
'//a[img[@id="exp29"]]',
# Hero By Night
'//area[contains(@coords, ",-7,")]',
# Katrina
'//a[img[@id="katc7"]]',
# No Room For Magic, Everyone Loves Adis, Wisdom Of Moo
'//a[text()="Previous comic"]',
# Supernovas
'//a[img[@id="p_top_nav"]]',
2012-11-21 20:57:26 +00:00
)
help = 'Index format: yyyymmdd'
2016-10-13 22:14:53 +00:00
def __init__(self, name, sub, last=None, path='d/%s.html'):
super(KeenSpot, self).__init__('KeenSpot/' + name)
self.url = 'http://%s.keenspot.com/' % sub
2016-10-13 22:14:53 +00:00
self.stripUrl = self.url + path
if last:
self.url = self.stripUrl % last
self.endOfLife = True
2012-06-20 19:58:13 +00:00
@classmethod
def getmodules(cls):
2016-10-13 22:14:53 +00:00
return (
# Not on frontpage...
cls('Buzzboy', 'buzzboy'),
cls('EveryoneLovesAdis', 'adis'),
# do not edit anything below since these entries are generated from
# scripts/update_plugins.sh
2016-05-22 20:55:06 +00:00
# START AUTOUPDATE
cls('27TwentySeven', 'twenty-seven'),
2016-10-13 22:14:53 +00:00
cls('Avengelyne', 'avengelyne'),
cls('BanzaiGirl', 'banzaigirl'),
cls('Barker', 'barkercomic'),
cls('ChoppingBlock', 'choppingblock'),
cls('ClichFlamb', 'clicheflambe'),
cls('CountYourSheep', 'countyoursheep'),
2019-06-13 02:26:17 +00:00
cls('CrowScare', 'crowscare', last='20111031'),
cls('Dreamless', 'dreamless', last='20100726'),
cls('EverythingJake', 'everythingjake'),
2016-10-13 22:14:53 +00:00
cls('Exposure', 'exposure'),
cls('FallOutToyWorks', 'fallouttoyworks'),
cls('FriarAndBrimstone', 'friarandbrimstone'),
2019-06-13 02:26:17 +00:00
cls('GeneCatlow', 'genecatlow', last='20170412'),
cls('GodMode', 'godmode'),
cls('GreenWake', 'greenwake'),
cls('HeadTrip', 'headtrip'),
2016-10-13 22:14:53 +00:00
cls('HeroByNight', 'herobynight'),
cls('HoaxHunters', 'hoaxhunters'),
cls('InHere', 'inhere'),
2016-10-13 22:14:53 +00:00
cls('JadeWarriors', 'jadewarriors'),
cls('Katrina', 'katrina'),
2016-10-13 22:14:53 +00:00
cls('LutherStrode', 'lutherstrode'),
cls('MakeshiftMiracle', 'makeshiftmiracle'),
cls('Marksmen', 'marksmen'),
cls('MarryMe', 'marryme'),
cls('MedusasDaughter', 'medusasdaughter'),
cls('MonsterMassacre', 'monstermassacre'),
2019-06-13 02:26:17 +00:00
cls('MysticRevolution', 'mysticrevolution', path='?cid=%s'),
cls('NoPinkPonies', 'nopinkponies'),
2016-10-13 22:14:53 +00:00
cls('NoRoomForMagic', 'noroomformagic'),
cls('OutThere', 'outthere'),
cls('Porcelain', 'porcelain'),
2019-07-10 08:05:36 +00:00
cls('ProjectionEdge', 'newshounds'),
2019-06-13 02:26:17 +00:00
cls('PunchAnPie', 'punchanpie', path='daily/%s.html'),
cls('QUILTBAG', 'quiltbag'),
cls('RedSpike', 'redspike'),
cls('RumbleFall', 'rumblefall'),
cls('SamuraisBlood', 'samuraisblood'),
cls('Sharky', 'sharky'),
2019-06-13 02:26:17 +00:00
cls('ShockwaveDarkside', 'shockwave', path='2d/%s.html'),
cls('SomethingHappens', 'somethinghappens'),
cls('SoreThumbs', 'sorethumbs'),
cls('Striptease', 'striptease'),
2016-10-13 22:14:53 +00:00
cls('Supernovas', 'supernovas'),
cls('Superosity', 'superosity'),
cls('TheFirstDaughter', 'thefirstdaughter'),
2016-10-13 22:14:53 +00:00
cls('TheHopeVirus', 'hopevirus'),
cls('TheHuntersOfSalamanstra', 'salamanstra'),
cls('TheLounge', 'thelounge'),
2016-10-13 22:14:53 +00:00
cls('TheVault', 'thevault'),
cls('WaywardSons', 'waywardsons'),
cls('WeirdingWillows', 'weirdingwillows'),
cls('WICKEDPOWERED', 'wickedpowered'),
2016-10-13 22:14:53 +00:00
cls('WisdomOfMoo', 'wisdomofmoo'),
2016-05-22 20:55:06 +00:00
# END AUTOUPDATE
2016-10-13 22:14:53 +00:00
)
def shouldSkipUrl(self, url, data):
return url in (
'http://sorethumbs.keenspot.com/d/20160117.html'
)