Comments (7)
这个属性实体类里是没有的,暂时获取不了。
如果要获取的话,网页端可以加个正则表达式,但APP端接口没有返这个字段,所以这又是一个没法统一的字段。
config确实有定义,主要是用在分类排行方法的参数,例如:
from jmcomic import *
op = JmOption.default()
cl = op.new_jm_client()
# 获取周排行,类别选择韩漫(CATEGORY_HANMAN)
page = cl.week_ranking(page=1,
category=JmMagicConstants.CATEGORY_HANMAN,
)
for aid, atitle in page:
print(aid, atitle)
from jmcomic-crawler-python.
我看到搜索结果是有右上角的角标的,可以为JmSearchPage添加一个category的属性来获取大标签吗
from jmcomic-crawler-python.
可以加,但感觉意义不大。另外其实APP端的search接口是有返回category这个字段的。
from jmcomic import *
op = JmOption.default()
cl = op.new_jm_client(impl='api')
page = cl.search_site('无修正')
for aid, ainfo in page.content:
print(aid, ainfo['category']['title'])
"""
535012 同人
535020 同人
535028 同人
535045 同人
534968 其他類
526005 單本
378630 單本
"""
from jmcomic-crawler-python.
可以加,但感觉意义不大。另外其实APP端的search接口是有返回类别这个字段的。
from jmcomic import * op = JmOption.default() cl = op.new_jm_client(impl='api') page = cl.search_site('无修正') for aid, ainfo in page.content: print(aid, ainfo['category']['title']) """ 535012 同人 535020 同人 535028 同人 535045 同人 534968 其他類 526005 單本 378630 單本 """
感谢大佬🙏
from jmcomic-crawler-python.
def parse_api_to_search_page(cls, data: DictModel) -> JmSearchPage:
"""
model_data: {
"search_query": "MANA",
"total": "177",
"content": [
{
"id": "441923",
"author": "MANA",
"description": "",
"name": "[MANA] 神里绫华5",
"image": "",
"category": {
"id": "1",
"title": "同人"
},
"category_sub": {
"id": "1",
"title": "同人"
}
}
]
}
"""
total: int = int(data.total or 0) # 2024.1.5 data.total可能为None
content = cls.adapt_content(data.content)
return JmSearchPage(content, total)
这里的categoriy和category_sub有什么区别?
from jmcomic-crawler-python.
def parse_api_to_search_page(cls, data: DictModel) -> JmSearchPage: """ model_data: { "search_query": "MANA", "total": "177", "content": [ { "id": "441923", "author": "MANA", "description": "", "name": "[MANA] 神里绫华5", "image": "", "category": { "id": "1", "title": "同人" }, "category_sub": { "id": "1", "title": "同人" } } ] } """ total: int = int(data.total or 0) # 2024.1.5 data.total可能为None content = cls.adapt_content(data.content) return JmSearchPage(content, total)
这里的categoriy和category_sub有什么区别?
问得好,其实我也不知道🤣
from jmcomic-crawler-python.
{'id': '19', 'author': '渚ミナミ', 'description': None, 'name': '[渚ミナミ] 怪盗熟女クロアゲハ', 'image': '', 'category': {'id': '2', 'title': '单本'}, 'category_sub': {'id': '5', 'title': '韩漫'}, 'liked': False, 'is_favorite': False, 'tags': []}
这是程序运行中debug的输出,明显发现category_sub的id为5与19大相径庭。在禁漫APP上也没发现id=5的韩漫为什么跟id=19有关
from jmcomic-crawler-python.
Related Issues (20)
- 如何获得搜索结果数? HOT 1
- 无法正确获取所有domain HOT 6
- categories_filter_gen结果为空 HOT 5
- 你们下过来的长图都是这样的吗 HOT 5
- 关于命名规则的问题:能否在命名时加入tag以方便本地管理 HOT 2
- 在'趣味用法:测试你的ip可以访问哪些禁漫域名'中出现NameError: name 'AdvancedDict' is not defined HOT 2
- 按照album压缩 异常 HOT 2
- impersonate chrome is not supported HOT 3
- 希望能添加一个download_album_for_pdf函数直接下载pdf文件 HOT 2
- 发现个章节下载的小问题 HOT 1
- 手动调整Action下载包结构 下载完成的本子.zip/书名.zip
- 请问出现了如下状况怎么办啊 HOT 2
- 版本更新问题 HOT 1
- 有证书验证要怎么通过 HOT 1
- 下載多話的漫畫資料夾名稱問題 HOT 2
- 到最后一步下载不了,想请教下大佬 HOT 1
- 最新GitHub Actions 无法下载文件 HOT 7
- 功能需求:过滤重复图片 HOT 6
- 怎么使用jmcomic的搜索api HOT 8
- 你就是人类在漫漫黑夜中的一点星光
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmcomic-crawler-python.