Skip to content

Commit d0b1ba7

Browse files
committed
html本子详情不返回章节发布时间字段
1 parent ec794f1 commit d0b1ba7

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/test_html.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
test: # This code is based on https://github.com/gaogaotiantian/viztracer/blob/master/.github/workflows/python-package.yml
1717
strategy:
1818
matrix:
19-
python-version: ['3.7', '3.8', '3.11', '3.12']
19+
python-version: ['3.9', '3.10', '3.11', '3.13']
2020
os: [ ubuntu-latest ]
2121
runs-on: ${{ matrix.os }}
2222
timeout-minutes: 5

src/jmcomic/jm_entity.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,10 @@ def __init__(self,
457457
self.authors: List[str] = authors # 作者
458458

459459
# 有的 album 没有章节,则自成一章。
460-
episode_list: List[Tuple[str, str, str, str]]
460+
episode_list: List[Tuple[str, str, str]]
461461
if len(episode_list) == 0:
462-
# photo_id, photo_index, photo_title, photo_pub_date
463-
episode_list = [(album_id, "1", name, pub_date)]
462+
# photo_id, photo_index, photo_title
463+
episode_list = [(album_id, "1", name)]
464464
else:
465465
episode_list = self.distinct_episode(episode_list)
466466

@@ -486,7 +486,7 @@ def id(self):
486486
def distinct_episode(episode_list: list):
487487
"""
488488
去重章节
489-
photo_id, photo_index, photo_title, photo_pub_date
489+
photo_id, photo_index, photo_title
490490
"""
491491
episode_list.sort(key=lambda e: int(e[1])) # 按照photo_index排序
492492
ret = [episode_list[0]]
@@ -505,7 +505,7 @@ def create_photo_detail(self, index) -> JmPhotoDetail:
505505
raise IndexError(f'photo index out of range for album-{self.album_id}: {index} >= {length}')
506506

507507
# ('212214', '81', '94 突然打來', '2020-08-29')
508-
pid, pindex, pname, _pub_date = self.episode_list[index]
508+
pid, pindex, pname = self.episode_list[index]
509509

510510
photo = JmModuleConfig.photo_class()(
511511
photo_id=pid,

src/jmcomic/jm_toolkit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class JmcomicText:
2525
pattern_html_album_album_id = compile(r'<span class="number">.*?:JM(\d+)</span>')
2626
pattern_html_album_scramble_id = compile(r'var scramble_id = (\d+);')
2727
pattern_html_album_name = compile(r'<h1 class="book-name" id="book-name">([\s\S]*?)</h1>')
28-
pattern_html_album_episode_list = compile(r'data-album="(\d+)"[^>]*>\s*?<li.*?>\s*?第(\d+)([\s\S]*?)<[\s\S]*?>(\d+-\d+-\d+).*?')
28+
pattern_html_album_episode_list = compile(r'data-album="(\d+)"[^>]*>\s*?<li.*?>\s*?第(\d+)[话話]([\s\S]*?)<[\s\S]*?>')
2929
pattern_html_album_page_count = compile(r'<span class="pagecount">.*?:(\d+)</span>')
3030
pattern_html_album_pub_date = compile(r'>上架日期 : (.*?)</span>')
3131
pattern_html_album_update_date = compile(r'>更新日期 : (.*?)</span>')

0 commit comments

Comments
 (0)