Skip to main content

Chat Downloader

Python PyPI version Downloads License Coverage

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

Installation

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

$ 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:

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

Usage

Command line

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:

$ 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 page.

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.

Chat Items

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

{
    ...
    "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 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.

Contributing

If you would like to help improve the tool, you’ll find more information on contributing in our Contributing Guide.

Supported sites:

  • YouTube.com - Livestreams, past broadcasts and premieres.

  • Twitch.tv - Livestreams, past broadcasts and clips.

  • Reddit.com - Livestreams, past broadcasts

  • Zoom.us - Past broadcasts

  • Facebook.com (currently in development) - Livestreams and past broadcasts.

Release files for chat-downloader 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chat-downloader 0.2.3
File Size Uploaded
chat-downloader-0.2.3.tar.gz 113.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chat-downloader 0.2.3
File Interpreter ABI Platform
chat_downloader-0.2.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 196.7 kB

Release files / chat-downloader-0.2.3.tar.gz

Download URL chat-downloader-0.2.3.tar.gz
Size 113.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e19f961480b14b55d03d4d4aaa766d46131bdf2ea8a79b47d20037dfd980201a
BLAKE2b-256 checksum
How to use checksums
bb140d2e32816027ec52318e5e32270acc89f785d05215aaa0f99b4abbfbc7df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / chat_downloader-0.2.3-py2.py3-none-any.whl

Download URL chat_downloader-0.2.3-py2.py3-none-any.whl
Size 83.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
89b6b4f306cbf4fca95712d48f77a868ffb6ebbf37346b9887272b3b46d63ed0
BLAKE2b-256 checksum
How to use checksums
9c7f1c482847d2443ae13739594e7e9e25cdae238977b5e3fb16cbb44e0b67fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page