{"id":21832743,"url":"https://github.com/liying2008/bilibili-data-statistics","last_synced_at":"2025-06-12T04:35:50.116Z","repository":{"id":57586106,"uuid":"124764754","full_name":"liying2008/bilibili-data-statistics","owner":"liying2008","description":"bilibili视频数据（播放数、弹幕数、评论数、收藏数、硬币数、分享数等）统计","archived":false,"fork":false,"pushed_at":"2019-05-28T10:36:01.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T07:45:21.106Z","etag":null,"topics":["bilibili","dep","go","go-dep","go-mysql","go-sqlite3","golang","mysql"],"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/liying2008.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-11T14:28:05.000Z","updated_at":"2024-06-26T14:59:56.000Z","dependencies_parsed_at":"2022-09-12T10:41:46.487Z","dependency_job_id":null,"html_url":"https://github.com/liying2008/bilibili-data-statistics","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/liying2008/bilibili-data-statistics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liying2008%2Fbilibili-data-statistics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liying2008%2Fbilibili-data-statistics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liying2008%2Fbilibili-data-statistics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liying2008%2Fbilibili-data-statistics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liying2008","download_url":"https://codeload.github.com/liying2008/bilibili-data-statistics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liying2008%2Fbilibili-data-statistics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259398671,"owners_count":22851479,"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":["bilibili","dep","go","go-dep","go-mysql","go-sqlite3","golang","mysql"],"created_at":"2024-11-27T19:25:16.169Z","updated_at":"2025-06-12T04:35:50.089Z","avatar_url":"https://github.com/liying2008.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bilibili 视频数据采集\n\n**此项目仅用于学习交流，请勿用作他途。**\n\n## 编译执行\n\n采集的数据可以存储到 **SQLite3** 数据库 或 **MySQL** 数据库，取决于 `db_config.json` 文件中的配置： \n \n`db_config.json`\n\n```json\n{\n  \"use_mysql\": true,\n  \"database\": \"video_data\",\n  \"username\": \"root\",\n  \"password\": \"root\"\n}\n```\n\n`use_mysql` 置为 `true` 则使用 **MySQL** 数据库，置为 `false` 则使用 **SQLite3** 数据库。其余 `database` 、 `username` 和 `password` 三项配置只针对 **MySQL** 数据库，如果使用 **MySQL** 数据库，请填写正确的配置。 \n\n### 1. 下载依赖库  \n\n需要提前安装 `dep` 工具（已安装的可忽略），下载安装命令：\n\n```shell\ngo get -u github.com/golang/dep/cmd/dep\n```\n\n安装依赖库：\n\n```shell\ndep ensure\n```\n\n### 2. 编译（在当前目录下执行命令）：  \n\n```shell\ngo build\n```\n\n### 3. 运行：\n\n- Windows:\n\n```shell\nbilibili-data-statistics.exe --start={start aid} --end={end aid} --samedb={true/false}\n```\n\n- Linux:\n\n```shell\n./bilibili-data-statistics --start={start aid} --end={end aid} --samedb={true/false}\n```\n\n\u003e **参数说明：**  \n**start**: 起始AV号，从此AV号开始采集；  \n**end**: 结束AV号，采集到该AV号就停止采集（不采集该AV号）；  \n**samedb**: 本次采集的数据是否和上次的数据存在一起（默认值：`false`）  \n（false: 如果使用 SQLite3 ，则会将上次采集生成的数据库文件重命名为以当前日期为结尾的文件名，并且新生成一个名为 `video_data.db` 的数据库文件，本次采集的数据都存在这个文件中；如果使用 MySQL ，则会将上次生成的表重命名,名称以当前日期结尾，然后生成一个新表，本次采集的数据都存在于新表中。  \ntrue: 如果使用 SQLite3 ，不重命名上次采集生成的数据库文件，本次采集的数据依然放在同一文件中；如果使用 MySQL ，不重名上次采集生成的表，本次采集的数据依然放在同一个表中。）；  \n\n\u003e 命令示例：  \n`bilibili-data-statistics.exe --start=30000 --end=100000 --samedb=true`\n\n目前使用单线程请求接口采集数据。  \n采集速率：约 **6.2条/s**\n\n请求的接口：http://api.bilibili.com/archive_stat/stat?aid={aid}\n\n## 字段说明\n\n```go\ntype Data struct {\n\tAid       uint64 `视频AV号`\n\tView      int   `播放数`\n\tDanmaku   int   `弹幕数`\n\tReply     int   `评论数`\n\tFavorite  int   `收藏数`\n\tCoin      int   `硬币数`\n\tShare     int   `分享数`\n\tNowRank   int   `当前排名`\n\tHisRank   int   `历史最高排名`\n\tLike      int   `喜欢数`\n\tNoReprint int   `暂不清楚含义`\n\tCopyright int   `稿件授权方式`\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliying2008%2Fbilibili-data-statistics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliying2008%2Fbilibili-data-statistics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliying2008%2Fbilibili-data-statistics/lists"}