web-novel-scraper 2.1.0__py3-none-any.whl → 2.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -405,7 +405,6 @@ def scrap_chapter(ctx, title, chapter_url, chapter_num, update_html):
405
405
 
406
406
  chapter = novel.scrap_chapter(chapter=chapter,
407
407
  reload_file=update_html)
408
-
409
408
  click.echo(chapter)
410
409
  click.echo('Content:')
411
410
  click.echo(chapter.chapter_content)
@@ -1,2 +1,2 @@
1
1
  from .custom_processor import CustomProcessor, ProcessorRegistry
2
- from .sites import royalroad, genesis
2
+ from .sites import royalroad, genesis, fanmtl
@@ -0,0 +1,15 @@
1
+ import re
2
+ from typing import List, Optional
3
+ from ..custom_processor import CustomProcessor, ProcessorRegistry
4
+
5
+ class GenesisNextPageProcessor(CustomProcessor):
6
+ def process(self, html: str) -> Optional[str]:
7
+ pattern = r'href="([^"]+page=\d+[^"]*)">></a'
8
+ match = re.search(pattern, html)
9
+ if match is None:
10
+ return None
11
+ next_page = match.group(1)
12
+ next_page = next_page.replace('&amp;', '&')
13
+ return f'https://www.fanmtl.com{next_page}'
14
+
15
+ ProcessorRegistry.register('fanmtl.com', 'next_page', GenesisNextPageProcessor())
@@ -409,5 +409,32 @@
409
409
  "key": "href"
410
410
  }
411
411
  }
412
+ },
413
+ {
414
+ "host": "fanmtl.com",
415
+ "has_pagination": true,
416
+ "add_host_to_chapter": true,
417
+ "save_title_to_content": true,
418
+ "title": {
419
+ "element": "h2",
420
+ "extract": {
421
+ "type": "text"
422
+ }
423
+ },
424
+ "content": {
425
+ "selector": "div.chapter-content p",
426
+ "array": true
427
+ },
428
+ "index": {
429
+ "selector": "ul.chapter-list li a",
430
+ "array": true,
431
+ "extract": {
432
+ "type": "attr",
433
+ "key": "href"
434
+ }
435
+ },
436
+ "next_page": {
437
+ "use_custom_processor": true
438
+ }
412
439
  }
413
440
  ]
@@ -154,7 +154,6 @@ class Novel:
154
154
  raise ValidationError("When providing toc_html, host must be explicitly provided")
155
155
 
156
156
  novel = cls(title=title, host=host, toc_main_url=toc_main_url)
157
- breakpoint()
158
157
  # If toc_main_url is provided and the host isn't, extract host from URL
159
158
  if toc_main_url and not host:
160
159
  host = utils.obtain_host(toc_main_url)
@@ -1142,7 +1141,6 @@ class Novel:
1142
1141
 
1143
1142
  cover_image_content = self.file_manager.load_novel_cover()
1144
1143
  if cover_image_content:
1145
- breakpoint()
1146
1144
  book.set_cover('cover.jpg', cover_image_content)
1147
1145
  book.spine += ['cover']
1148
1146
 
@@ -1 +1 @@
1
- __version__ = "2.1.0"
1
+ __version__ = "2.1.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: web-novel-scraper
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Python tool that allows you to scrape web novels from various sources and save them to more readable formats like EPUB.
5
5
  Project-URL: Homepage, https://github.com/ImagineBrkr/web-novel-scraper
6
6
  Project-URL: Documentation, https://web-novel-scraper.readthedocs.io
@@ -1,20 +1,21 @@
1
1
  web_novel_scraper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- web_novel_scraper/__main__.py,sha256=QI8oncZiSuyXu2D377uFq5BpAy4U6uyedEs-PfkY2Ek,18312
2
+ web_novel_scraper/__main__.py,sha256=v6Y5FpO9EghFTLcDgsPfyMKQgz6dWgbKl2PDbC3rt-E,18311
3
3
  web_novel_scraper/config_manager.py,sha256=KVnCIVs1nsEI3W6YolTV9FejjwJXtUYhDn2dmHr9SC4,3193
