Fix SoloLeveling
This commit is contained in:
parent
01c4ddcd2c
commit
a1bcdfb987
3 changed files with 2 additions and 60 deletions
|
@ -134,6 +134,7 @@ class MangaDex(_ParserScraper):
|
|||
cls('SenpaiGaUzaiKouhaiNoHanashi', 'af38f328-8df1-4b4c-a272-e737625c3ddc'),
|
||||
cls('SewayakiKitsuneNoSenkoSan', 'c26269c7-0f5d-4966-8cd5-b79acb86fb7a'),
|
||||
cls('ShinNoJitsuryokuWaGirigiriMadeKakushiteIyouToOmou', '22fda941-e603-4601-a536-c3ad6d004ba8'),
|
||||
cls('SoloLeveling', '32d76d19-8a05-4db0-9fc2-e0b0648fe9d0'),
|
||||
cls('SousouNoFrieren', 'b0b721ff-c388-4486-aa0f-c2b0bb321512'),
|
||||
cls('SwordArtOnline', '3dd0b814-23f4-4342-b75b-f206598534f6'),
|
||||
cls('SwordArtOnlineProgressive', '22ea3f54-11e4-4932-a527-89d63d3a62d9'),
|
||||
|
|
|
@ -1627,6 +1627,7 @@ class Renamed(Scraper):
|
|||
cls('SmackJeeves/FurryExperience', 'ComicFury/FurryExperience'),
|
||||
cls('SmackJeeves/GrowingTroubles', 'ComicFury/GrowingTroubles'),
|
||||
cls('SmackJeeves/TheRealmOfKaerwyn', 'ComicFury/TheRealmOfKaerwyn'),
|
||||
cls('SoloLeveling', 'MangaDex/SoloLeveling'),
|
||||
cls('StudioKhimera/Draconia', 'Draconia'),
|
||||
cls('TracesOfThePast', 'RickGriffinStudios/TracesOfThePast'),
|
||||
cls('TracesOfThePast/NSFW', 'RickGriffinStudios/TracesOfThePastNSFW'),
|
||||
|
|
|
@ -355,66 +355,6 @@ class SodiumEyes(_WordPressScraper):
|
|||
endOfLife = True
|
||||
|
||||
|
||||
class SoloLeveling(_ParserScraper):
|
||||
url = 'https://w3.sololeveling.net/'
|
||||
stripUrl = url + 'manga/solo-leveling-chapter-%s/'
|
||||
firstStripUrl = stripUrl % '1'
|
||||
imageSearch = '//div[@class="img_container"]//img'
|
||||
prevSearch = '//a[@rel="prev"]'
|
||||
latestSearch = '//div[@id="latestChapters"]//a'
|
||||
starter = indirectStarter
|
||||
multipleImagesPerStrip = True
|
||||
imageUrlFixes = {
|
||||
'94-0_5dd574efda419/28.': '94-0_5dd574efda419/28a.',
|
||||
'92-0_5dc2fcb9ed562/22.': '92-0_5dc2fcb9ed562/22s.',
|
||||
'91-0_5db9b881ac2f0/20k.': '91-0_5db9b881ac2f0/20l.',
|
||||
'91-0_5db9b881ac2f0/23.': '91-0_5db9b881ac2f0/23a.',
|
||||
'90-0_5db08467ca2b1/07.': '90-0_5db08467ca2b1/07a.',
|
||||
'90-0_5db08467ca2b1/09.': '90-0_5db08467ca2b1/09a.',
|
||||
'90-0_5db08467ca2b1/13.': '90-0_5db08467ca2b1/13a.',
|
||||
'90-0_5db08467ca2b1/14.': '90-0_5db08467ca2b1/14a.',
|
||||
'90-0_5db08467ca2b1/21.': '90-0_5db08467ca2b1/21a.',
|
||||
'90-0_5db08467ca2b1/22.': '90-0_5db08467ca2b1/22a.',
|
||||
'88-0_5d9e0dedb942e/03.': '88-0_5d9e0dedb942e/03b.',
|
||||
'88-0_5d9e0dedb942e/05.': '88-0_5d9e0dedb942e/05a.',
|
||||
'88-0_5d9e0dedb942e/30.': '88-0_5d9e0dedb942e/30a.',
|
||||
'87-0_5d94cdebd9df7/01a.': '87-0_5d94cdebd9df7/01c.',
|
||||
}
|
||||
|
||||
def imageUrlModifier(self, imageUrl, data):
|
||||
if 'url=' in imageUrl:
|
||||
imageUrl = imageUrl.split('url=')[1].split('&')[0]
|
||||
for fix in self.imageUrlFixes:
|
||||
imageUrl = imageUrl.replace(fix, self.imageUrlFixes[fix])
|
||||
return imageUrl
|
||||
|
||||
def fetchUrls(self, url, data, urlSearch):
|
||||
# Save link order for position-based filenames
|
||||
self.imageUrls = super(SoloLeveling, self).fetchUrls(url, data, urlSearch)
|
||||
self.imageUrls = [self.imageUrlModifier(x, data) for x in self.imageUrls]
|
||||
return self.imageUrls
|
||||
|
||||
def getPage(self, url):
|
||||
try:
|
||||
return super().getPage(url)
|
||||
except HTTPError as e:
|
||||
# CloudFlare WAF
|
||||
if e.response.status_code == 403 and '1020' in e.response.text:
|
||||
self.geoblocked()
|
||||
else:
|
||||
raise e
|
||||
|
||||
def getPrevUrl(self, url, data):
|
||||
return self.stripUrl % str(int(url.strip('/').rsplit('-', 1)[-1]) - 1)
|
||||
|
||||
def namer(self, imageUrl, pageUrl):
|
||||
# Construct filename from episode number and image position on page
|
||||
episodeNum = pageUrl.strip('/').rsplit('-', 1)[-1]
|
||||
imageNum = self.imageUrls.index(imageUrl)
|
||||
imageExt = imageUrl.rsplit('.', 1)[-1]
|
||||
return "%s-%03d.%s" % (episodeNum, imageNum, imageExt)
|
||||
|
||||
|
||||
class SomethingPositive(_ParserScraper):
|
||||
url = 'https://www.somethingpositive.net/'
|
||||
stripUrl = url + 'sp%s.shtml'
|
||||
|
|
Loading…
Reference in a new issue