Skip to main content

A spider of BiliBili.

基于python3编写的一个bilibili多线程爬虫。

安装

安装python 3.7

安装bilispider

  • pip3 install bilispider

快速入门

Windows

  • 在cmd中使用bilispider启动,输入bilispider –help以查看帮助
  • 在cmd中使用python -m bilispider

Linux

  • 在终端中使用python3 -m bilispider启动

作为模块导入

  • import bilispider
  • 使用help(bilispider.bilispider)以查看用法
  • 实例化类:s = bilispider.spider(tid,config={})
    • tid:分区的编号,查询方法见GUI和高级用法
    • config:字典类型变量(可选),用于指定设置参数,用法见高级用法
  • 开始爬取:s.auto_run()

GUI控制模式(测试版本)

  • 在终端使用bilispider --gui或python -m bilispider --gui(Linux下为python3 -m bilispider --gui )

    详见GUI指南

设置参数

  • -h,--help:打印帮助信息并退出
  • -v,--version:显示版本
  • -t,--tid:通过分组id进行爬取 可使用逗号连接多个tid,如:-t 1,2,3
  • -u,--url: 通过视频网址或av号自动识别分区并爬取 注意:仅在无(--tid,-t)时生效
  • -lc,--loadconfig: 指定配置文件 注意:单独指定的参数将覆盖配置文件参数
  • --output: `指定控制台输出模式 默认为1
    • 0-无输出
    • 1-进度条模式
    • 2-输出日志
  • --logmode:指定日志保存模式 默认为1
    • 0-不保存
    • 1-仅保存错误
    • 2-保存所有输出
  • --debug:启用调试
  • --saveconfig,-sc:根据参数保存配置文件并退出 注意:使用该参数不会爬取数据
  • --thread_num,-n:指定线程数,默认为2
    • 注意:线程数过多可能导致IP封禁
  • --gui,-g:打开可视化界面 (测试)
  • --safemode:安全模式

参数实例

bilispider --tid 30
bilispider -t 30

bilispider -u https://www.bilibili.com/video/av61967870
bilispider -u av61967870
bilispider -u 61967870

bilispider -t 30 --output 2 --logmode 2 --debug
bilispider -t 30 --output 2 --logmode 2 -sc config.json
bilispider -lc config.json

GUI指南

基本设置

GUI窗口

  • 在 从url识别中 输入av号或视频地址,点击确认获取分区信息
  • 点击确认以提交参数

高级设置

GUI窗口高级选项

HTTP服务器

  • 运行内置httpsever模块或使用BiliSpider_HTTPserver启动服务器
  • 服务器将运行于1214端口
  • 通过访问data路径可获取爬虫状态和系统资源信息,例如:

    http://localhost:1214/data

  • 返回值为json格式

高级用法

咕咕咕

参考数据

分区id

分区id 分区名 参考视频数
12 1
16 1565
17 单机游戏 6221824
19 Mugen 89044
20 宅舞 184628
21 日常 7980247
22 鬼畜调教 145640
24 MAD·AMV 469464
25 MMD·3D 447616
26 音MAD 57434
27 综合 1187167
28 原创音乐 78235
29 音乐现场 864911
30 VOCALOID·UTAU 223511
31 翻唱 943664
32 完结动画 15471
33 连载动画 26777
37 人文·历史 114960
39 演讲• 公开课 1177670
41 2
43 1
46 24
47 短片·手书·配音 340001
50 1
51 资讯 30902
53 156
54 OP/ED/OST 335
56 4
59 演奏 859353
60 1
63 2
65 网络游戏 4390798
67 124
71 综艺 1018459
74 528
75 动物圈 1494771
76 美食圈 1335408
77 7
79 3
80 14
82 674
83 其他国家 127
85 短片 497145
86 特摄 188464
94 3
95 手机平板 363292
96 星海 149167
98 机械 300963
114 1
116 1
118 1
120 2
121 GMV 187912
122 野生技术协会 676548
124 趣味科普人文 620610
125 7
126 人力VOCALOID 37279
127 教程演示 1477
128 2252
130 音乐综合 1265022
131 Korea相关 1708645
132 2
134 2
135 14
136 音游 531930
137 明星 2666391
138 搞笑 1724096
139 10
140 1
141 3
142 1
143 2
145 欧美电影 1161
146 日本电影 134
147 国产电影 3721
152 官方延伸 172077
153 国产动画 15262
154 舞蹈综合 189141
156 舞蹈教程 40732
157 美妆 642008
158 服饰 264172
159 T台 37156
161 手工 770090
162 绘画 721280
163 运动 1166346
164 健身 173115
166 广告 233056
168 国产原创相关 130812
169 布袋戏 31019
170 资讯 9240
171 电子竞技 3073928
172 手机游戏 6414333
173 桌游棋牌 554316
174 其他 2023313
175 ASMR 72
176 汽车 446090
178 科学·探索·自然 50397
179 军事 19674
180 社会·美食·旅行 175793
182 影视杂谈 462499
183 影视剪辑 3042705
184 预告 资讯 386427
185 国产剧 4826
186 港台剧 3
187 海外剧 1641
189 电脑装机 145668
190 摄影摄像 134530
191 影音智能 68526
192 风尚标 60105
193 MV 512412
194 电音 159584
195 动态漫·广播剧 19640
197 综合 988
198 街舞 167559
199 明星舞蹈 156726

Metadata

Release files for bilispider 0.9.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bilispider 0.9.6
File Size Uploaded Provenance Actions
bilispider-0.9.6.tar.gz 22.7 kB Without provenance Details for bilispider-0.9.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bilispider 0.9.6
File Interpreter ABI Platform Actions
bilispider-0.9.6-py3-none-any.whl Python 3 none any Details for bilispider-0.9.6-py3-none-any.whl

Total release size: 46.8 kB

Release files / bilispider-0.9.6.tar.gz

Download URL bilispider-0.9.6.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
30e7f38ec19d7b1f45388531626afdbf522a2f7f7d2c4254691662aa608b7017
BLAKE2b-256 checksum
How to use checksums
1cd1232fef9f8cb7527c7a6804a724cc167e39cad90961e528885d03147d8dd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.6

Release files / bilispider-0.9.6-py3-none-any.whl

Download URL bilispider-0.9.6-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d56b337082012e8ed11d880c4a649acc1fc0ae4c8f610d649779849126c1a9a
BLAKE2b-256 checksum
How to use checksums
379ade7ef48bf07e85eb84fadc316b51097503f3e64837899577f02f3beda876
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.6

Security for bilispider 0.9.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page