Project Icon

chat-downloader

跨平台直播聊天数据获取工具

Chat Downloader是一款开源工具,用于从YouTube、Twitch、Zoom和Facebook等平台的直播、录播和剪辑中提取聊天数据。该工具支持命令行和Python API,无需身份验证即可获取和解析聊天信息。Chat Downloader提供多种配置选项,适用于直播内容分析和研究。

.. TODO - temp move ... move back to root - auto-generate using other rst files


Chat Downloader


.. image:: https://img.shields.io/pypi/pyversions/chat-downloader :target: https://pypi.org/project/chat-downloader :alt: Python

.. image:: https://img.shields.io/pypi/v/chat-downloader.svg :target: https://pypi.org/project/chat-downloader :alt: PyPI version

.. image:: https://pepy.tech/badge/chat-downloader/month :target: https://pypi.org/project/chat-downloader :alt: Downloads

.. image:: https://img.shields.io/github/license/xenova/chat-downloader :target: https://github.com/xenova/chat-downloader/blob/master/LICENSE :alt: License

.. image:: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fxenova%2Fchat-downloader%2Fmaster%2Fdocs%2F_dynamic%2Fcoverage.json :target: https://pypi.org/project/chat-downloader :alt: Coverage

.. GitHub issues GitHub forks GitHub stars Downloads

Chat Downloader_ is a simple tool used to retrieve chat messages from livestreams, videos, clips and past broadcasts. No authentication needed!

.. _Chat Downloader: https://github.com/xenova/chat-downloader

############ Installation ############

This tool is distributed on PyPI_ and can be installed with pip:

.. _PyPI: https://pypi.org/project/chat-downloader/

.. code:: console

$ pip install chat-downloader

To update to the latest version, add the --upgrade flag to the above command.

Alternatively, the tool can be installed with git:

.. code:: console

$ git clone https://github.com/xenova/chat-downloader.git $ cd chat-downloader $ python setup.py install

Usage

Command line

.. code:: console

usage: chat_downloader [-h] [--version] [--start_time START_TIME]
                       [--end_time END_TIME]
                       [--message_types MESSAGE_TYPES | --message_groups MESSAGE_GROUPS]
                       [--max_attempts MAX_ATTEMPTS]
                       [--retry_timeout RETRY_TIMEOUT]
                       [--interruptible_retry [INTERRUPTIBLE_RETRY]]
                       [--max_messages MAX_MESSAGES]
                       [--inactivity_timeout INACTIVITY_TIMEOUT]
                       [--timeout TIMEOUT] [--format FORMAT]
                       [--format_file FORMAT_FILE] [--chat_type {live,top}]
                       [--ignore IGNORE]
                       [--message_receive_timeout MESSAGE_RECEIVE_TIMEOUT]
                       [--buffer_size BUFFER_SIZE] [--output OUTPUT]
                       [--overwrite [OVERWRITE]] [--sort_keys [SORT_KEYS]]
                       [--indent INDENT] [--pause_on_debug | --exit_on_debug]
                       [--logging {none,debug,info,warning,error,critical} | --testing | --verbose | --quiet]
                       [--cookies COOKIES] [--proxy PROXY]
                       url

For example, to save messages from a livestream to a JSON file, you can use:

.. code:: console

$ chat_downloader https://www.youtube.com/watch?v=jfKfPfyJRdk --output chat.json

For a description of these options, as well as advanced command line use-cases and examples, consult the Command Line Usage <https://chat-downloader.readthedocs.io/en/latest/cli.html#command-line-usage>_ page.

Python

.. code:: python

from chat_downloader import ChatDownloader

url = 'https://www.youtube.com/watch?v=jfKfPfyJRdk' chat = ChatDownloader().get_chat(url) # create a generator for message in chat: # iterate over messages chat.print_formatted(message) # print the formatted message

For advanced python use-cases and examples, consult the Python Documentation <https://chat-downloader.readthedocs.io/en/latest/source/index.html#python-documentation>_.

########## Chat Items ##########

Chat items/messages are parsed into JSON objects (a.k.a. dictionaries) and should follow a format similar to this:

.. code-block::

{
    ...
    "message_id": "xxxxxxxxxx",
    "message": "actual message goes here",
    "message_type": "text_message",
    "timestamp": 1613761152565924,
    "time_in_seconds": 1234.56,
    "time_text": "20:34",
    "author": {
        "id": "UCxxxxxxxxxxxxxxxxxxxxxxx",
        "name": "username_of_sender",
        "images": [
            ...
        ],
        "badges": [
            ...
        ]
    },
    ...
}

For an extensive, documented list of included fields, consult the Chat Item Fields <https://chat-downloader.readthedocs.io/en/latest/items.html#chat-item-fields>_ page.

########################## Frequently Asked Questions ##########################

Coming soon

Issues

Found a bug or have a suggestion? File an issue here_. To assist the developers in fixing the issue, please follow the issue template as closely as possible.

.. _here: https://github.com/xenova/chat-downloader/issues/new/choose

############ Contributing ############

If you would like to help improve the tool, you'll find more information on contributing in our Contributing Guide <https://chat-downloader.readthedocs.io/en/latest/contributing.html#contributing-guide>_.

################ Supported sites: ################

  • YouTube.com - Livestreams, past broadcasts and premieres.
  • Twitch.tv - Livestreams, past broadcasts and clips.
  • Zoom.us - Past broadcasts
  • Facebook.com (currently in development) - Livestreams and past broadcasts.

.. _Chat Item Wiki: https://github.com/xenova/chat-downloader/wiki/Item-Template .. _Command Line Wiki: https://github.com/xenova/chat-downloader/wiki/Command-Line-Usage .. _Python Wiki: https://github.com/xenova/chat-downloader/wiki/Python-Documentation

项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

吐司

探索Tensor.Art平台的独特AI模型,免费访问各种图像生成与AI训练工具,从Stable Diffusion等基础模型开始,轻松实现创新图像生成。体验前沿的AI技术,推动个人和企业的创新发展。

Project Cover

SubCat字幕猫

SubCat字幕猫APP是一款创新的视频播放器,它将改变您观看视频的方式!SubCat结合了先进的人工智能技术,为您提供即时视频字幕翻译,无论是本地视频还是网络流媒体,让您轻松享受各种语言的内容。

Project Cover

美间AI

美间AI创意设计平台,利用前沿AI技术,为设计师和营销人员提供一站式设计解决方案。从智能海报到3D效果图,再到文案生成,美间让创意设计更简单、更高效。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号