4
4
  web_novel_scraper/decode.py,sha256=iLjXlKUh8UgTkgsQupVAhW-eUDxYrcOTx_EEgjV5s_A,15186
5
5
  web_novel_scraper/file_manager.py,sha256=6OZAuaUykUmS0fLzcSVyQSqcPanjEVpjrQ-0pa2vKls,16767
6
6
  web_novel_scraper/logger_manager.py,sha256=A-a4bhYI4YCEuSJd9E3WH_kanJ7YCASMwheBzObZK4Q,1972
7
7
  web_novel_scraper/models.py,sha256=7lS1Mb5h0qunNOslwCl6vQiuZGsMNw7h1BYK03yHeFM,2227
8
- web_novel_scraper/novel_scraper.py,sha256=hWZvi1c3Nnq4qSfLsfZPsjQj-UTlWaKwTlqyPtFe36I,50506
8
+ web_novel_scraper/novel_scraper.py,sha256=BGTB8j7NhTzOnT93DE662KPqE_Kt2mO0tYVFz_xAbnk,50460
9
9
  web_novel_scraper/request_manager.py,sha256=yfXaPCeTu7FGiWnR3rImkaCWETfT3d5zxwOIylEP-_M,7954
10
10
  web_novel_scraper/utils.py,sha256=DO1bTgyGNqjHrBlMYdS0ljwegTSC_kYsIbxi-0KeuY8,6953
11
- web_novel_scraper/version.py,sha256=Xybt2skBZamGMNlLuOX1IG-h4uIxqUDGAO8MIGWrJac,22
12
- web_novel_scraper/custom_processor/__init__.py,sha256=iy4tjivMjshSzc52--aa-jK53qu9VwdK-6p4vuQc6oc,103
11
+ web_novel_scraper/version.py,sha256=zPJIgPGcoSNiD0qme18OnYJYE3A9VVytlhO-V5DaAW0,22
12
+ web_novel_scraper/custom_processor/__init__.py,sha256=isc6q3pz9MzazF8e3uRMhZD_bv8vf11ME_Jv_p7dznA,111
13
13
  web_novel_scraper/custom_processor/custom_processor.py,sha256=h1MPl6JU_C2Mc7SqK70LsNQHpDzSL6QyraMIQ87HcMM,870
14
+ web_novel_scraper/custom_processor/sites/fanmtl.py,sha256=5eH9PeiJljYjqML7aEDU6qeUEEOPjGeIqkXyv-DY1pg,578
14
15
  web_novel_scraper/custom_processor/sites/genesis.py,sha256=xV0eybI0ieHR5gn4yWXI74l99Eayhqs16PIYs-BrPjE,1843
15
16
  web_novel_scraper/custom_processor/sites/royalroad.py,sha256=_2PsFC_w3RJCUkAPoRn-7R2jlzl3XsG4WYtRaQkp6lg,787
16
- web_novel_scraper/decode_guide/decode_guide.json,sha256=ecIBugJ8ddzFH0rJHkonkrE6ogSXf98jVypQ-GnVDnE,10418
17
- web_novel_scraper-2.1.0.dist-info/METADATA,sha256=2EeY0XmULbnE6AFUgsuFPT0NYZSnwk6nVzb45rh_tow,8423
18
- web_novel_scraper-2.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
- web_novel_scraper-2.1.0.dist-info/entry_points.txt,sha256=bqRvStfvSprSJc2EJXgKIbggWOXSePHFfVIZWy_plDQ,69
20
- web_novel_scraper-2.1.0.dist-info/RECORD,,
17
+ web_novel_scraper/decode_guide/decode_guide.json,sha256=jSw2_c-UMRpGk1d9FqCaIrritJCl9y9O9m5qsokSk3E,11085
18
+ web_novel_scraper-2.1.1.dist-info/METADATA,sha256=u-7Dy3YOk7WItvGnHVPkKIijhISoz9eoCiq51iCGE2I,8423
19
+ web_novel_scraper-2.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
20
+ web_novel_scraper-2.1.1.dist-info/entry_points.txt,sha256=bqRvStfvSprSJc2EJXgKIbggWOXSePHFfVIZWy_plDQ,69
21
+ web_novel_scraper-2.1.1.dist-info/RECORD,,