yt-comment-dl


Nameyt-comment-dl JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummarySimple script for downloading Youtube comments without using the Youtube API
upload_time2025-08-28 19:40:37
maintainerNone
docs_urlNone
authoregbertbouman, Jo. Adly
requires_python>=3.10
licenseThe MIT License (MIT) Copyright (c) 2015 Egbert Bouman 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.
keywords youtube comments scraper downloader api-free
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # yt-comment-dl

Simple script for downloading YouTube comments without using the YouTube API. The output is in JSON format.

**This is a maintained fork of [egbertbouman/youtube-comment-downloader](https://github.com/egbertbouman/youtube-comment-downloader).**

## Installation

Preferably inside a [python virtual environment](https://virtualenv.pypa.io/en/latest/) install this package via:

```bash
pip install yt-comment-dl
```

Or directly from the GitHub repository:

```bash
pip install git+https://github.com/youssefadly237/yt-comment-dl.git
```

## Usage as command-line interface

```bash
$ yt-comment-dl --help
usage: yt-comment-dl [-h] [--output OUTPUT] [--pretty] [--limit LIMIT] [--language LANGUAGE] [--sort {0,1}] url

Download YouTube comments without using the YouTube API

positional arguments:
  url                                    YouTube video URL or video ID

options:
  -h, --help                             Show this help message and exit
  --output OUTPUT, -o OUTPUT             Output filename (default: comments_<video_id>.json)
  --pretty, -p                           Pretty-print JSON output
  --limit LIMIT, -l LIMIT                Maximum number of comments to download
  --language LANGUAGE, -a LANGUAGE       Language for YouTube generated text (e.g. en)
  --sort {0,1}, -s {0,1}                 Sort by: 0=popular, 1=recent (default: 1)
```

## Examples

Download comments using a YouTube URL:

```bash
yt-comment-dl "https://www.youtube.com/watch?v=ScMzIvxBSi4" --output ScMzIvxBSi4.json
```

Download comments using just the video ID:

```bash
yt-comment-dl ScMzIvxBSi4 --output ScMzIvxBSi4.json
```

Download the 50 most popular comments with pretty formatting:

```bash
yt-comment-dl ScMzIvxBSi4 --sort 0 --limit 50 --pretty
```

For YouTube IDs starting with `-` (dash), you may need to use quotes:

```bash
yt-comment-dl "-idwithdash"
```

## Usage as library

You can also use this script as a library. For instance, if you want to print out the 10 most popular comments for a particular YouTube video you can do the following:

```python
from itertools import islice
from yt_comment_dl import YoutubeCommentDownloader

downloader = YoutubeCommentDownloader()
comments = downloader.get_comments('ScMzIvxBSi4', sort_by=0)  # 0 = popular
for comment in islice(comments, 10):
    print(comment.to_dict())
```

## Output format

The output is a JSON array containing comment objects. Each comment has the following structure:

```json
[
  {
    "cid": "comment_id",
    "text": "Comment text",
    "time": "2 hours ago",
    "author": "Author Name",
    "channel": "author_channel_id",
    "votes": 42,
    "photo": "author_profile_photo_url",
    "heart": false,
    "reply": false,
    "time_parsed": 1234567890
  }
]
```

## License

MIT License - see [LICENSE](LICENSE) file for details

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "yt-comment-dl",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "youtube, comments, scraper, downloader, api-free",
    "author": "egbertbouman, Jo. Adly",
    "author_email": "egbertbouman <ebouman@gmail.com>, Jo. Adly <youssefadly237@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/21/6a/754a185800e0b5dff0e6871f718162081ce994c9070eca8fd4328da66c13/yt_comment_dl-0.1.0.tar.gz",
    "platform": null,
    "description": "# yt-comment-dl\n\nSimple script for downloading YouTube comments without using the YouTube API. The output is in JSON format.\n\n**This is a maintained fork of [egbertbouman/youtube-comment-downloader](https://github.com/egbertbouman/youtube-comment-downloader).**\n\n## Installation\n\nPreferably inside a [python virtual environment](https://virtualenv.pypa.io/en/latest/) install this package via:\n\n```bash\npip install yt-comment-dl\n```\n\nOr directly from the GitHub repository:\n\n```bash\npip install git+https://github.com/youssefadly237/yt-comment-dl.git\n```\n\n## Usage as command-line interface\n\n```bash\n$ yt-comment-dl --help\nusage: yt-comment-dl [-h] [--output OUTPUT] [--pretty] [--limit LIMIT] [--language LANGUAGE] [--sort {0,1}] url\n\nDownload YouTube comments without using the YouTube API\n\npositional arguments:\n  url                                    YouTube video URL or video ID\n\noptions:\n  -h, --help                             Show this help message and exit\n  --output OUTPUT, -o OUTPUT             Output filename (default: comments_<video_id>.json)\n  --pretty, -p                           Pretty-print JSON output\n  --limit LIMIT, -l LIMIT                Maximum number of comments to download\n  --language LANGUAGE, -a LANGUAGE       Language for YouTube generated text (e.g. en)\n  --sort {0,1}, -s {0,1}                 Sort by: 0=popular, 1=recent (default: 1)\n```\n\n## Examples\n\nDownload comments using a YouTube URL:\n\n```bash\nyt-comment-dl \"https://www.youtube.com/watch?v=ScMzIvxBSi4\" --output ScMzIvxBSi4.json\n```\n\nDownload comments using just the video ID:\n\n```bash\nyt-comment-dl ScMzIvxBSi4 --output ScMzIvxBSi4.json\n```\n\nDownload the 50 most popular comments with pretty formatting:\n\n```bash\nyt-comment-dl ScMzIvxBSi4 --sort 0 --limit 50 --pretty\n```\n\nFor YouTube IDs starting with `-` (dash), you may need to use quotes:\n\n```bash\nyt-comment-dl \"-idwithdash\"\n```\n\n## Usage as library\n\nYou can also use this script as a library. For instance, if you want to print out the 10 most popular comments for a particular YouTube video you can do the following:\n\n```python\nfrom itertools import islice\nfrom yt_comment_dl import YoutubeCommentDownloader\n\ndownloader = YoutubeCommentDownloader()\ncomments = downloader.get_comments('ScMzIvxBSi4', sort_by=0)  # 0 = popular\nfor comment in islice(comments, 10):\n    print(comment.to_dict())\n```\n\n## Output format\n\nThe output is a JSON array containing comment objects. Each comment has the following structure:\n\n```json\n[\n  {\n    \"cid\": \"comment_id\",\n    \"text\": \"Comment text\",\n    \"time\": \"2 hours ago\",\n    \"author\": \"Author Name\",\n    \"channel\": \"author_channel_id\",\n    \"votes\": 42,\n    \"photo\": \"author_profile_photo_url\",\n    \"heart\": false,\n    \"reply\": false,\n    \"time_parsed\": 1234567890\n  }\n]\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)\n         \n         Copyright (c) 2015 Egbert Bouman\n         \n         Permission is hereby granted, free of charge, to any person obtaining a copy\n         of this software and associated documentation files (the \"Software\"), to deal\n         in the Software without restriction, including without limitation the rights\n         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n         copies of the Software, and to permit persons to whom the Software is\n         furnished to do so, subject to the following conditions:\n         \n         The above copyright notice and this permission notice shall be included in all\n         copies or substantial portions of the Software.\n         \n         THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n         SOFTWARE.",
    "summary": "Simple script for downloading Youtube comments without using the Youtube API",
    "version": "0.1.0",
    "project_urls": {
        "Changelog": "https://github.com/youssefadly237/yt-comment-dl/releases",
        "Homepage": "https://github.com/youssefadly237/yt-comment-dl",
        "Issues": "https://github.com/youssefadly237/yt-comment-dl/issues",
        "Repository": "https://github.com/youssefadly237/yt-comment-dl"
    },
    "split_keywords": [
        "youtube",
        " comments",
        " scraper",
        " downloader",
        " api-free"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "79760c1751d624459a1a1023817d5fd9b226a55a80232464c39b3de9cf2e61bc",
                "md5": "45104af764a6a2d243a8a621587ace71",
                "sha256": "4383cabfee9bef04c7708b4e91bc239e1f09cc6ca10774eac5c04d4704cf08b6"
            },
            "downloads": -1,
            "filename": "yt_comment_dl-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "45104af764a6a2d243a8a621587ace71",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 11964,
            "upload_time": "2025-08-28T19:40:36",
            "upload_time_iso_8601": "2025-08-28T19:40:36.128764Z",
            "url": "https://files.pythonhosted.org/packages/79/76/0c1751d624459a1a1023817d5fd9b226a55a80232464c39b3de9cf2e61bc/yt_comment_dl-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "216a754a185800e0b5dff0e6871f718162081ce994c9070eca8fd4328da66c13",
                "md5": "c32a17a843c6115856d55d4f2ab3b842",
                "sha256": "b33352b0d0414df22e067ed1b56557b61968eed199d69e878644d8d1a2f7ff6b"
            },
            "downloads": -1,
            "filename": "yt_comment_dl-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c32a17a843c6115856d55d4f2ab3b842",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 8915,
            "upload_time": "2025-08-28T19:40:37",
            "upload_time_iso_8601": "2025-08-28T19:40:37.081874Z",
            "url": "https://files.pythonhosted.org/packages/21/6a/754a185800e0b5dff0e6871f718162081ce994c9070eca8fd4328da66c13/yt_comment_dl-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-28 19:40:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "youssefadly237",
    "github_project": "yt-comment-dl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "yt-comment-dl"
}
        
Elapsed time: 0.70638s