diff --git a/calibre-plugin/plugin-defaults.ini b/calibre-plugin/plugin-defaults.ini index 96ccf88e..a87d1d8f 100644 --- a/calibre-plugin/plugin-defaults.ini +++ b/calibre-plugin/plugin-defaults.ini @@ -3011,6 +3011,17 @@ sitetags_label:Site tags ## Attempt to fix p and br excess from HTML in great many stories fix_excess_space:false +[www.novelupdates.cc] +## Note that novelupdates.cc != novelupdates.com + +## There is reason to believe that novelupdates.cc may be a +## replacement for wuxiaworld.co, but currently both exist with +## different data. + +## When dedup_order_chapter_list:true, use a heuristic algorithm +## specific to novelupdates.cc order and dedup chapters. +dedup_order_chapter_list:false + [www.phoenixsong.net] ## Some sites require login (or login for some rated stories) The ## program can prompt you, or you can save it in config. In @@ -3151,6 +3162,12 @@ extracategories:Lord of the Rings website_encodings:Windows-1252,utf8 +[www.the-sietch.com] +## see [base_xenforoforum] + +## the-sietch.com shows more posts per reader page than other XF sites. +reader_posts_per_page:15 + [www.thedelphicexpanse.com] ## Site dedicated to these categories/characters/ships extracategories:Star Trek: Enterprise @@ -3333,12 +3350,6 @@ website_encodings:Windows-1252,utf8 ## specific to wuxiaworld.co order and dedup chapters. dedup_order_chapter_list:false -[www.novelupdates.cc] -## Note that novelupdates.cc != novelupdates.com -## When dedup_order_chapter_list:true, use a heuristic algorithm -## specific to novelupdates.cc order and dedup chapters. -dedup_order_chapter_list:false - [www.wuxiaworld.com] user_agent:Mozilla/5.0 ## Authors on wuxiaworld.com create their own index pages, so it's not diff --git a/fanficfare/adapters/__init__.py b/fanficfare/adapters/__init__.py index 9ee575cd..5a501e12 100644 --- a/fanficfare/adapters/__init__.py +++ b/fanficfare/adapters/__init__.py @@ -173,6 +173,7 @@ from . import adapter_chireadscom from . import adapter_scribblehubcom from . import adapter_fictionlive from . import adapter_wuxiaworldsite +from . import adapter_thesietchcom ## This bit of complexity allows adapters to be added by just adding ## importing. It eliminates the long if/else clauses we used to need diff --git a/fanficfare/adapters/adapter_thesietchcom.py b/fanficfare/adapters/adapter_thesietchcom.py new file mode 100644 index 00000000..bc3e311b --- /dev/null +++ b/fanficfare/adapters/adapter_thesietchcom.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +# Copyright 2020 FanFicFare team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from __future__ import absolute_import +import re + +# py2 vs py3 transition +from ..six import text_type as unicode + +from .base_xenforo2forum_adapter import BaseXenForo2ForumAdapter + +def getClass(): + return TheSietchComAdapter + +class TheSietchComAdapter(BaseXenForo2ForumAdapter): + + def __init__(self, config, url): + BaseXenForo2ForumAdapter.__init__(self, config, url) + + # Each adapter needs to have a unique site abbreviation. + self.story.setMetadata('siteabbrev','sietch') + + @staticmethod # must be @staticmethod, don't remove it. + def getSiteDomain(): + # The site domain. Does have www here, if it uses it. + return 'www.the-sietch.com' + + @classmethod + def getPathPrefix(cls): + # in case it needs more than just site/ + return '/index.php?' + + def make_reader_url(self,tmcat_num,reader_page_num): + # https://www.the-sietch.com/index.php?threads/shattered-sphere-the-arcadian-free-march.3243/reader/page-2 + # discard tmcat_num -- the-sietch.com doesn't have multiple + # threadmark categories yet. + return self.story.getMetadata('storyUrl')+'reader/page-'+unicode(reader_page_num) + +# XXX different threadmarks categories diff --git a/fanficfare/defaults.ini b/fanficfare/defaults.ini index 54381bdb..91c66417 100644 --- a/fanficfare/defaults.ini +++ b/fanficfare/defaults.ini @@ -3033,6 +3033,17 @@ sitetags_label:Site tags ## Attempt to fix p and br excess from HTML in great many stories fix_excess_space:false +[www.novelupdates.cc] +## Note that novelupdates.cc != novelupdates.com + +## There is reason to believe that novelupdates.cc may be a +## replacement for wuxiaworld.co, but currently both exist with +## different data. + +## When dedup_order_chapter_list:true, use a heuristic algorithm +## specific to novelupdates.cc order and dedup chapters. +dedup_order_chapter_list:false + [www.phoenixsong.net] ## Some sites require login (or login for some rated stories) The ## program can prompt you, or you can save it in config. In @@ -3173,6 +3184,12 @@ extracategories:Lord of the Rings website_encodings:Windows-1252,utf8 +[www.the-sietch.com] +## see [base_xenforoforum] + +## the-sietch.com shows more posts per reader page than other XF sites. +reader_posts_per_page:15 + [www.thedelphicexpanse.com] ## Site dedicated to these categories/characters/ships extracategories:Star Trek: Enterprise @@ -3355,12 +3372,6 @@ website_encodings:Windows-1252,utf8 ## specific to wuxiaworld.co order and dedup chapters. dedup_order_chapter_list:false -[www.novelupdates.cc] -## Note that novelupdates.cc != novelupdates.com -## When dedup_order_chapter_list:true, use a heuristic algorithm -## specific to novelupdates.cc order and dedup chapters. -dedup_order_chapter_list:false - [www.wuxiaworld.com] user_agent:Mozilla/5.0 ## Authors on wuxiaworld.com create their own index pages, so it's not