Advertisement
Guest User

webnovel/kakuyomu.jp.yaml

a guest
Dec 4th, 2023
1,719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.81 KB | Fixit | 0 0
  1. # ------------------------------------------------------------
  2. # 小説サイト定義
  3. name: &name カクヨム
  4. scheme: https
  5. domain: kakuyomu.jp
  6. top_url: \\k<scheme>://\\k<domain>
  7. url: \\k<top_url>/works/(?<ncode>\d+)
  8. encoding: UTF-8
  9. confirm_over18: no
  10. append_title_to_folder_name: yes
  11. title_strip_pattern: (^【.+?】|【.+?】$)
  12. sitename: *name
  13. version: 1.0
  14.  
  15. # ------------------------------------------------------------
  16. # 書籍情報取得設定
  17. title: &title >-
  18.   <h1[^>]*><span[^>]*><a[^>]*>(?<title>.+?)</a></span></h1>
  19. author: >-
  20.   </h1><div><div[^>]*><div[^>]*><a href="/users/[^>]+>(?<author>.+?)</a></div></div></div>
  21. story: &story >-
  22.  (?x)
  23.    <div.class="CollapseTextWithKakuyomuLinks_collapseText[^>]*>
  24.      (?<story>.+?)
  25.       #(?:<span.class="CollapseTextWithKakuyomuLinks_expandButtonLabel.+?>)?
  26.     </div>
  27. #  "introduction":"(?<story>.+?)",
  28.  
  29. # ------------------------------------------------------------
  30. # 目次取得設定
  31. toc_url: \\k<top_url>/works/\\k<ncode>
  32. subtitles: (?x)
  33.   (?:"level":1,"title":"(?<chapter>(?:[^"]|\\")+)"},)?
  34.   (?:(?:"TableOfContentsChapter:\d+":{[^\]]+\]},)?
  35.     "Chapter:\d+":{"__typename":"Chapter","id":"\d+",
  36.       "level":2,"title":"(?<subchapter>(?:[^"]|\\")+)"
  37.   },)?
  38.   "Episode:\d+":{
  39.     "__typename":"Episode",
  40.     "id":"(?<index>\d+)",
  41.     "title":"(?<subtitle>(?:[^"]|\\")+)",
  42.     "publishedAt":"(?<subupdate>[^"]+)"
  43.  }
  44. href: /works/\\k<ncode>/episodes/\\k<index>
  45.  
  46. # ------------------------------------------------------------
  47. # 本文取得設定
  48.  
  49. body_pattern: <div class="widget-episodeBody js-episode-body".*?>(?<body>.+?)</div>
  50. introduction_pattern: null
  51. postscript_pattern: null
  52.  
  53. # ------------------------------------------------------------
  54. # 小説情報からパースするための設定
  55. novel_info_url: \\k<toc_url>
  56.  
  57. # タイトル
  58. t: *title
  59.  
  60. # novel_type 小説種別
  61. nt: '"serialStatus":"(?<novel_type>\w+)","publicEpisodeCount":(?<general_all_no>\d+),"totalCharacterCount":(?<length>\d+),"isCruel"'
  62. novel_type_string:
  63.  RUNNING: 1
  64.  COMPLETED: 3
  65.  
  66. # general_all_no 掲載話数
  67. ga: null #'"publicEpisodeCount":(?<general_all_no>\d+),"totalCharacterCount":\d+,"isCruel":'
  68.  
  69. # story あらすじ
  70. s: *story
  71.  
  72. # general_firstup 初回掲載日
  73. gf: '"promotionalImageUrl":[^{}]*?,"publishedAt":"(?<general_firstup>[^"]+)",[^{}]*?"adminBookInformationUrl":'
  74.  
  75. # novelupdated_at 小説の更新時刻。最終掲載日で代用
  76. nu: '"editedAt":"(?<novelupdated_at>[^"]+)"'
  77.  
  78. # general_lastup 最新話掲載日
  79. gl: '"promotionalImageUrl":[^{}]*?,"lastEpisodePublishedAt":"(?<general_lastup>[^"]+)",[^{}]*?"adminBookInformationUrl":'
  80.  
  81. # writer 作者名
  82. w: </h1><div><div[^>]*><div[^>]*><a href="/users/[^>]+>(?<writer>.+?)</a></div></div></div>
  83.  
  84. # length 文字数
  85. l: null #'"totalCharacterCount":(?<length>\d+),"isCruel":'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement