Skip to content

Commit

Permalink
v2.5.24: 更新网页的章节正则表达式 (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
hect0x7 authored Nov 22, 2024
1 parent 97816c7 commit 1d6e5c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/jmcomic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 被依赖方 <--- 使用方
# config <--- entity <--- toolkit <--- client <--- option <--- downloader

__version__ = '2.5.23'
__version__ = '2.5.24'

from .api import *
from .jm_plugin import *
Expand Down
13 changes: 6 additions & 7 deletions src/jmcomic/jm_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,30 @@ class JmcomicText:
pattern_html_album_album_id = compile(r'<span class="number">.*?:JM(\d+)</span>')
pattern_html_album_scramble_id = compile(r'var scramble_id = (\d+);')
pattern_html_album_name = compile(r'<h1 class="book-name" id="book-name">([\s\S]*?)</h1>')
pattern_html_album_episode_list = compile(r'data-album="(\d+)">\n *?<li.*?>\n *'
r'第(\d+)話\n([\s\S]*?)\n *'
r'<[\s\S]*?>(\d+-\d+-\d+).*?')
pattern_html_album_episode_list = compile(r'data-album="(\d+)"\s*?>\s*?<li.*?>\s*?第(\d+)話([\s\S]*?)<[\s\S]*?>(\d+-\d+-\d+).*?')
pattern_html_album_page_count = compile(r'<span class="pagecount">.*?:(\d+)</span>')
pattern_html_album_pub_date = compile(r'>上架日期 : (.*?)</span>')
pattern_html_album_update_date = compile(r'>更新日期 : (.*?)</span>')
pattern_html_tag_a = compile(r'<a[^>]*?>\s*(\S*)\s*</a>')
# 作品
pattern_html_album_works = [
compile(r'<span itemprop="author" data-type="works">([\s\S]*?)</span>'),
compile(r'<a[^>]*?>(.*?)</a>')
pattern_html_tag_a,
]
# 登場人物
pattern_html_album_actors = [
compile(r'<span itemprop="author" data-type="actor">([\s\S]*?)</span>'),
compile(r'<a[^>]*?>(.*?)</a>')
pattern_html_tag_a,
]
# 标签
pattern_html_album_tags = [
compile(r'<span itemprop="genre" data-type="tags">([\s\S]*?)</span>'),
compile(r'<a[^>]*?>(.*?)</a>')
pattern_html_tag_a,
]
# 作者
pattern_html_album_authors = [
compile(r'作者: *<span itemprop="author" data-type="author">([\s\S]*?)</span>'),
compile(r"<a[^>]*?>(.*?)</a>"),
pattern_html_tag_a,
]
# 點擊喜歡
pattern_html_album_likes = compile(r'<span id="albim_likes_\d+">(.*?)</span>')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_jmcomic/test_jm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_photo_sort(self):

# 测试用例 - 多章本子
multi_photo_album_is = str_to_list('''
400222
282293
122061
''')

Expand Down

0 comments on commit 1d6e5c9

Please sign in to comment.