Skip to content

Commit

Permalink
docs: re-clarify the facts about visiting linovelib website x2
Browse files Browse the repository at this point in the history
  • Loading branch information
wdpm committed Oct 29, 2024
1 parent 4763404 commit cf1ed86
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,14 @@ So the target website has 2 x 2 = 4 choices.

| website version | visit method | support status | target_site |
|-------------------------------------|-------------------------------------------------------------------|----------------|-------------------------------------------|
| [PC](www.linovelib.com) 简体 | click [简体化] | ✅(recommend) | `TargetSite.LINOVELIB_PC` |
| [PC](www.linovelib.com) 繁体 | click [繁體化] || `TargetSite.LINOVELIB_PC_TRADITIONAL` |
| ~~[Mobile](www.bilinovel.com) 简体~~ | browser set `zh/zh-CN` lang || `TargetSite.LINOVELIB_MOBILE` |
| [PC](www.linovelib.com) 简体 | browser set `zh/zh-CN` lang + click [简体化] | ✅(recommend) | `TargetSite.LINOVELIB_PC` |
| [PC](www.linovelib.com) 繁体 | browser set `zh/zh-CN` lang + click [繁體化] || `TargetSite.LINOVELIB_PC_TRADITIONAL` |
| ~~[Mobile](www.bilinovel.com) 简体~~ | ~~browser set `zh/zh-CN` lang~~ || `TargetSite.LINOVELIB_MOBILE` |
| [Mobile](www.bilinovel.com) 繁体 | browser set `zh-TW/zh-HK` lang or not in Chinese Mainland network |*(recommend) | `TargetSite.LINOVELIB_MOBILE_TRADITIONAL` |

> *: Updates[2024-05-14].Now drission page library can't visit www.bilinovel.com(mobile version) on PC in Chinese Mainland network.
> So `TargetSite.LINOVELIB_MOBILE` target doesn't work. No workaround now.
> 1.❌*: [2024-10-29]Now drission page library can only visit [mobile traditional version](www.bilinovel.com).
>
> 2.The Button "简体化" in mobile traditional version does not work. So `TargetSite.LINOVELIB_MOBILE` target doesn't work. No workaround now.
Create a python file(e.g. `usage_demo.py`) and edit the content as follows:

Expand All @@ -167,9 +168,6 @@ if __name__ == '__main__':

# linovelib_epub = Linovelib2Epub(book_id=2356,target_site=TargetSite.LINOVELIB_PC_TRADITIONAL)

# linovelib_epub = Linovelib2Epub(book_id=2356)
# linovelib_epub = Linovelib2Epub(book_id=2356,target_site=TargetSite.LINOVELIB_MOBILE)

# linovelib_epub = Linovelib2Epub(book_id=2356,target_site=TargetSite.LINOVELIB_MOBILE_TRADITIONAL)
linovelib_epub.run()
```
Expand Down Expand Up @@ -240,6 +238,8 @@ if __name__ == "__main__":
linovelib_epub.run()
```

For more options, see the `Options` chapter below.

---

The following is a common crawler configuration that can be used as a reference.
Expand Down
9 changes: 6 additions & 3 deletions src/linovelib2epub/spider/linovelib_mobile_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def generate_mapping_result(self):

def _parse_mapping(self, js_text) -> ParsedRuleResultMobile:
if not self.traditional:
content_id, replace_rules = self._parse_mapping_v2_zh(js_text)
# content_id, replace_rules = self._parse_mapping_v2_zh(js_text)
content_id, replace_rules = self._parse_mapping_v2_zh_tw(js_text)
else:
content_id, replace_rules = self._parse_mapping_v2_zh_tw(js_text)
parsed_rule_result = ParsedRuleResultMobile(mapping_dict=replace_rules, content_id=content_id)
Expand Down Expand Up @@ -166,8 +167,10 @@ async def _probe_js_encrypted_file(self):
# https://w.linovelib.com/novel/2883/141634.html

if not self.traditional:
url1 = "https://w.linovelib.com/themes/zhmb/js/hm.js"
url2 = "https://w.linovelib.com/themes/zhmb/js/readtool.js"
# url1 = "https://w.linovelib.com/themes/zhmb/js/hm.js"
# url2 = "https://w.linovelib.com/themes/zhmb/js/readtool.js"
url1 = "https://tw.linovelib.com/themes/zhmb/js/hm.js"
url2 = "https://tw.linovelib.com/themes/zhmb/js/readtool.js"
urls = [url1, url2]
else:
url1 = "https://tw.linovelib.com/themes/zhmb/js/hm.js"
Expand Down

0 comments on commit cf1ed86

Please sign in to comment.