Add support for SurvivingTheWorld and TumbleDryComics (#84)

This commit is contained in:
Tim Brier 2017-04-16 00:11:30 +01:00 committed by Tobias Gruetzmacher
parent 0973570295
commit 233da3e052
2 changed files with 43 additions and 0 deletions

View file

@ -492,3 +492,23 @@ class StuffNoOneToldMe(_BasicScraper):
class SupernormalStep(_ComicControlScraper): class SupernormalStep(_ComicControlScraper):
url = 'http://supernormalstep.com/' url = 'http://supernormalstep.com/'
class SurvivingTheWorld(_ParserScraper):
url = 'http://survivingtheworld.net/'
stripUrl = url + '%s'
firstStripUrl = stripUrl % 'Lesson1.html'
imageSearch = [
'//div[@class="img"]/img', # When there's one image per strip
'//div[@class="img"]/p/img', # When there's multiple images per strip
'//td/img' # Special case for Lesson1296.html
]
prevSearch = [
'//li[@class="previous"]/a',
'//td/a' # Special case for Lesson1296.html
]
multipleImagesPerStrip = True
help = 'Index format: name'
def getIndexStripUrl(self, index):
return self.stripUrl % index + ".html"

View file

@ -147,6 +147,29 @@ class TracyAndTristan(_BasicScraper):
help = 'Index format: number' help = 'Index format: number'
class TumbleDryComics(_WordPressScraper):
url = 'http://tumbledrycomics.com/'
firstStripUrl = url + 'comic/we-need-to-get-high-jpg/'
textSearch = '//div[@id="comic"]//img/@alt'
multipleImagesPerStrip = True
adult = True
help = 'Index format: name'
def getIndexStripUrl(self, index):
return self.url + "comics/" + index
def namer(self, image_url, page_url):
# Most images have the date they were posted in the filename
# For those that don't we can get the month and year from the image url
parts = image_url.split('/')
year = parts[5]
month = parts[6]
filename = parts[7]
if not filename.startswith(year):
filename = year + "-" + month + "-" + filename
return filename
class TwoGuysAndGuy(_BasicScraper): class TwoGuysAndGuy(_BasicScraper):
url = 'http://www.twogag.com/' url = 'http://www.twogag.com/'
rurl = escape(url) rurl = escape(url)