mirror of
https://github.com/hect0x7/JMComic-Crawler-Python.git
synced 2025-09-26 22:31:30 +08:00
v2.5.5: 优化搜索页面的正则表达式来适配直连域名,app版本号改为v1.6.6,优化文档 (#208)
This commit is contained in:
parent
9e419915b7
commit
9a3d0f19f6
@ -32,11 +32,11 @@ class First3ImageDownloader(JmDownloader):
|
||||
|
||||
def do_filter(self, detail):
|
||||
if detail.is_photo():
|
||||
photo: JmPhotoDetail = iter_objs
|
||||
photo: JmPhotoDetail = detail
|
||||
# 支持[start,end,step]
|
||||
return photo[:3]
|
||||
|
||||
return iter_objs
|
||||
return detail
|
||||
```
|
||||
|
||||
|
||||
@ -54,9 +54,9 @@ class FindUpdateDownloader(JmDownloader):
|
||||
|
||||
def do_filter(self, detail):
|
||||
if not detail.is_album():
|
||||
return iter_objs
|
||||
return detail
|
||||
|
||||
return self.find_update(iter_objs)
|
||||
return self.find_update(detail)
|
||||
|
||||
# 带入漫画id, 章节id(第x章),寻找该漫画下第x章节後的所有章节Id
|
||||
def find_update(self, album: JmAlbumDetail):
|
||||
|
@ -2,7 +2,7 @@
|
||||
# 被依赖方 <--- 使用方
|
||||
# config <--- entity <--- toolkit <--- client <--- option <--- downloader
|
||||
|
||||
__version__ = '2.5.4'
|
||||
__version__ = '2.5.5'
|
||||
|
||||
from .api import *
|
||||
from .jm_plugin import *
|
||||
|
@ -52,7 +52,7 @@ class JmMagicConstants:
|
||||
APP_TOKEN_SECRET = '18comicAPP'
|
||||
APP_TOKEN_SECRET_2 = '18comicAPPContent'
|
||||
APP_DATA_SECRET = '185Hcomic3PAPP7R'
|
||||
APP_VERSION = '1.6.4'
|
||||
APP_VERSION = '1.6.6'
|
||||
APP_HEADERS_TEMPLATE = {
|
||||
'Accept-Encoding': 'gzip',
|
||||
'user-agent': 'Mozilla/5.0 (Linux; Android 9; V1938CT Build/PQ3A.190705.09211555; wv) AppleWebKit/537.36 (KHTML, '
|
||||
@ -156,7 +156,7 @@ class JmModuleConfig:
|
||||
# log时解码url
|
||||
flag_decode_url_when_logging = True
|
||||
# 当内置的版本号落后时,使用最新的禁漫app版本号
|
||||
flag_use_version_newer_if_behind = False
|
||||
flag_use_version_newer_if_behind = True
|
||||
|
||||
# 关联dir_rule的自定义字段与对应的处理函数
|
||||
# 例如:
|
||||
|
@ -359,13 +359,7 @@ class JmPageTool:
|
||||
|
||||
# 用来提取搜索页面的的album的信息
|
||||
pattern_html_search_album_info_list = compile(
|
||||
r'<a href="/album/(\d+)/.+"[\s\S]*?'
|
||||
r'title="(.*?)"[\s\S]*?'
|
||||
r'(<div class="label-category" style="">'
|
||||
r'\n(.*)\n</div>\n<div class="label-sub" style=" ">'
|
||||
r'(.*?)\n<[\s\S]*?)?'
|
||||
r'<div class="title-truncate tags .*>\n'
|
||||
r'(<a[\s\S]*?) </div>'
|
||||
r'<a href="/album/(\d+)/[\s\S]*?title="(.*?)"([\s\S]*?)<div class="title-truncate tags .*>([\s\S]*?)</div>'
|
||||
)
|
||||
|
||||
# 用来提取分类页面的的album的信息
|
||||
@ -383,7 +377,7 @@ class JmPageTool:
|
||||
# 查找错误,例如 [错误,關鍵字過短,請至少輸入兩個字以上。]
|
||||
pattern_html_search_error = compile(r'<fieldset>\n<legend>(.*?)</legend>\n<div class=.*?>\n(.*?)\n</div>\n</fieldset>')
|
||||
|
||||
pattern_html_search_total = compile(r'<span class="text-white">(\d+)</span> A漫.'), 0
|
||||
pattern_html_search_total = compile(r'class="text-white">(\d+)</span> A漫.'), 0
|
||||
|
||||
# 收藏页面的本子结果
|
||||
pattern_html_favorite_content = compile(
|
||||
@ -424,7 +418,9 @@ class JmPageTool:
|
||||
|
||||
album_info_list = cls.pattern_html_search_album_info_list.findall(html)
|
||||
|
||||
for (album_id, title, _, label_category, label_sub, tag_text) in album_info_list:
|
||||
for (album_id, title, _label_category_text, tag_text) in album_info_list:
|
||||
# 从label_category_text中可以解析出label-category和label-sub
|
||||
# 这里不作解析,因为没什么用...
|
||||
tags = cls.pattern_html_search_tags.findall(tag_text)
|
||||
content.append((
|
||||
album_id, {
|
||||
|
Loading…
Reference in New Issue
Block a user