GithubHelp home page GithubHelp logo

Comments (7)

hect0x7 avatar hect0x7 commented on July 23, 2024

这个属性实体类里是没有的,暂时获取不了。
如果要获取的话,网页端可以加个正则表达式,但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.

Yunxi-awa avatar Yunxi-awa commented on July 23, 2024

image
我看到搜索结果是有右上角的角标的,可以为JmSearchPage添加一个category的属性来获取大标签吗

from jmcomic-crawler-python.

hect0x7 avatar hect0x7 commented on July 23, 2024

可以加,但感觉意义不大。另外其实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.

Yunxi-awa avatar Yunxi-awa commented on July 23, 2024

可以加,但感觉意义不大。另外其实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.

Yunxi-awa avatar Yunxi-awa commented on July 23, 2024
    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.

hect0x7 avatar hect0x7 commented on July 23, 2024

    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.

Yunxi-awa avatar Yunxi-awa commented on July 23, 2024

{'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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.