mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-01-27 02:31:34 +01:00
Fix www.webnovel.com adapter with volumes (#293)
This commit is contained in:
parent
5d57fdbe6c
commit
83bceb8154
1 changed files with 8 additions and 7 deletions
|
|
@ -192,14 +192,15 @@ class WWWWebNovelComAdapter(BaseSiteAdapter):
|
|||
jsondata = json.loads(self._fetchUrl(
|
||||
"https://" + self.getSiteDomain() + "/apiajax/chapter/GetChapterList?_csrfToken=" + csrf_token + "&bookId=" + self.story.getMetadata(
|
||||
'storyId')))
|
||||
for chap in jsondata["data"]["chapterItems"]:
|
||||
# Only allow free and VIP type 1 chapters
|
||||
if chap['isVip'] not in {0, 1}:
|
||||
continue
|
||||
for volume in jsondata["data"]["volumeItems"]:
|
||||
for chap in volume["chapterItems"]:
|
||||
# Only allow free and VIP type 1 chapters
|
||||
if chap['isVip'] not in {0, 1}:
|
||||
continue
|
||||
|
||||
chap_title = 'Chapter ' + unicode(chap['chapterIndex']) + ' - ' + chap['chapterName']
|
||||
chap_Url = url.rstrip('/') + '/' + chap['chapterId']
|
||||
self.chapterUrls.append((chap_title, chap_Url))
|
||||
chap_title = 'Chapter ' + unicode(chap['index']) + ' - ' + chap['name']
|
||||
chap_Url = url.rstrip('/') + '/' + chap['id']
|
||||
self.chapterUrls.append((chap_title, chap_Url))
|
||||
|
||||
self.story.setMetadata('numChapters', len(self.chapterUrls))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue