如何查询排行榜数据 #234
-
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
暂时没有实现这个接口 |
Beta Was this translation helpful? Give feedback.
-
哈哈哈,是的,我翻了半天没找到这个,我还在想是不是我看代码少了啥呢 |
Beta Was this translation helpful? Give feedback.
-
实现的应该是登录、查询和下载的功能,不太会改 |
Beta Was this translation helpful? Give feedback.
-
你有兴趣帮忙实现这个排行榜功能吗?
我看了下网页版的排行榜,感觉和搜索页面差不多,正则表达式和请求方法都可以复用 |
Beta Was this translation helpful? Give feedback.
-
感觉完成不了,看到大概应该是在jm_client_impl.py中扩展方法,但是功底差了点 |
Beta Was this translation helpful? Give feedback.
-
可行的建议是这个接口有2个变量,一个迭代次数,一个是最终获取的id数,不然这个是无限循环的获取; |
Beta Was this translation helpful? Give feedback.
-
v2.4.9 已实现 from jmcomic import *
op = JmOption.default()
cl = op.new_jm_client()
# 月排行
page: JmCategoryPage = cl.month_ranking(1)
# 周排行
page: JmCategoryPage = cl.week_ranking(1)
# 循环获取分页,使用更底层的 categories_filter 和 categories_filter_gen
for page in cl.categories_filter_gen(1,
JmMagicConstants.TIME_WEEK,
JmMagicConstants.CATEGORY_ALL,
JmMagicConstants.ORDER_BY_VIEW,
):
for aid, atitle in page:
print(aid, atitle) |
Beta Was this translation helpful? Give feedback.
-
这个要使用参数category # 周排行
page: JmCategoryPage = cl.week_ranking(1,
category=JmMagicConstants.CATEGORY_SINGLE # 类别选择单本
) |
Beta Was this translation helpful? Give feedback.
这个要使用参数category