修复js0搜索翻页问题|ikanbot2

This commit is contained in:
hjdhnx 2023-10-04 00:06:21 +08:00
parent 257bfe582f
commit fb99511d41
2 changed files with 13 additions and 2 deletions

View File

@ -246,8 +246,14 @@ class CMS:
else: else:
self.url = urljoin(host, url) if host and url else url self.url = urljoin(host, url) if host and url else url
self.detailUrl = urljoin(host, detailUrl) if host and detailUrl else detailUrl if searchUrl.find('[') > -1 and searchUrl.find(']') > -1:
u1 = searchUrl.split('[')[0]
u2 = searchUrl.split('[')[1].split(']')[0]
self.searchUrl = urljoin(host, u1) + '[' + urljoin(host, u2) + ']' if host and searchUrl else searchUrl
else:
self.searchUrl = urljoin(host, searchUrl) if host and searchUrl else searchUrl self.searchUrl = urljoin(host, searchUrl) if host and searchUrl else searchUrl
self.detailUrl = urljoin(host, detailUrl) if host and detailUrl else detailUrl
self.class_name = rule.get('class_name', '') self.class_name = rule.get('class_name', '')
self.class_url = rule.get('class_url', '') self.class_url = rule.get('class_url', '')
self.class_parse = rule.get('class_parse', '') self.class_parse = rule.get('class_parse', '')
@ -1330,6 +1336,11 @@ class CMS:
if not self.searchUrl: if not self.searchUrl:
return self.blank() return self.blank()
url = self.searchUrl.replace('**', key).replace('fypage', pg) url = self.searchUrl.replace('**', key).replace('fypage', pg)
if fypage == 1 and self.test('[\[\]]', url):
url = url.split('[')[1].split(']')[0]
elif fypage > 1 and self.test('[\[\]]', url):
url = url.split('[')[0]
logger.info(f'{self.getName()}搜索链接:{url}') logger.info(f'{self.getName()}搜索链接:{url}')
if not self.搜索: if not self.搜索:
return self.blank() return self.blank()

View File

@ -1 +1 @@
3.9.48beta2 3.9.48beta3