2020-04-18 11:45:44 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2023-06-10 13:05:57 +00:00
|
|
|
# SPDX-FileCopyrightText: © 2004 Tristan Seligmann and Jonathan Jacobs
|
|
|
|
# SPDX-FileCopyrightText: © 2012 Bastian Kleineidam
|
|
|
|
# SPDX-FileCopyrightText: © 2015 Tobias Gruetzmacher
|
|
|
|
# SPDX-FileCopyrightText: © 2019 Daniel Ring
|
2016-10-05 22:42:50 +00:00
|
|
|
import os
|
2023-09-24 05:29:30 +00:00
|
|
|
from re import compile, sub, IGNORECASE
|
2012-06-20 19:58:13 +00:00
|
|
|
|
2020-07-31 20:56:30 +00:00
|
|
|
from ..helpers import bounceStarter, indirectStarter
|
2023-06-10 13:05:57 +00:00
|
|
|
from ..scraper import ParserScraper, _BasicScraper, _ParserScraper
|
2012-11-20 17:53:53 +00:00
|
|
|
from ..util import tagre
|
2022-06-06 10:08:32 +00:00
|
|
|
from .common import ComicControlScraper, WordPressScraper, WordPressNavi
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2015-05-31 23:19:02 +00:00
|
|
|
class EarthsongSaga(_ParserScraper):
|
2020-09-26 09:29:45 +00:00
|
|
|
stripUrl = 'http://earthsongsaga.com/vol%s'
|
|
|
|
url = stripUrl % '5/epilogue5.php'
|
|
|
|
firstStripUrl = stripUrl % '1/vol1cover.php'
|
|
|
|
imageSearch = '//img[contains(@src, "images/vol")]'
|
|
|
|
prevSearch = ('//a[@title="Previous"]', '//td[@width=98]//a')
|
2017-05-16 22:11:29 +00:00
|
|
|
endOfLife = True
|
2013-03-06 19:21:10 +00:00
|
|
|
|
2016-04-21 06:20:49 +00:00
|
|
|
def namer(self, image_url, page_url):
|
2020-09-26 09:29:45 +00:00
|
|
|
imgmatch = compile(r'images/vol(\d+)/ch(?:apter)?(\d+)/(.*)\.\w+$',
|
2016-04-21 06:20:49 +00:00
|
|
|
IGNORECASE).search(image_url)
|
2020-09-26 09:29:45 +00:00
|
|
|
if imgmatch:
|
|
|
|
return 'vol%02d_ch%02d_%s' % (int(imgmatch.group(1)),
|
|
|
|
int(imgmatch.group(2)), imgmatch.group(3))
|
|
|
|
imgmatch = compile(r'images/vol(\d+)/[^/]*cover[^/]*$',
|
|
|
|
IGNORECASE).search(image_url)
|
|
|
|
return 'vol%02dcover' % (int(imgmatch.group(1)))
|
|
|
|
|
|
|
|
def getPrevUrl(self, url, data):
|
|
|
|
# Fix wrong navigation links
|
|
|
|
if url == self.stripUrl % '1/63.php':
|
|
|
|
return self.stripUrl % '1/62.php'
|
|
|
|
elif url == self.stripUrl % '2/vol2cover.html':
|
|
|
|
return self.stripUrl % '1/121.php'
|
|
|
|
elif url == self.stripUrl % '3/1.html':
|
|
|
|
return self.stripUrl % '3/ch7cover.html'
|
|
|
|
|
|
|
|
return super().getPrevUrl(url, data)
|
2013-03-06 19:21:10 +00:00
|
|
|
|
|
|
|
|
2016-05-16 21:16:29 +00:00
|
|
|
class EatLiver(_ParserScraper):
|
2013-07-16 16:01:44 +00:00
|
|
|
url = 'http://www.eatliver.com/'
|
2016-04-13 18:01:51 +00:00
|
|
|
starter = indirectStarter
|
2016-05-16 21:16:29 +00:00
|
|
|
multipleImagesPerStrip = True
|
2020-07-31 20:56:30 +00:00
|
|
|
imageSearch = '//div[d:class("post-content")]//img'
|
2016-05-16 21:16:29 +00:00
|
|
|
prevSearch = '//a[@rel="prev"]'
|
|
|
|
latestSearch = '//a[@rel="bookmark"]'
|
2013-07-16 16:01:44 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class EatThatToast(WordPressScraper):
|
2014-01-13 00:03:49 +00:00
|
|
|
url = 'http://eatthattoast.com/'
|
2016-10-31 05:57:47 +00:00
|
|
|
firstStripUrl = url + 'comic/thewizard/'
|
2022-06-06 10:08:32 +00:00
|
|
|
textSearch = WordPressScraper.imageSearch + '/@alt'
|
2014-01-13 00:03:49 +00:00
|
|
|
|
|
|
|
|
2012-12-08 20:30:51 +00:00
|
|
|
class EdibleDirt(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://eddirt.frozenreality.co.uk/'
|
|
|
|
stripUrl = url + 'index.php?id=%s'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '0'
|
2012-12-08 20:30:51 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(strips/[^"]+)'))
|
2016-04-03 20:58:01 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r"(index\.php\?id=\d+)") +
|
|
|
|
"Previous")
|
2012-12-08 20:30:51 +00:00
|
|
|
help = 'Index format: number'
|
|
|
|
|
2016-03-31 21:13:54 +00:00
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class EdmundFinney(WordPressNavi):
|
2013-12-10 18:50:21 +00:00
|
|
|
url = 'http://eqcomics.com/'
|
2016-03-14 07:32:18 +00:00
|
|
|
firstStripUrl = url + '2009/03/08/sunday-aliens/'
|
2012-12-08 20:30:51 +00:00
|
|
|
|
2016-03-31 21:13:54 +00:00
|
|
|
|
2012-12-08 20:30:51 +00:00
|
|
|
class ElfOnlyInn(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.elfonlyinn.net/'
|
|
|
|
stripUrl = url + 'd/%s.html'
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '20020523'
|
2012-12-08 20:30:51 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(/comics/[^"]+)'))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'(/d/\d+\.html)') +
|
2016-03-31 21:13:54 +00:00
|
|
|
tagre("img", "src", r'/images/previous_day\.gif'))
|
2012-12-08 20:30:51 +00:00
|
|
|
help = 'Index format: yyyymmdd'
|
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class ElGoonishShive(ComicControlScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.egscomics.com/'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class ElGoonishShiveNP(ComicControlScraper):
|
2013-11-12 17:33:14 +00:00
|
|
|
url = 'http://www.egscomics.com/egsnp.php'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
class EmergencyExit(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.eecomics.net/'
|
|
|
|
stripUrl = url + "?strip_id=%s"
|
2013-04-10 21:57:09 +00:00
|
|
|
firstStripUrl = stripUrl % '1'
|
2012-06-20 19:58:13 +00:00
|
|
|
imageSearch = compile(r'"(comics/.+?)"')
|
2012-12-04 06:02:40 +00:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(\?strip_id=\d+)') + tagre("img", "alt", r"Prior"))
|
|
|
|
help = 'Index format: n'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2023-06-10 13:05:57 +00:00
|
|
|
class Erfworld(ParserScraper):
|
2019-08-05 09:00:56 +00:00
|
|
|
stripUrl = 'https://archives.erfworld.com/%s'
|
|
|
|
url = stripUrl % 'getLatestPage.php'
|
2021-08-18 12:19:08 +00:00
|
|
|
firstStripUrl = stripUrl % 'Kickstarter+Stories/1'
|
2019-08-05 09:00:56 +00:00
|
|
|
imageSearch = '//div[@class="page_content"]//img'
|
|
|
|
textSearch = '//div[@class="page_content"]'
|
|
|
|
prevSearch = '//li[@class="previous"]/a'
|
|
|
|
nextSearch = '//li[@class="next"]/a'
|
|
|
|
multipleImagesPerStrip = True
|
|
|
|
textOptional = True
|
|
|
|
starter = bounceStarter
|
|
|
|
|
2023-06-10 13:05:57 +00:00
|
|
|
def shouldSkipUrl(self, url, data):
|
|
|
|
"""Skip pages without images."""
|
|
|
|
return not data.xpath(self.imageSearch)
|
2019-08-05 09:00:56 +00:00
|
|
|
|
|
|
|
def namer(self, imageUrl, pageUrl):
|
|
|
|
# Fix inconsistent filenames
|
|
|
|
filename = imageUrl.rsplit('/', 1)[-1]
|
|
|
|
page = pageUrl.replace('+', '-').rsplit('/', 2)
|
|
|
|
return '%s_%s_%s' % (page[1], page[2], filename)
|
|
|
|
|
|
|
|
def getPrevUrl(self, url, data):
|
|
|
|
# Fix missing navigation links between books
|
|
|
|
if url == self.stripUrl % 'Book+5/1':
|
|
|
|
return self.stripUrl % 'Book+4/203'
|
|
|
|
elif url == self.stripUrl % 'Book+4/1':
|
|
|
|
return self.stripUrl % 'Book+3/145'
|
|
|
|
elif url == self.stripUrl % 'Book+3/1':
|
|
|
|
return self.stripUrl % 'Book+2/231'
|
|
|
|
elif url == self.stripUrl % 'Book+2/1':
|
|
|
|
return self.stripUrl % 'Book+1/184'
|
2021-08-18 12:19:08 +00:00
|
|
|
elif url == self.stripUrl % 'Book+1/1':
|
2019-08-05 09:00:56 +00:00
|
|
|
return self.stripUrl % 'Book+0/81'
|
2021-08-18 12:19:08 +00:00
|
|
|
elif url == self.stripUrl % 'Book+0/1':
|
|
|
|
return self.stripUrl % 'Kickstarter+Stories/54'
|
2023-06-10 13:05:57 +00:00
|
|
|
return super().getPrevUrl(url, data)
|
2019-08-05 09:00:56 +00:00
|
|
|
|
|
|
|
|
2019-07-03 06:34:52 +00:00
|
|
|
class ErmaFelnaEDF(_ParserScraper):
|
|
|
|
stripUrl = 'https://www.stevegallacci.com/archive/edf/%s'
|
|
|
|
firstStripUrl = stripUrl % '0000/00/00'
|
|
|
|
url = firstStripUrl
|
|
|
|
imageSearch = '//img[@id="comic-container"]'
|
|
|
|
prevSearch = '//a[@title="Previous Comic"]'
|
|
|
|
latestSearch = '//a[@title="Current Comic"]'
|
|
|
|
starter = indirectStarter
|
|
|
|
|
|
|
|
def namer(self, imageUrl, pageUrl):
|
|
|
|
# Fix inconsistent filenames
|
|
|
|
postDate = pageUrl.rsplit('/', 3)
|
|
|
|
filename = imageUrl.rsplit('/', 1)[-1]
|
|
|
|
return '%s-%s-%s_%s' % (postDate[1], postDate[2], postDate[3], filename)
|
|
|
|
|
|
|
|
|
2015-07-17 23:21:29 +00:00
|
|
|
class ErrantStory(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.errantstory.com/'
|
|
|
|
stripUrl = url + '%s'
|
2012-06-20 19:58:13 +00:00
|
|
|
imageSearch = compile(r'<img[^>]+?src="([^"]*?comics/.+?)"')
|
|
|
|
prevSearch = compile(r'><a href="(.+?)"><Previous</a>')
|
2012-11-21 20:57:26 +00:00
|
|
|
help = 'Index format: yyyy-mm-dd/num'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class Erstwhile(WordPressNavi):
|
2016-03-31 21:13:54 +00:00
|
|
|
url = 'http://www.erstwhiletales.com/'
|
2016-04-10 21:04:34 +00:00
|
|
|
endOfLife = True
|
2016-03-31 21:13:54 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class Everblue(ComicControlScraper):
|
2019-07-03 06:41:50 +00:00
|
|
|
url = 'http://www.everblue-comic.com/comic/'
|
|
|
|
stripUrl = url + '%s'
|
|
|
|
firstStripUrl = stripUrl % '1'
|
2021-10-17 06:43:58 +00:00
|
|
|
|
|
|
|
def namer(self, imageUrl, pageUrl):
|
|
|
|
return imageUrl.rsplit('/', 1)[-1].split('-', 1)[1]
|
2019-07-03 06:41:50 +00:00
|
|
|
|
|
|
|
|
2017-05-16 22:11:29 +00:00
|
|
|
class EverybodyLovesEricRaymond(_ParserScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://geekz.co.uk/lovesraymond/'
|
2017-05-16 22:11:29 +00:00
|
|
|
firstStripUrl = url + 'archive/slashdotted'
|
2020-07-31 20:56:30 +00:00
|
|
|
imageSearch = '//div[d:class("entry-content")]//img'
|
2017-05-16 22:11:29 +00:00
|
|
|
prevSearch = '//a[@rel="prev"]'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class EvilDiva(WordPressScraper):
|
2020-01-09 16:38:13 +00:00
|
|
|
url = ('https://web.archive.org/web/20190221223751/'
|
|
|
|
'https://www.evildivacomics.com/')
|
2017-05-16 22:11:29 +00:00
|
|
|
firstStripUrl = url + 'comic/evil-diva-issue-1-cover/'
|
2020-01-09 16:38:13 +00:00
|
|
|
endOfLife = True
|
2012-06-20 19:58:13 +00:00
|
|
|
|
2013-04-10 21:57:09 +00:00
|
|
|
|
2022-05-27 17:26:08 +00:00
|
|
|
class EvilInc(_ParserScraper):
|
|
|
|
url = 'https://www.evil-inc.com/'
|
|
|
|
imageSearch = '//div[@id="unspliced-comic"]/img/@data-src'
|
|
|
|
prevSearch = '//a[./i[d:class("fa-chevron-left")]]'
|
2016-05-16 21:16:29 +00:00
|
|
|
firstStripUrl = url + 'comic/monday-3/'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2016-05-02 20:32:14 +00:00
|
|
|
class Evilish(_ParserScraper):
|
|
|
|
url = 'http://evilish.pensandtales.com/'
|
|
|
|
stripUrl = url + '?date=%s'
|
|
|
|
firstStripUrl = stripUrl % '20020630'
|
|
|
|
imageSearch = '//img[@alt="Today\'s Comics"]'
|
|
|
|
prevSearch = '//a[img[@alt="Previous Comic"]]'
|
|
|
|
endOfLife = True
|
|
|
|
help = 'Index format: yyyymmdd'
|
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class Evon(WordPressScraper):
|
2019-06-23 00:51:29 +00:00
|
|
|
url = 'http://evoncomics.com/'
|
|
|
|
stripUrl = url + '?comic=%s'
|
|
|
|
firstStripUrl = stripUrl % 'chapter-1'
|
|
|
|
adult = True
|
|
|
|
|
|
|
|
|
2023-09-24 05:29:30 +00:00
|
|
|
class ExorcismAcademy(ParserScraper):
|
|
|
|
url = 'https://ea.asmodrawscomics.com/'
|
|
|
|
stripUrl = url + 'comic/%s/'
|
|
|
|
firstStripUrl = stripUrl % 'title-page'
|
|
|
|
imageSearch = '//div[contains(@class, "webcomic-image")]//img[contains(@class, "size-full")]'
|
|
|
|
prevSearch = '//a[contains(@class, "previous-webcomic-link")]'
|
|
|
|
multipleImagesPerStrip = True
|
|
|
|
adult = True
|
|
|
|
|
|
|
|
def namer(self, image_url, page_url):
|
|
|
|
def repl(m):
|
|
|
|
return "{0}-{1}".format(m.group(2).zfill(4), m.group(1))
|
|
|
|
|
|
|
|
indexes = tuple(image_url.rstrip('/').split('/')[-3:])
|
|
|
|
day = sub(r'^(.+?)-?(?:Pg-(\d+))', repl, indexes[2])
|
|
|
|
name = "{year}-{month}-{day}".format(
|
|
|
|
year = indexes[0],
|
|
|
|
month = indexes[1],
|
|
|
|
day = day)
|
|
|
|
return name
|
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class ExploitationNow(WordPressNavi):
|
2013-03-06 19:21:10 +00:00
|
|
|
url = 'http://www.exploitationnow.com/'
|
2016-04-10 21:04:34 +00:00
|
|
|
firstStripUrl = url + '2000-07-07/9'
|
|
|
|
endOfLife = True
|
2013-03-06 19:21:10 +00:00
|
|
|
|
|
|
|
|
2020-03-08 06:54:37 +00:00
|
|
|
class Exvulnerum(_ParserScraper):
|
|
|
|
url = 'https://zules.com/exvulnerum/'
|
|
|
|
stripUrl = url + 'comic.php?page=%s'
|
|
|
|
firstStripUrl = stripUrl.replace('comic', 'newprologue') % '1'
|
|
|
|
imageSearch = ('//img[contains(@src, "pages/")]',
|
|
|
|
'//img[contains(@src, "newprologue/")]')
|
|
|
|
prevSearch = '//a[./img[contains(@src, "nav_prev")]]'
|
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class ExtraFabulousComics(WordPressScraper):
|
2019-12-03 18:50:41 +00:00
|
|
|
url = 'https://extrafabulouscomics.com/'
|
|
|
|
firstStripUrl = url + 'comic/buttfly/'
|
|
|
|
starter = bounceStarter
|
2016-10-04 15:06:50 +00:00
|
|
|
multipleImagesPerStrip = True
|
|
|
|
|
2016-10-05 22:42:50 +00:00
|
|
|
def namer(self, image_url, page_url):
|
|
|
|
imagename = os.path.basename(image_url)
|
|
|
|
pagepart = compile(r'/comic/([^/]+)/$').search(page_url).group(1)
|
|
|
|
return '_'.join((pagepart, imagename))
|
|
|
|
|
2017-02-05 23:05:05 +00:00
|
|
|
def shouldSkipUrl(self, url, data):
|
|
|
|
return data.xpath('//div[@id="comic"]//iframe')
|
|
|
|
|
2016-10-04 15:06:50 +00:00
|
|
|
|
2012-06-20 19:58:13 +00:00
|
|
|
class ExtraLife(_BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
url = 'http://www.myextralife.com/'
|
|
|
|
stripUrl = url + 'comic/%s/'
|
2013-04-04 16:30:02 +00:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(http://www\.myextralife\.com/wp-content/uploads/[^"]+)', before="comic"))
|
|
|
|
prevSearch = compile(tagre("a", "href", r'([^"]+)', before="prev_comic"))
|
2012-11-21 20:57:26 +00:00
|
|
|
help = 'Index format: stripname'
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2016-10-31 05:57:47 +00:00
|
|
|
class ExtraOrdinary(_ParserScraper):
|
2019-12-31 00:44:19 +00:00
|
|
|
url = 'https://www.exocomics.com/'
|
2013-04-09 17:36:51 +00:00
|
|
|
stripUrl = url + '%s'
|
|
|
|
firstStripUrl = stripUrl % '01'
|
2020-07-31 20:56:30 +00:00
|
|
|
prevSearch = '//a[d:class("prev")]'
|
|
|
|
imageSearch = '//img[d:class("image-style-main-comic")]'
|
2013-04-09 17:36:51 +00:00
|
|
|
help = 'Index format: number'
|