fix: restore spider test suite
This commit is contained in:
@@ -241,12 +241,12 @@ class Spider(BaseSpider):
|
||||
if kind == "other":
|
||||
kind = self._normalize_drive_key(group_name)
|
||||
counters[kind] = counters.get(kind, 0) + 1
|
||||
line_name = f"{kind}@{counters[kind]}"
|
||||
line_name = f"{kind}#{counters[kind]}"
|
||||
entries.append((line_name, link))
|
||||
entries.sort(
|
||||
key=lambda pair: (
|
||||
self.DRIVE_ORDER.get(pair[0].split("@")[0], 999),
|
||||
int(pair[0].split("@")[1]),
|
||||
self.DRIVE_ORDER.get(pair[0].split("#")[0], 999),
|
||||
int(pair[0].split("#")[1]),
|
||||
pair[0],
|
||||
)
|
||||
)
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ class Spider(BaseSpider):
|
||||
def categoryContent(self, tid, pg, filter, extend):
|
||||
page = int(pg)
|
||||
class_path = str(tid or "").lstrip("/")
|
||||
url = self._build_url(f"{class_path}_{page}.html")
|
||||
url = self._build_url(f"{class_path}.html" if page <= 1 else f"{class_path}_{page}.html")
|
||||
items = self._parse_cards(self._request_html(url))
|
||||
return {"page": page, "limit": len(items), "total": page * 30 + len(items), "list": items}
|
||||
|
||||
|
||||
+20
-20
@@ -160,26 +160,26 @@ class Spider(BaseSpider):
|
||||
# ("30", "115网盘"),
|
||||
# ],
|
||||
# },
|
||||
# {
|
||||
# "id": "kuaiying",
|
||||
# "name": "快映",
|
||||
# "domains": ["http://154.201.83.50:12512", "http://xsayang.fun:12512"],
|
||||
# "filter_files": ["xiaoban.json"],
|
||||
# "list_xpath": "//*[contains(@class,'module-item')]",
|
||||
# "search_xpath": "//*[contains(@class,'module-search-item')]",
|
||||
# "detail_pan_xpath": "//*[contains(@class,'module-row-info')]//p",
|
||||
# "default_categories": [
|
||||
# ("5", "臻彩"),
|
||||
# ("1", "电影"),
|
||||
# ("2", "电视剧"),
|
||||
# ("3", "综艺"),
|
||||
# ("4", "动漫"),
|
||||
# ("6", "短剧"),
|
||||
# ("30", "115"),
|
||||
# ("35", "123"),
|
||||
# ("36", "天移迅"),
|
||||
# ],
|
||||
# },
|
||||
{
|
||||
"id": "kuaiying",
|
||||
"name": "快映",
|
||||
"domains": ["http://154.201.83.50:12512", "http://xsayang.fun:12512"],
|
||||
"filter_files": ["xiaoban.json"],
|
||||
"list_xpath": "//*[contains(@class,'module-item')]",
|
||||
"search_xpath": "//*[contains(@class,'module-search-item')]",
|
||||
"detail_pan_xpath": "//*[contains(@class,'module-row-info')]//p",
|
||||
"default_categories": [
|
||||
("5", "臻彩"),
|
||||
("1", "电影"),
|
||||
("2", "电视剧"),
|
||||
("3", "综艺"),
|
||||
("4", "动漫"),
|
||||
("6", "短剧"),
|
||||
("30", "115"),
|
||||
("35", "123"),
|
||||
("36", "天移迅"),
|
||||
],
|
||||
},
|
||||
{
|
||||
"id": "shandian",
|
||||
"name": "闪电",
|
||||
|
||||
Reference in New Issue
Block a user