{"id":20548662,"url":"https://github.com/natescarlet/qidian","last_synced_at":"2025-04-14T10:53:26.505Z","repository":{"id":37265563,"uuid":"254818352","full_name":"NateScarlet/qidian","owner":"NateScarlet","description":"起点中文网 go 客户端，基于网页版页面提取。","archived":false,"fork":false,"pushed_at":"2025-02-06T01:51:19.000Z","size":363,"stargazers_count":5,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T00:02:23.706Z","etag":null,"topics":["client","qidian"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NateScarlet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-11T07:47:01.000Z","updated_at":"2024-11-06T12:01:48.000Z","dependencies_parsed_at":"2024-02-23T00:27:09.953Z","dependency_job_id":"0da0da2e-fc27-448e-a409-eb744fc16316","html_url":"https://github.com/NateScarlet/qidian","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateScarlet%2Fqidian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateScarlet%2Fqidian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateScarlet%2Fqidian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateScarlet%2Fqidian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NateScarlet","download_url":"https://codeload.github.com/NateScarlet/qidian/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868773,"owners_count":21174756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","qidian"],"created_at":"2024-11-16T02:14:13.755Z","updated_at":"2025-04-14T10:53:26.476Z","avatar_url":"https://github.com/NateScarlet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qidian\n\n[![godev](https://img.shields.io/static/v1?label=godev\u0026message=reference\u0026color=00add8)](https://pkg.go.dev/github.com/NateScarlet/qidian/pkg)\n[![build status](https://github.com/NateScarlet/qidian/workflows/Go/badge.svg)](https://github.com/NateScarlet/qidian/actions)\n\n起点中文网 go 客户端，基于网页版页面提取。\n\n- [x] 小说分类搜索\n- [ ] 小说关键词搜索\n- [x] 小说详情页数据查询\n- [x] 小说排行查询\n- [x] 作者数据查询\n- [ ] 用户数据查询\n- [x] 反数据字体混淆\n- [x] 处理JS Cookie\n\n详细使用方法见代码注释\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"time\"\n\n    \"github.com/NateScarlet/qidian/pkg/author\"\n    \"github.com/NateScarlet/qidian/pkg/book\"\n    \"github.com/NateScarlet/qidian/pkg/client\"\n)\n\nctx := context.Background()\n\n// 默认使用 http.DefaultClient\nclient.For(ctx) // http.DefaultClient\n\n// 可对 context 设置自定义 http.Client 。\nclient.With(ctx, new(http.Client)) // context.Context\n\n// 分类搜索\nres, err = book.CategorySearch(\n    ctx,\n    book.CategorySearchOptionSubCategory(book.SC未来世界)\n    book.CategorySearchOptionSize(book.SizeGt300kLt500k)\n    book.CategorySearchOptionSort(book.SortWeekRecommend)\n    book.CategorySearchOptionUpdate(book.UpdateIn3Day)\n    book.CategorySearchOptionTag(\"变身\")\n    book.CategorySearchOptionPage(2)\n)\nres.Books() // []book.Book, error\n\n// 书籍详情\nb := \u0026book.Book{ID: \"1\"}\nb.Fetch(ctx) // error\nb.Title // \"魔法骑士英雄传说\"\nb.Author.ID // \"1\"\nb.Author.Name // \"宝剑锋\"\n\n// 书籍排行榜\nres, err := book.Rank(ctx, book.RTMonthlyTicket, book.RankOptionYearMonth(2020, time.January))\nbooks, err := res.Books() // []book.Book, error\n\n// 作者详情\na := \u0026author.Author{ID: \"1\"}\na.Fetch(ctx) // error\nb.Name // \"宝剑锋\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatescarlet%2Fqidian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatescarlet%2Fqidian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatescarlet%2Fqidian/lists"}