Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add support for “danmaku” subtitles on nicovideo.jp #13841
Comments
|
As a reference, for HTML5 videos, danmaku is served via a mysterious format from /api.json/ [
{
"ping": {
"content": "rs:0"
}
},
{
"ping": {
"content": "ps:0"
}
},
{
"thread": {
"language": 1,
"last_res": 1,
"resultcode": 0,
"revision": 1,
"server_time": 1502041119,
"thread": "1498481660",
"ticket": "0x2e826693"
}
},
{
"leaf": {
"count": 1,
"language": 1,
"thread": "1498481660"
}
},
{
"ping": {
"content": "pf:0"
}
},
{
"ping": {
"content": "ps:1"
}
},
{
"thread": {
"language": 1,
"last_res": 1,
"resultcode": 0,
"revision": 1,
"server_time": 1502041119,
"thread": "1498481660",
"ticket": "0x2e826693"
}
},
{
"chat": {
"anonymity": 1,
"content": "给战姬打call,终于要出了",
"date": 1498483144,
"date_usec": 187515,
"language": 1,
"mail": "184",
"no": 1,
"premium": 1,
"thread": "1498481660",
"user_id": "7BSCuGwpjDFvigUQMAaMjC-q1WA",
"vpos": 1402
}
},
{
"ping": {
"content": "pf:1"
}
},
{
"ping": {
"content": "ps:2"
}
},
{
"thread": {
"fork": 1,
"last_res": 1,
"resultcode": 0,
"revision": 1,
"server_time": 1502041119,
"thread": "1498481660",
"ticket": "1500127358"
}
},
{
"global_num_res": {
"num_res": 931,
"thread": "1498481660"
}
},
{
"chat": {
"content": "@ジャンプ sm31574832",
"date": 1500127358,
"date_usec": 201000,
"fork": 1,
"no": 1,
"thread": "1498481660",
"vpos": 19800
}
},
{
"ping": {
"content": "pf:2"
}
},
{
"ping": {
"content": "rf:0"
}
}
]This is captured from http://www.nicovideo.jp/watch/sm31464864. |
|
So the "chat" -> "content" is what is supposed to be the subtitle (I don't know japanese)? "date" seems to be epoch, I mean seconds since 01/01/1970. It can be converted on command line e.g. by the following: EDIT: At least I am not interested after seeing nicovideo requires login. ^^ |
|
Hi, I found a blog article that explains the various fields in the JSON file here (in Japanese): https://qiita.com/tor4kichi/items/74939b49954d3e72d789 |
Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2017.08.06. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):
Description of your issue, suggested solution and other information
Most videos on nicovideo.jp contain an XML file representing comments from users, meant to be rendered on top of the video in a similar way as subtitles.
youtube-dl should expose a way to retrieve this track, either to then convert it to ass, or to (be made available to video players](mpv-player/mpv#4722).