Datasets:
You need to agree to share your contact information to access this dataset
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
by downloading this dataset, you agree with the dataset license
Log in or Sign Up to review the conditions and access this dataset content.
Bilibili scrape
public videos, comments, comment threads and danmaku from Bilibili, scraped continuously since October 2026. comments, danmaku and stats history are uploaded every day, videos and the stats snapshot weekly.
from datasets import load_dataset
danmaku = load_dataset("tiagozip/bilibili", "danmaku", split="train", streaming=True)
videos = load_dataset("tiagozip/bilibili", "videos", split="train", streaming=True)
format
| config | notes |
|---|---|
| videos | one file per month of pubdate, data/videos/YYYY-MM.parquet |
| comments | split by scrape day, data/comments/fetched=YYYY-MM-DD/*.parquet |
| danmaku | split by scrape day, data/danmaku/fetched=YYYY-MM-DD/*.parquet |
| stats | snapshot, latest counters per video |
| stats_history | every counter reading, split by scrape day, data/stats_history/fetched=YYYY-MM-DD/*.parquet |
comments and danmaku are split by the day they were scraped (fetched_at), not by when they were posted. the scraper revisits videos, so the same comment or danmaku can appear in more than one day's folder with newer counters. to get one row each, dedupe on (oid, type, rpid) for comments and (cid, dmid) for danmaku and keep the row with the newest fetched_at. inside the a-* and b-* files of a single day, a row can also repeat, and the same rule applies.
a video (aid) has one or more parts, and each part has its own cid. danmaku belong to a part, so join them to videos through videos.cids. comments on a video have type = 1 and oid = aid.
videos
| column | type | notes |
|---|---|---|
aid |
uint64 | numeric video id |
bvid |
string | the BV... id used in urls |
mid |
uint64 | uploader id |
title |
string | |
intro |
string | description |
tid |
uint32 | category id |
tname |
string | category name |
copyright |
uint8 | 1 original, 2 reupload |
duration |
uint32 | seconds, all parts combined |
pubdate |
timestamp | publish time |
ctime |
timestamp | upload time |
pic |
string | cover image url |
state |
int32 | bilibili's review state, 0 is normal |
attr |
int32 | raw attribute bitfield |
videos |
uint16 | number of parts |
cids |
list[uint64] | part ids, in order |
page_titles |
list[string] | part titles, same order as cids |
fetched_at |
timestamp |
comments
| column | type | notes |
|---|---|---|
rpid |
uint64 | comment id |
oid |
uint64 | the commented object, the aid for videos |
type |
uint8 | 1 for videos |
root |
uint64 | top-level comment of the thread, 0 if top |
parent |
uint64 | comment being replied to, 0 if top |
mid |
uint64 | commenter id |
uname |
string | commenter name at fetch time |
message |
string | |
ctime |
timestamp | |
likes |
uint32 | counter at fetch time |
rcount |
uint32 | reply count at fetch time |
state |
uint8 | raw state flag |
fetched_at |
timestamp |
danmaku
| column | type | notes |
|---|---|---|
cid |
uint64 | video part id |
dmid |
uint64 | danmaku id |
progress |
uint32 | position in the video, milliseconds |
mode |
uint8 | 1-3 scrolling, 4 bottom, 5 top, 7 advanced, 8 code |
fontsize |
uint8 | |
color |
uint32 | rgb as an integer |
midhash |
string | sender hash, exactly as bilibili serves it |
content |
string | |
ctime |
timestamp | send time |
weight |
int8 | bilibili's block-level weight, 0 to 10 |
pool |
uint8 | 0 normal, 1 subtitle, 2 special |
fetched_at |
timestamp |
stats
aid, view, danmaku, reply, favorite, coin, share, likes,
his_rank, fetched_at. one row per video, the latest values read.
stats_history
same counters as stats plus now_rank, with one row per reading instead of one per video. (aid, fetched_at) is unique, so a video's rows in order of fetched_at give its view, like and comment counts over time.
what this is not
not complete. videos are found through bilibili's popular lists and related videos, so popular videos and their neighbours are overrepresented. the long tail of videos nobody watches is mostly missing.
danmaku coverage depends on the video. bilibili only serves a capped pool of danmaku per video, sized by video length. for most videos that pool holds every danmaku ever sent. for videos with more than about 2000 danmaku, the full current pool is fetched instead, which still leaves out older danmaku that bilibili rotated out. very busy videos are the least complete.
engagement counts are snapshots. every counter is whatever it read at
fetched_at, so do not treat these as final values.stats_historyhas every reading if you need the trend.no rich user profiles. commenter ids and names are in
comments, uploader ids are invideos, and that is all.
license
disclaimers
access can be revoked at any time and all data is provided as-is. this dataset contains personal information about real people, a lot of whom are not public figures. this dataset is not a reflection of the views of the author or the institutions they are affiliated with. please be respectful. everything in this dataset was publicly readable at the time it was fetched. videos, comments and most danmaku were fetched without logging in. the full danmaku pool on busy videos was fetched with a logged-in account, which reads the same danmaku the bilibili app shows to any viewer.
Bilibili is a trademark of its respective owner. this dataset is independent and unaffiliated.
opting out
you may opt out at optout.tiago.zip.
citation
@misc{bilibili,
title = {bilibili: a corpus of public Bilibili videos, comments and danmaku},
author = {tiagozip},
year = {2026},
url = {https://huggingface.co/datasets/tiagozip/bilibili}
}
- Downloads last month
- 725