yt-dlp-danmaku


Nameyt-dlp-danmaku JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/UlyssesZh/yt-dlp-danmaku
Summaryyt-dlp plugin for converting Bilibili danmaku into ASS format
upload_time2024-03-25 02:20:04
maintainerNone
docs_urlNone
authorUlyssesZhan
requires_pythonNone
licenseMIT
keywords yt-dlp-plugins danmaku
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # yt-dlp-danmaku

[yt-dlp](https://github.com/yt-dlp/yt-dlp) plugin for converting Bilibili danmaku into ASS format.
Powered by [biliass](https://github.com/yutto-dev/biliass).

## Installation and upgrading

Requires yt-dlp 2023.01.02 or above.

You can install or upgrade this package with pip:

```shell
pip install -U yt-dlp-danmaku
```

## Usage

### Download video along with the ASS subtitle

```shell
yt-dlp --write-subs --use-postprocessor danmaku https://www.bilibili.com/video/BV1Sm4y1N78J
```

### Download video embedded with danmaku as a subtitle stream

Bilibili videos are originally mp4 format, but this format does not support ASS subtitle.
Therefore, you need to use another format that supports it, such as mkv:

```shell
yt-dlp --embed-subs --use-postprocessor danmaku --remux-video mkv https://www.bilibili.com/video/BV1Sm4y1N78J
```

You can then try playing this video with players that support ASS subtitles,
such as mpv and VLC.

### Download video and "burn" the danmaku onto it

You need to run FFmpeg yourself to do this.
Here is an example how you can do that:

```shell
yt-dlp --write-subs --use-postprocessor danmaku --output input https://www.bilibili.com/video/BV1Sm4y1N78J
ffmpeg -i input.mp4 -vf subtitles=input.danmaku.ass output.mp4
rm input.mp4 input.danmaku.ass
```

### Get ASS subtitle without downloading the video

```shell
yt-dlp --write-subs --use-postprocessor danmaku:when=before_dl --skip-download https://www.bilibili.com/video/BV1Sm4y1N78J
```

### Use with mpv

```shell
mpv --script-opts=ytdl_hook-ytdl_path=yt-dlp --ytdl-raw-options=use-postprocessor=danmaku:when=before_dl,write-subs=,no-simulate=,skip-download= https://www.bilibili.com/video/BV1Sm4y1N78J
```

You can turn on and off danmaku by using <kbd>j</kbd> (by default).
Add `--sid=1` to turn on danmaku on start.
You can add these options to your mpv config file.

*Notice*: this will leave an ASS file in the current directory.
Delete it afterwards if you do not want it.

## Configuration

You can pass options to this plugin.
For example, to set the opacity of danmaku texts to 0.1 and reserve the bottom 150 pixels, use
`--use-postprocessor danmaku:text_opacity=0.1;reserve_blank=150`.
All available options:

| Option | Default | Meaning |
|-|-|-|
| `lang` | danmaku | Language selector; you do not normally need to set this |
| `reserve_blank` | 0 | |
| `font_face` | sans-serif | |
| `font_size` | 25 | |
| `text_opacity` | 0.8 | |
| `duration_marquee` | 15 | |
| `duration_still` | 10 | |
| `comment_filter` | | |
| `is_reduce_comments` | false | |

Run `biliass -h` for more information about these options.

## Development

See the [Plugin Development](https://github.com/yt-dlp/yt-dlp/wiki/Plugin-Development)
section of the yt-dlp wiki.

## License

MIT.

MIT License

Copyright (c) 2022 Ulysses Zhan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/UlyssesZh/yt-dlp-danmaku",
    "name": "yt-dlp-danmaku",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "yt-dlp-plugins, danmaku",
    "author": "UlyssesZhan",
    "author_email": "ulysseszhan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/64/a0/7d0888fe83821a473d1fc29d8fbb0d4698506dd1f66ed59c6ded4cbad5ed/yt-dlp-danmaku-0.1.1.tar.gz",
    "platform": null,
    "description": "# yt-dlp-danmaku\n\n[yt-dlp](https://github.com/yt-dlp/yt-dlp) plugin for converting Bilibili danmaku into ASS format.\nPowered by [biliass](https://github.com/yutto-dev/biliass).\n\n## Installation and upgrading\n\nRequires yt-dlp 2023.01.02 or above.\n\nYou can install or upgrade this package with pip:\n\n```shell\npip install -U yt-dlp-danmaku\n```\n\n## Usage\n\n### Download video along with the ASS subtitle\n\n```shell\nyt-dlp --write-subs --use-postprocessor danmaku https://www.bilibili.com/video/BV1Sm4y1N78J\n```\n\n### Download video embedded with danmaku as a subtitle stream\n\nBilibili videos are originally mp4 format, but this format does not support ASS subtitle.\nTherefore, you need to use another format that supports it, such as mkv:\n\n```shell\nyt-dlp --embed-subs --use-postprocessor danmaku --remux-video mkv https://www.bilibili.com/video/BV1Sm4y1N78J\n```\n\nYou can then try playing this video with players that support ASS subtitles,\nsuch as mpv and VLC.\n\n### Download video and \"burn\" the danmaku onto it\n\nYou need to run FFmpeg yourself to do this.\nHere is an example how you can do that:\n\n```shell\nyt-dlp --write-subs --use-postprocessor danmaku --output input https://www.bilibili.com/video/BV1Sm4y1N78J\nffmpeg -i input.mp4 -vf subtitles=input.danmaku.ass output.mp4\nrm input.mp4 input.danmaku.ass\n```\n\n### Get ASS subtitle without downloading the video\n\n```shell\nyt-dlp --write-subs --use-postprocessor danmaku:when=before_dl --skip-download https://www.bilibili.com/video/BV1Sm4y1N78J\n```\n\n### Use with mpv\n\n```shell\nmpv --script-opts=ytdl_hook-ytdl_path=yt-dlp --ytdl-raw-options=use-postprocessor=danmaku:when=before_dl,write-subs=,no-simulate=,skip-download= https://www.bilibili.com/video/BV1Sm4y1N78J\n```\n\nYou can turn on and off danmaku by using <kbd>j</kbd> (by default).\nAdd `--sid=1` to turn on danmaku on start.\nYou can add these options to your mpv config file.\n\n*Notice*: this will leave an ASS file in the current directory.\nDelete it afterwards if you do not want it.\n\n## Configuration\n\nYou can pass options to this plugin.\nFor example, to set the opacity of danmaku texts to 0.1 and reserve the bottom 150 pixels, use\n`--use-postprocessor danmaku:text_opacity=0.1;reserve_blank=150`.\nAll available options:\n\n| Option | Default | Meaning |\n|-|-|-|\n| `lang` | danmaku | Language selector; you do not normally need to set this |\n| `reserve_blank` | 0 | |\n| `font_face` | sans-serif | |\n| `font_size` | 25 | |\n| `text_opacity` | 0.8 | |\n| `duration_marquee` | 15 | |\n| `duration_still` | 10 | |\n| `comment_filter` | | |\n| `is_reduce_comments` | false | |\n\nRun `biliass -h` for more information about these options.\n\n## Development\n\nSee the [Plugin Development](https://github.com/yt-dlp/yt-dlp/wiki/Plugin-Development)\nsection of the yt-dlp wiki.\n\n## License\n\nMIT.\n\nMIT License\n\nCopyright (c) 2022 Ulysses Zhan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "yt-dlp plugin for converting Bilibili danmaku into ASS format",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/UlyssesZh/yt-dlp-danmaku"
    },
    "split_keywords": [
        "yt-dlp-plugins",
        " danmaku"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "64a07d0888fe83821a473d1fc29d8fbb0d4698506dd1f66ed59c6ded4cbad5ed",
                "md5": "70b5ee32261a513c3e1a33d192ed3914",
                "sha256": "a10905b22e82a8347ac94e9569a4ecd3572e3a7452f1f0210e917d21a20b9046"
            },
            "downloads": -1,
            "filename": "yt-dlp-danmaku-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "70b5ee32261a513c3e1a33d192ed3914",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4890,
            "upload_time": "2024-03-25T02:20:04",
            "upload_time_iso_8601": "2024-03-25T02:20:04.275537Z",
            "url": "https://files.pythonhosted.org/packages/64/a0/7d0888fe83821a473d1fc29d8fbb0d4698506dd1f66ed59c6ded4cbad5ed/yt-dlp-danmaku-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-25 02:20:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "UlyssesZh",
    "github_project": "yt-dlp-danmaku",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "yt-dlp-danmaku"
}
        
Elapsed time: 0.21088s