Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for “danmaku” subtitles on nicovideo.jp #13841

Open
linkmauve opened this issue Aug 6, 2017 · 3 comments
Open

Add support for “danmaku” subtitles on nicovideo.jp #13841

linkmauve opened this issue Aug 6, 2017 · 3 comments
Labels

Comments

@linkmauve
Copy link

@linkmauve linkmauve commented Aug 6, 2017

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.08.06. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.08.06

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

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).

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 6, 2017

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.

@yan12125 yan12125 added the request label Aug 6, 2017
@kayb94
Copy link
Contributor

@kayb94 kayb94 commented Sep 5, 2017

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:
> date --date='@1500127358'
Sat Jul 15 16:02:38 CEST 2017

EDIT: At least I am not interested after seeing nicovideo requires login. ^^

@usushio
Copy link

@usushio usushio commented Mar 25, 2018

Hi, I found a blog article that explains the various fields in the JSON file here (in Japanese): https://qiita.com/tor4kichi/items/74939b49954d3e72d789
Hopefully, it will be useful for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.